Help me Pls

  • 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 community!

    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.

llucass1100

Member
Feb 9, 2017
12
0
0
Need to know how I do for when I put an item on the other with the open inventarium run something.
Any help me ?
 
Please explain.
I could be wrong, but I think they mean, if say they have a diamond sword in hotbar slot 1, and they click it with another item (such as a book) it will run an effect.
Personally I have tried this what feels like hundreds of times (probably more like 3 times) and I never have good luck with it!
 
I could be wrong, but I think they mean, if say they have a diamond sword in hotbar slot 1, and they click it with another item (such as a book) it will run an effect.
Personally I have tried this what feels like hundreds of times (probably more like 3 times) and I never have good luck with it!
Yes that's right that I need
Please explain.
Sorry my english is a very bad
 
Okay I fiddled around and this is what I came up with
NOTE: This will only work in survival mode and NOT in creative mode
code_language.skript:
on inventory click:
    if clicked item is diamond boots: #this is the item you are clicking on
        if player's cursor is book: #this is the item in your hand
            cancel event #this stops the action
            set player's cursor to air #this removes the item from the player's hand
            set clicked item to diamond boots of mending #This sets the new item you clicked on

This is just an example of how to use this, but you can change this up to do anything you would like
 
Okay I fiddled around and this is what I came up with
NOTE: This will only work in survival mode and NOT in creative mode
code_language.skript:
on inventory click:
    if clicked item is diamond boots: #this is the item you are clicking on
        if player's cursor is book: #this is the item in your hand
            cancel event #this stops the action
            set player's cursor to air #this removes the item from the player's hand
            set clicked item to diamond boots of mending #This sets the new item you clicked on

This is just an example of how to use this, but you can change this up to do anything you would like
Thank you , How do I get the lore of the item I put in the sword and put to sword ?

And all the diamond tools are giving to put the item up. How do you solve this?




on inventory click:
if clicked item is diamond sword: #this is the item you are clicking on
if player's cursor is {_item}: #this is the item in your hand
cancel event #this stops the action
set player's cursor to air #this removes the item from the player's hand
set clicked item to diamond#This sets the new item you clicked on
command /trinket [<player>]:
trigger:
argument 1 is a player:
set {random.fire.%player%} to a random integer between 5 and 15
set {_item} to Magenta Dye named "&6Trinket Fire"
set 1st line of lore of {_item} to "&4FIRE +%{random.fire.%player%}%"
give {_item} to the player
send message "{@Server}&7You Win a &6Trinket Fire: +%{random.fire.%player%}%" to the player
 
Last edited:
first of all please put your code in a code block, its too hard to figure out what's going on when its all inline
second, variables that start with an underscore "{_item}" are local variables, which means they're local to the event only, meaning if the variable is created within the command, it will only work in that command. So using it in your inventory click event won't work.
third, just use the lore expression to check the lore of the player's cursor, and add it to the lore of the clicked item.
 
code_language.skript:
on inventory click:
    if clicked item is diamond sword: #this is the item you are clicking on
        if player's cursor is {_item}: #this is the item in your hand
            cancel event #this stops the action
            set player's cursor to air #this removes the item from the player's hand
            set clicked item to diamond sword of fire aspect 2#This sets the new item you clicked on

command /trinket [<player>]:
    trigger:
        argument 1 is a player:
            set {random.fire.%player%} to a random integer between 5 and 15
            set {_item} to Magenta Dye named "&6Trinket Fire"
            set 1st line of lore of {_item} to "&4FIRE +%{random.fire.%player%}%"
            give {_item} to the player
            send message "{@Server}&7You Win a &6Trinket Fire: +%{random.fire.%player%}%" to the player

first of all please put your code in a code block, its too hard to figure out what's going on when its all inline
second, variables that start with an underscore "{_item}" are local variables, which means they're local to the event only, meaning if the variable is created within the command, it will only work in that command. So using it in your inventory click event won't work.
third, just use the lore expression to check the lore of the player's cursor, and add it to the lore of the clicked item.

Could you help me with that? I'm a beginner, I don't even know where to start.
And all the diamond tools are giving to put the item up. How do you solve this?
 
Status
Not open for further replies.