Solved "'else' has to be placed just after another 'if' or 'else if' section"

  • 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 community!

    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!

VisoXD

New Member
Dec 22, 2023
7
0
1
I ran into a problem when creating a /punish script, that was supposed to crash some and send them a custom message.

command /punish <text> <player> <text>:
permission: skript.punish
usage: /punish category <player> message
trigger:
if arg-1 is "cheater":
if arg-2 is set:
if arg-3 is set:
command "/title %arg-2% title {""text"":""%arg-3%"",""color"":""red"",""bold"":true}"
send "&4&l--- Cheating is against our rules! ---" to arg-2
send "&cYou're still allowed to play this server, if you toggle off your cheats, but just know that you probably won't get another chance after this." to arg-2
send "&cFor now this is your &4&lpunishment&r&c..." to arg-2
wait 15 seconds
command "crash %arg-2%"
wait 2 seconds
command "kick %arg-2% &cUnfair Advantage."
command "say &4&l%arg-2% &r&cwas &4&lcheating/abusing&r&c and therefore kicked."
else:
send "You must specify a category!"
else:
send "You must specify a player!"
else:
send "You must specify a message!"

The problem is in line 19 (atleast thats what is what skript says). I don't have any idea how to fix it, well I don't even know what the problem is, if someone knows how to fix that please respond with a solution.
Thanks!
 
First of all, 2 of those if’s at the start are useless, if an argument is not between [] the player HAS TO fill them in. And code brackets are really cool when you made an indentation error.
Code:
try them sometime