I have no clue how to fix this the errors say indention errors but if i fix it it doesnt work!

  • 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.
Code:
command /activeduty [<text>]:
    permission: staff.active
    trigger:
        if {vias.%player%} is not set:
            send "&cIf you are caught abusing this (we have logs) you will be demoted and possibly banned." to player
            set {vias.%player%} to 1
            set {loc} to location of block at location of player
            send "&9You toggled active mode!" to player
            execute console command "/fly %player% on"
            execute console command "tab player %player% tagsuffix &c&lON-DUTY&8-&e%arg-1%"
        else:
            send "&9You toggled active mode!" to player
            execute console command "/fly %player% off"
            wait 1 tick
            clear {vias.%player%}
            teleport player to {loc}
            execute console command "tab player %player% tagsuffix &f"
            send "&cIf you are caught abusing this (we have logs) you will be demoted and possibly banned." to player
            
on damage:
    if {vias.%victim%} is set:
        cancel event

command /freeze [<text>]:
    Permission: staff.freeze
    trigger:
        if arg-1 is set:
            set {_p} to arg-1 parsed as offline player
            if arg-1 parsed as player is online:
                if arg-1 parsed as player has permission "staff.bypass.freeze":
                    send "&bYou cannot freeze that person!"
                else:
                    if {froze.%arg-1%} is not set:
                        set {froze.%arg-1%} to true
                        send "You have been frozen by %player%" to arg-1 parsed as offline player
                    else:
                        clear {froze.%arg-1%}
                        send "You were unfrozen by %player%" to arg-1 parsed as offline player
                        
on player move:
    if {froze.%player%} is set:
        cancel event
Here are the reasons why it gave a couple errors:
Line 28: There's no indentation canceling out the if statement on line 27
Line 36: The 'if' in the 'else if:' is not required since you didn't include another if statement. There was also an extra space between the 'if' and the ':'
Argument issues:
Since arg-1 was technically a text, it doesn't know how to check if a text is online or how to send a message to a text. Including a 'parsed as offline player' (I know you want to check if the player is online, but it works) will fix it. You could also change the [<text>] to [<player>] and it would fix it (though you would need to remove all of the 'parsed as offline player'). Have a good day!
 
Status
Not open for further replies.