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.

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

Discussion in 'Skript' started by Eli83592, Nov 4, 2022.

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

    Eli83592 New Member

    Joined:
    Oct 28, 2022
    Messages:
    5
    Likes Received:
    0
  2. foxyplush

    foxyplush Member

    Joined:
    Apr 25, 2022
    Messages:
    14
    Likes Received:
    1
    Code (Text):
    1. command /activeduty [<text>]:
    2.     permission: staff.active
    3.     trigger:
    4.         if {vias.%player%} is not set:
    5.             send "&cIf you are caught abusing this (we have logs) you will be demoted and possibly banned." to player
    6.             set {vias.%player%} to 1
    7.             set {loc} to location of block at location of player
    8.             send "&9You toggled active mode!" to player
    9.             execute console command "/fly %player% on"
    10.             execute console command "tab player %player% tagsuffix &c&lON-DUTY&8-&e%arg-1%"
    11.         else:
    12.             send "&9You toggled active mode!" to player
    13.             execute console command "/fly %player% off"
    14.             wait 1 tick
    15.             clear {vias.%player%}
    16.             teleport player to {loc}
    17.             execute console command "tab player %player% tagsuffix &f"
    18.             send "&cIf you are caught abusing this (we have logs) you will be demoted and possibly banned." to player
    19.            
    20. on damage:
    21.     if {vias.%victim%} is set:
    22.         cancel event
    23.  
    24. command /freeze [<text>]:
    25.     Permission: staff.freeze
    26.     trigger:
    27.         if arg-1 is set:
    28.             set {_p} to arg-1 parsed as offline player
    29.             if arg-1 parsed as player is online:
    30.                 if arg-1 parsed as player has permission "staff.bypass.freeze":
    31.                     send "&bYou cannot freeze that person!"
    32.                 else:
    33.                     if {froze.%arg-1%} is not set:
    34.                         set {froze.%arg-1%} to true
    35.                         send "You have been frozen by %player%" to arg-1 parsed as offline player
    36.                     else:
    37.                         clear {froze.%arg-1%}
    38.                         send "You were unfrozen by %player%" to arg-1 parsed as offline player
    39.                        
    40. on player move:
    41.     if {froze.%player%} is set:
    42.         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!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...