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.

Is there a problem with my code?

Discussion in 'Skript' started by Mr_Allawi_, Oct 1, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. Mr_Allawi_

    Mr_Allawi_ Member

    Joined:
    Sep 20, 2021
    Messages:
    12
    Likes Received:
    0
    for some reason when i reload this i have no errors but when i try to use it it dosen't work

    Code (Text):
    1. command /vanish:
    2.   permission: vanish
    3.   permission message: &cYou can't use that!
    4.   trigger:
    5.     if {vanish::%player%} is false:
    6.       set {vanish::%player%} to true
    7.     if {vanish::%player%} is true:
    8.       loop all players:
    9.         if loop-player does not have permission "vanish":
    10.           hide player from loop-player
    11.           send "&aYou have been vanished" to player
    12.       loop all players:
    13.         if loop-player has permission "vanish":
    14.           send "&bStaff System &7> &fStaff member %player% has been vanished" to loop-player
    15.     if {vanish::%player%} is true:
    16.       set {vanish::%player%} to false
    17.     if {vanish::%player%} is false:
    18.       reveal player to all players
    19.       send "&aYou have been unvanished" to player
    20.       loop all players:
    21.         if loop-player has permission "vanish":
    22.           send "&bStaff System &7> &fStaff member %player% has been unvanished" to loop-player
     
  2. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    143
    Likes Received:
    5
    I think you overthought it, it can be a lot simpler

    Code (Text):
    1. command /vanish:
    2.     trigger:
    3.         if {vanish::%player's uuid%} is not set:
    4.             set {vanish::%player's uuid%} to true
    5.             hide player from all players
    6.             send "&cYou have been vanished!"
    7.             send "&bStaff System &7> &fStaff member %player% has been vanished" to all players where [input has permission "vanish"]
    8.         else:
    9.             delete {vanish::%player's uuid%}
    10.             reveal player to all players
    11.             send "&aYou have been unvanished!"
    12.             send "&bStaff System &7> &fStaff member %player% has been unvanished" to all players where [input has permission "vanish"]
     
  3. Mr_Allawi_

    Mr_Allawi_ Member

    Joined:
    Sep 20, 2021
    Messages:
    12
    Likes Received:
    0
    Thank you alot but i want other staff members to see him in vanish so i think thats why lol
    --- Double Post Merged, Oct 1, 2021, Original Post Date: Oct 1, 2021 ---
    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
     
  4. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    143
    Likes Received:
    5
    The code that I provided should, in theory, send to all staff members that they vanished
     
Thread Status:
Not open for further replies.

Share This Page

Loading...