Is there a problem with my code?

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

Mr_Allawi_

Member
Sep 20, 2021
12
0
1
15
for some reason when i reload this i have no errors but when i try to use it it dosen't work

Code:
command /vanish:
  permission: vanish
  permission message: &cYou can't use that!
  trigger:
    if {vanish::%player%} is false:
      set {vanish::%player%} to true
    if {vanish::%player%} is true:
      loop all players:
        if loop-player does not have permission "vanish":
          hide player from loop-player
          send "&aYou have been vanished" to player
      loop all players:
        if loop-player has permission "vanish":
          send "&bStaff System &7> &fStaff member %player% has been vanished" to loop-player
    if {vanish::%player%} is true:
      set {vanish::%player%} to false
    if {vanish::%player%} is false:
      reveal player to all players
      send "&aYou have been unvanished" to player
      loop all players:
        if loop-player has permission "vanish":
          send "&bStaff System &7> &fStaff member %player% has been unvanished" to loop-player
 
for some reason when i reload this i have no errors but when i try to use it it dosen't work

Code:
command /vanish:
  permission: vanish
  permission message: &cYou can't use that!
  trigger:
    if {vanish::%player%} is false:
      set {vanish::%player%} to true
    if {vanish::%player%} is true:
      loop all players:
        if loop-player does not have permission "vanish":
          hide player from loop-player
          send "&aYou have been vanished" to player
      loop all players:
        if loop-player has permission "vanish":
          send "&bStaff System &7> &fStaff member %player% has been vanished" to loop-player
    if {vanish::%player%} is true:
      set {vanish::%player%} to false
    if {vanish::%player%} is false:
      reveal player to all players
      send "&aYou have been unvanished" to player
      loop all players:
        if loop-player has permission "vanish":
          send "&bStaff System &7> &fStaff member %player% has been unvanished" to loop-player
I think you overthought it, it can be a lot simpler

Code:
command /vanish:
    trigger:
        if {vanish::%player's uuid%} is not set:
            set {vanish::%player's uuid%} to true
            hide player from all players
            send "&cYou have been vanished!"
            send "&bStaff System &7> &fStaff member %player% has been vanished" to all players where [input has permission "vanish"]
        else:
            delete {vanish::%player's uuid%}
            reveal player to all players
            send "&aYou have been unvanished!"
            send "&bStaff System &7> &fStaff member %player% has been unvanished" to all players where [input has permission "vanish"]
 
I think you overthought it, it can be a lot simpler

Code:
command /vanish:
    trigger:
        if {vanish::%player's uuid%} is not set:
            set {vanish::%player's uuid%} to true
            hide player from all players
            send "&cYou have been vanished!"
            send "&bStaff System &7> &fStaff member %player% has been vanished" to all players where [input has permission "vanish"]
        else:
            delete {vanish::%player's uuid%}
            reveal player to all players
            send "&aYou have been unvanished!"
            send "&bStaff System &7> &fStaff member %player% has been unvanished" to all players where [input has permission "vanish"]
Thank you alot but i want other staff members to see him in vanish so i think thats why lol
[doublepost=1633122786,1633121232][/doublepost]i just found out im a -1,000,000,000 iq guy and its because if player's don't have permission they send it to them
 
Thank you alot but i want other staff members to see him in vanish so i think thats why lol
[doublepost=1633122786,1633121232][/doublepost]i just found out im a -1,000,000,000 iq guy and its because if player's don't have permission they send it to them

The code that I provided should, in theory, send to all staff members that they vanished
 
Status
Not open for further replies.