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.

Solved I don't know what i did wrong. Can someone help me?

Discussion in 'Skript' started by JX_Snack, Feb 24, 2022.

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

    JX_Snack Member

    Joined:
    Feb 23, 2022
    Messages:
    4
    Likes Received:
    1
    Hello! I need help with one of my Skripts i have constructed. I just began using variables but i don't know what i did wrong because it does not work. Can you help?

    Code (Text):
    1. options:
    2.     {Superhand::%player%} = 1
    3.     {SuperhandEnabled::%player%} = false
    4.  
    5. command /superhand <number>:
    6.     trigger:
    7.         {Superhand::%player%} = arg-1
    8.         send action bar "&7Set Superhand radius to &a{Superhand::%player%}&7!" to player
    9.  
    10. command /superhandtoggle:
    11.     trigger:
    12.         if {SuperhandEnabled::%player%} is true:
    13.             {SuperhandEnabled::%player%} = false
    14.             send action bar "&cDisabled &7superhand!" to player
    15.         else:
    16.             {SuperhandEnabled::%player%} = true
    17.             send action bar "&aEnabled &7superhand!" to player
    18.  
    19. on leftclick:
    20.     if {SuperhandEnabled::%player%} is true:
    21.         set blocks in radius {Superhand::%player%} to air
    What i would expect it would do:
    With '/superhand 5' it would change the superhand radius to 5.
    With '/superhandtoggle' you can toggle superhand.
    I really don't know what i did wrong. Can someone help me? (btw i'm sorry if my english is not that good, that is because i'm german)
    --- Double Post Merged, Feb 24, 2022, Original Post Date: Feb 24, 2022 ---
    Ah, i got it fixed :emoji_slight_smile:
    --- Double Post Merged, Feb 24, 2022 ---
    My fixed code:
    Code (Text):
    1.  
    2. variables:
    3.     {Superhand::%player%} = 1
    4.     {SuperhandEnabled::%player%} = false
    5.  
    6. command /superhand <number>:
    7.     permission: "snackbagsk.admin.superhand.radius"
    8.     trigger:
    9.         if arg-1 is 0:
    10.             send action bar "&cDisabled &7superhand!" to player
    11.             set {SuperhandEnabled::%player%} to false
    12.         else if arg-1 is more than 15:
    13.             send action bar "&cMaximum Superhand radius is &l15&c!" to player
    14.         else:
    15.             send action bar "&7Set Superhand radius to &a%arg-1%&7!" to player
    16.             set {Superhand::%player%} to arg-1
    17.  
    18. command /superhandtoggle:
    19.     permission: "snackbagsk.admin.superhand.toggle"
    20.     trigger:
    21.         if {SuperhandEnabled::%player%} is true:
    22.             send action bar "&cDisabled &7superhand!" to player
    23.             set {SuperhandEnabled::%player%} to false
    24.         else:
    25.             send action bar "&aEnabled &7superhand!" to player
    26.             set {SuperhandEnabled::%player%} to true
    27.  
    28. command /superhandinfo:
    29.     permission: "snackbagsk.admin.superhand.info"
    30.     trigger:
    31.         send "&7Superhand Status of &a&o%player%&7:" to player
    32.        
    33.         if {Superhand::%player%} is 10 or 11 or 12 or 13 or 14 or 15:
    34.             send "&7Radius: &e&o%{Superhand::%player%}%" to player
    35.         else if {Superhand::%player%} is less than 10:
    36.             send "&7Radius: &a&o%{Superhand::%player%}%" to player
    37.         else:
    38.             send "&7Radius: &4&o%{Superhand::%player%}%" to player
    39.  
    40.         if {SuperhandEnabled::%player%} is true:
    41.             send "&7Status: &a&oEnabled" to player
    42.         else:
    43.             send "&7Status: &c&oDisabled" to player
    44.  
    45. on break:
    46.     if {SuperhandEnabled::%player%} is true:
    47.         if player has permission "snackbagsk.admin.superhand.use":
    48.             if world is not "BwMaps" or "build" or "yt" or "snackbag" or "bedwarslobby" or "duels" or "mmistery":
    49.                 set blocks in radius {Superhand::%player%} to air
    50.             else:
    51.                 send "&cYou can't use Superhand here! Use '/superhandtoggle' to disable superhand!"
    52.                 cancel event
    53.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...