1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

On Offhand Switch Not working

Discussion in 'Skript' started by oHeckGage, Feb 7, 2021.

Thread Status:
Not open for further replies.
  1. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    4
    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 (Text):
    1.  
    2. on offhand move:
    3.     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":
    4.         stop
    5.     apply jump boost 3 to player for 9999 days
    6.     set {jumptalis::%player%} to true
    7. on offhand move:
    8.     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":
    9.         stop
    10.     apply regeneration 2 to player for 9999 days
    11.     set {healtalis::%player%} to true
    12. on offhand move:
    13.     if {healtalis::%player%} is true:
    14.         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":
    15.             remove regeneration from the player
    16.     if {jumptalis::%player%} is true:
    17.         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":
    18.             remove jump boost from the player
    19.  
    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.
    --- Double Post Merged, Feb 7, 2021, Original Post Date: Feb 7, 2021 ---
    bump
     
  2. TehCheetah

    TehCheetah Member

    Joined:
    Feb 7, 2021
    Messages:
    49
    Likes Received:
    1
    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.
     
  3. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    4
    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....
    --- Double Post Merged, Feb 10, 2021, Original Post Date: Feb 10, 2021 ---
    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
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...