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.

Silent Join/Leave for Staff Members toggle

Discussion in 'Skript' started by ItsMCB, Jun 2, 2020.

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

    ItsMCB Member

    Joined:
    May 20, 2018
    Messages:
    46
    Likes Received:
    1
    The goal of this script is to let staff members toggle their silent join/leave function. When on, normal players will not be notified when staff members who have this toggled on join or leave. When off, it alerts everyone like every other player. I'm really not sure what's wrong with this. I think the fact that I haven't slept in 24 hours might be messing with my mental functionality. Thanks in advance :emoji_slight_smile:

    Code (Text):
    1. on first join:
    2.     execute console command "/mvtp %player% Spawn"
    3.     execute console command "/warp rules %player%"
    4.  
    5. on join:
    6.     set join message to ""
    7.     wait 1 tick
    8.     send player title "&bVexel Games" with subtitle "Welcome back, %player%"
    9.     make player execute command "/motd"
    10.     set tab header to "{@bar}%nl%&bVexel Games" and footer to "&lVexelGames.mcpro.io%nl%&3» &7Balance &f/bal%nl%{@bar}" for player
    11.     {staffchat.%uuid of player%} is not set
    12.     set {staffchat.%uuid of player%} to false
    13.  
    14. on join:
    15.     if {_silentjoin::%player%} is false:
    16.         wait 1 tick
    17.         set join message to ""
    18.         broadcast "Hi %player%!!!"
    19.         stop
    20. on quit:
    21.     if {_silentjoin::%player%} is false:
    22.         wait 1 tick
    23.         set quit message to ""
    24.         broadcast "Cya %player%!!!"
    25.         stop
    26.  
    27. command /silentjoin [<text>]:
    28.     aliases: /sj
    29.     permission: {@silentjoin}
    30.     permission message: "{@prefix} &cNo permission."
    31.     trigger:
    32.         send "Activated." to player #Testing purposes only.
    33.         if arg 1 is "on":
    34.             set {_silentjoin::%player%} to true
    35.             send "True %player%" to player
    36.         if arg 1 is "off":
    37.             set {_silentjoin::%player%} to false
    38.             send "False %player%" to player
    39.         else if arg 1 is not set:
    40.             if {_silentjoin::%player%} is false:
    41.                 set {_silentjoin::%player%} to true
    42.                 send "True and on" to player              
    43.             else if {_silentjoin::%player%} is true:
    44.                 set {_silentjoin::%player%} to false
    45.                 send "False and off" to player
    46.         else:
    47.             send "{@prefix} &cUnknown argument"
    48.  
    49.  
     
  2. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    202
    Likes Received:
    19
    You mustn't use "_" at the start of the variable if you want to use it also somewhere else.
    Change variable to:
    Code (Text):
    1. {silentjoin::%player%}
    Also I think you forgot to set join message to nothing on join and on leave when {silentjoin::%player%} is true or not set.
    Code (Text):
    1. on join:
    2.     set join message to ""
    3.     if {_silentjoin::%player%} is false:
    4.         wait 1 tick
    5.         broadcast "Hi %player%!!!"
    6.         stop
    Then, I would recommend you not to use booleans true and false but instead use true and deleted or false and deleted.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...