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

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

JX_Snack

New Member
Feb 23, 2022
5
1
3
23
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:
options:
    {Superhand::%player%} = 1
    {SuperhandEnabled::%player%} = false

command /superhand <number>:
    trigger:
        {Superhand::%player%} = arg-1
        send action bar "&7Set Superhand radius to &a{Superhand::%player%}&7!" to player

command /superhandtoggle:
    trigger:
        if {SuperhandEnabled::%player%} is true:
            {SuperhandEnabled::%player%} = false
            send action bar "&cDisabled &7superhand!" to player
        else:
            {SuperhandEnabled::%player%} = true
            send action bar "&aEnabled &7superhand!" to player

on leftclick:
    if {SuperhandEnabled::%player%} is true:
        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)
[doublepost=1645696461,1645693378][/doublepost]Ah, i got it fixed :emoji_slight_smile:
[doublepost=1645697143][/doublepost]My fixed code:
Code:
variables:
    {Superhand::%player%} = 1
    {SuperhandEnabled::%player%} = false

command /superhand <number>:
    permission: "snackbagsk.admin.superhand.radius"
    trigger:
        if arg-1 is 0:
            send action bar "&cDisabled &7superhand!" to player
            set {SuperhandEnabled::%player%} to false
        else if arg-1 is more than 15:
            send action bar "&cMaximum Superhand radius is &l15&c!" to player
        else:
            send action bar "&7Set Superhand radius to &a%arg-1%&7!" to player
            set {Superhand::%player%} to arg-1

command /superhandtoggle:
    permission: "snackbagsk.admin.superhand.toggle"
    trigger:
        if {SuperhandEnabled::%player%} is true:
            send action bar "&cDisabled &7superhand!" to player
            set {SuperhandEnabled::%player%} to false
        else:
            send action bar "&aEnabled &7superhand!" to player
            set {SuperhandEnabled::%player%} to true

command /superhandinfo:
    permission: "snackbagsk.admin.superhand.info"
    trigger:
        send "&7Superhand Status of &a&o%player%&7:" to player
       
        if {Superhand::%player%} is 10 or 11 or 12 or 13 or 14 or 15:
            send "&7Radius: &e&o%{Superhand::%player%}%" to player
        else if {Superhand::%player%} is less than 10:
            send "&7Radius: &a&o%{Superhand::%player%}%" to player
        else:
            send "&7Radius: &4&o%{Superhand::%player%}%" to player

        if {SuperhandEnabled::%player%} is true:
            send "&7Status: &a&oEnabled" to player
        else:
            send "&7Status: &c&oDisabled" to player

on break:
    if {SuperhandEnabled::%player%} is true:
        if player has permission "snackbagsk.admin.superhand.use":
            if world is not "BwMaps" or "build" or "yt" or "snackbag" or "bedwarslobby" or "duels" or "mmistery":
                set blocks in radius {Superhand::%player%} to air
            else:
                send "&cYou can't use Superhand here! Use '/superhandtoggle' to disable superhand!"
                cancel event
 
Status
Not open for further replies.