Jump to content

expected 0 spaces


Nd_

Recommended Posts

Code:

            else if arg-1 is "toggle":
                  if player has permission "anticheat.toggle":
                        if {%player's uuid%.anticheat.notifications} is true:
                              message "&aNoSkill notifications have been turned off"
                              set {%player's uuid%.anticheat.notifications} to false
                        else:
                              message "&aNoSkill notifications have been turned on"
                              set {%player's uuid%.anticheat.notifications} to true
                  else:
                        message "&cYou do not have permission to run this command"

            else if arg-1 is "violation":
                  if arg-2 is "add":
                        if arg-3 is set:
                              if arg-4 is set:
                                    if arg-5 is set:
                                          if arg-6 is set:
                                                set {_p} to arg-3 parsed as an offline player
                                                set {_v} to arg-4 parsed as a number
                                                set {_r} to arg-5
                                                set {_c} to arg-6
                                                set {_ex} to arg-7
                                                set {_p.uuid} to {_p}'s uuid
                                                if {_p}'s ping is more than 300:
                                                      add {_v} / 2 to {%{_p.uuid}%.anticheat.violations.%{_r}%}
                                                else:
                                                      add {_v} to {%{_p.uuid}%.anticheat.violations.%{_r}%}
                                                if {%{_p.uuid}%.anticheat.violations.%{_r}%} is more or the same as {anticheat.violations.%{_r}%.max}:
                                                      set {%{_p.uuid}%.anticheat.violations.%{_r}%} to 0
                                                      if {_p} doesn't have permission "anticheat.ban.bypass":
                                                            execute console command "/minecraft:ban %{_p}% &a[NoSkill]&r %{_r}%" 
                                                            add "&4Ban&r: %{_r}% Check: %{_c}% Ping: %{_p}'s ping% TPS: %tps% Extra: %{_ex}%" to {%{p.uuid}%.anticheat::bans}
                                                            add 1 to {anticheat.bans}
                                                else:
                                                      loop all players:
                                                            if {%loop-player's uuid%.anticheat.notifications} is true:  
                                                                  message "&b[NoSkill] %{_p}% was detected for %{_r}%" to loop-player
                                                                  add "&6Warning&r: %{_r}% Check: %{_c}% Ping: %{_p}'s ping% TPS: %tps% Extra: %{_ex}%" to {%{p.uuid}%.anticheat::warnings}
            else if arg-1 is "gui":
                  anticheatgui(player)

All this code is being flagged for expected 0 spaces, found (number)

Link to comment
Share on other sites

^

like the above message said, you should probably send an error message.

Sounds like you've messed up indenting somewhere, probably on the first line of a function or command. Also, I'd recommend not making anticheats with skripts as they are extremely unreliable no matter how you code it. It'd be much better to get a good ncp config or mess around and make one yourself.

First Joined: July 2015
VIP: January 2020
Jr.Mod: 1st April 2020
Mod: 16th July 2020

Info:

~ Skript Developer
~ Discord: @nicholxs#0001
~ Previous names: Nichxlxs, Deterno, iHaveSkills, Retrical

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...