Solved Two questions, Skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

xGrow

Member
Feb 26, 2017
10
1
0
27
1º Question:
How i can know what was a player's tools what the player was using to cancel drop or clear drop?:
Like this:
code_language.skript:
on drop:
    if player's tool is a bowl:
        wait 5 ticks
        clear dropped items

2º Question:
How i can put a number of items in variable to give a player when he join:
Like this:
code_language.skript:
on join:
    if {lc.nmr.%player%} is more or equal to 1:
        set slot 1 of player to {lc.nmr.%player%} trapped chest named "&c&lLoot Crate"

Error:
code_language.skript:
a slot can't be set to '{lc.nmr.%player%} trapped chest named "&c&lLoot Crate"' because the latter is neither an item type nor an item stack (kits.sk, line 321: set slot 1 of player to {lc.nmr.%player%} trapped chest named "&c&lLoot Crate"')
 
How i can know what was a player's tools what the player was using to cancel drop or clear drop?
Use the expression: "%dropped item%", to find out which item was dropped. If you want to delete the dropped item, then you can use the effect "delete dropped item".

Here is an example:
code_language.skript:
on drop:
    broadcast "%dropped item%"
    if dropped item is a bowl:
        delete dropped item


How i can put a number of items in variable to give a player when he join?
Just put "of" after your variable, and it should be fixed.

Here is an example:
code_language.skript:
on join:
    set slot 1 of player to {lc.nmr.%player%} of trapped chest named "&c&lLoot Crate"
    give player {lc.nmr.%player%} of trapped chest named "&c&lLoot Crate"
 
  • Like
Reactions: Snow-Pyon
1º Question:
How i can know what was a player's tools what the player was using to cancel drop or clear drop?:
Like this:
code_language.skript:
on drop:
    if event-item is a bowl:
        cancel event


2º Question:
How i can put a number of items in variable to give a player when he join:
Like this:
code_language.skript:
on join:
    if {lc.nmr.%player%} is more or equal to 1:
        set slot 1 of player to {lc.nmr.%player%} trapped chest named "&c&lLoot Crate"

Error:
code_language.skript:
a slot can't be set to '{lc.nmr.%player%} trapped chest named "&c&lLoot Crate"' because the latter is neither an item type nor an item stack (kits.sk, line 321: set slot 1 of player to {lc.nmr.%player%} trapped chest named "&c&lLoot Crate"')


First question:
You only need to do this
code_language.skript:
on drop:
    if event-item is a bowl:
        cancel event

Second question:
Another persons helped you.
 
Status
Not open for further replies.