On Offhand Switch Not working

  • 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.

oHeckGage

Active Member
Mar 24, 2020
110
6
18
22
When I try and use my "on offhand [move|switch]" event from Skellet, it doesn't work sometimes. Like when you click the slot in your inventory, it doesn't count as switching and therefore, doesn't trigger the event. If anyone knows a solution to this, please tell me. I'm trying to work on talismans and I can't do all of them with attributes. Thank you.

Here's my code:
Code:
on offhand move:
    if player's offhand tool isn't a ghast tear named "&bJumping Talisman" with lore "&d&oGiven to those who strive to obtain the max jump":
        stop
    apply jump boost 3 to player for 9999 days
    set {jumptalis::%player%} to true
on offhand move:
    if player's offhand tool isn't a red tulip named "&dHealth Talisman" with lore "&d&oGiven to those who want the most health ever":
        stop
    apply regeneration 2 to player for 9999 days
    set {healtalis::%player%} to true
on offhand move:
    if {healtalis::%player%} is true:
        if player's offhand tool isn't a red tulip named "&dHealth Talisman" with lore "&d&oGiven to those who want the most health ever":
            remove regeneration from the player
    if {jumptalis::%player%} is true:
        if player's offhand tool isn't a ghast tear named "&bJumping Talisman" with lore "&d&oGiven to those who strive to obtain the max jump":
            remove jump boost from the player

Edit: Another big bug is that when you move it into the slot, the event doesn't trigger. It's only when you move it outside of the slot.
[doublepost=1612732094,1612720639][/doublepost]bump
 
Hey,

You are using events in your code, and using "stop".

Try using "cancel event" for event codes! If you don't know what events are, please refer to this Document: https://skriptlang.github.io/Skript/events.html


Please make sure everything is spelled correctly, and everything is correct. If you are still having errors let me know.
 
I'm using "stop" because I don't want to cancel the event, but I don't want the rest of the code to be used....
[doublepost=1612966293,1612966219][/doublepost]and btw, I checked over it a ton of times, I wouldn't just come here just for nothing... you joined sunday, I joined almost a year ago, I think I know more about skript than you do
 
Status
Not open for further replies.