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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Staff Chat.

Discussion in 'Requests' started by TheCringleYT, Oct 9, 2019.

  1. TheCringleYT

    TheCringleYT Member

    Joined:
    Sep 29, 2019
    Messages:
    23
    Likes Received:
    1
    Category: Skript Command.

    Suggested name: Staff Chat.

    Spigot/Skript Version: 1.14

    What I want:

    Hey :emoji_slight_smile:

    Today I am wondering how to make a staff chat so when you do /staffchat toggle it will turn it on the first time and off the second. This would have all the chat messages you do while it's on go to ONLY the online staff!

    Permission: admin.chat

    Permission Message: Sorry, you do not have enough permissions!

    Thanks,

    - TheCringleYT


    Ideas for commands: /staffchat toggle

    Ideas for permissions: admin.chat

    When I'd like it by:
    Less than 3 days!
     
  2. Farid

    Farid Well-Known Member

    Joined:
    Feb 5, 2017
    Messages:
    167
    Likes Received:
    11
    Untested.
    Code (Text):
    1. function contains(list: objects, check: object) :: boolean:
    2.     loop {_list::*}:
    3.         if loop-value is {_check}:
    4.             return true
    5.     return false
    6.    
    7.    
    8. on join:
    9.     if player has permission "admin.chat":
    10.         if contains({server:staff::*}, player) = false:
    11.             add player to {server:staff::*}
    12.            
    13. on quit:
    14.     if player has permission "admin.chat":
    15.         if contains({server:staff::*}, player) = true:
    16.             remove player from {server::staff::*}
    17.    
    18. command /sc [<text>]:
    19.     permission: admin.chat
    20.     permission message:&cYou are not authorized to execute this command.
    21.     trigger:
    22.         if arg-1 is set:
    23.             send (uncolored arg-1) to {server:staff::*}
    24.         else:
    25.             send "&e/sc message" to player
     
  3. TheCringleYT

    TheCringleYT Member

    Joined:
    Sep 29, 2019
    Messages:
    23
    Likes Received:
    1
    So is it automatically turned on when you join?
     
  4. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    150
    Likes Received:
    15
    This is what I came up with.
    Code (Skript):
    1. on join:
    2.     {staffchat.%uuid of player%} is not set
    3.     set {staffchat.%uuid of player%} to false
    4.  
    5. command /staffchat:
    6.     permission: admin.chat
    7.     permission message: &cSorry, you do not have enough permissions!
    8.     trigger:
    9.         if {staffchat.%uuid of player%} is true:
    10.             set {staffchat.%uuid of player%} to false
    11.             message "&cStaff chat has been toggled off."
    12.         else if {staffchat.%uuid of player%} is false:
    13.             set {staffchat.%uuid of player%} to true
    14.             message "&aStaff chat has been toggled on."
    15.         else:
    16.             set {staffchat.%uuid of player%} to true
    17.             message "&aStaff chat has been toggled on."
    18.  
    19. on chat:
    20.     {staffchat.%uuid of player%} is true
    21.     loop chat recipients:
    22.         loop-value does not have permission "admin.chat"
    23.         remove loop-value from chat recipients
    24.     set chat format to "&a(Staff)&r %chat format%"
     
  5. TheCringleYT

    TheCringleYT Member

    Joined:
    Sep 29, 2019
    Messages:
    23
    Likes Received:
    1
Loading...