Disable chat receive

  • 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 community!

    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.

iStopcontact

Member
Feb 18, 2017
115
2
18
I am working on my own server network, and in the lobby i want a option for the players to enable or disable chat receive.

Now i found out how to disable chat for a player, but i dont know how to disable chat receive

Can someone help me with this?

THANKSS!
 
@Kiri but that is how i can disable the chat.

But how can i disable it to disable chat receive, so you cant see what other players type in chat
 
code_language.skript:
on chat:
    cancel the event
    loop all players:
        if loop-player is player:
            message "%player% : %message%"
        else if {chat-receive::%loop-player%::status} is true:
            message "%player% : %message%" to loop-player
 
Is that the way how you can disable chat @YoshYz so u cant see messages that other player sends
 
Is that the way , you just need to make yourself the command toggle for the variable set.
 
Yhea i know that, but i mean with that variable i can make players choose to see or dont see other players chat messages @YoshYz
 
You can also just use the "chat recipients" expression if you have a working version of RandomSK:
http://skunity.com/search?search=recipients

Here's a way you could use it. The benefit is that you don't have to recreate the message format with Skript in order for it to work.
code_language.skript:
on chat:
  loop all players:
    loop-player is not event-player
    if {chat-recieve::%loop-player%::status} is false:
      remove loop-player from chat recipients
 
hm do you mean like this?

code_language.skript:
command /mute <player>:
    trigger:
        if {Chat::%player%::%arg-1%} is set:
            send "You unmuted %arg-1%, he can see your Chat again!"
            delete {Chat::%player%::%arg-1%}
        else:
            set {Chat::%player%::%arg-1%} to true
            send "You muted %arg-1%, he CAN'T see your chat!"

on chat:
    if {Chat::%player%::*} is set:
       cancel event
       loop all players:
          if {Chat::%player%::%loop-player%} is not set:
              send "%player% >> %Message%" to loop-player
 
code_language.skript:
on chat:
    cancel event
    loop all players:
        if {Chat.%loop-player%} is not set:
            send "%player% >> %message%" to loop-player

command /chat:
    trigger:
        if {Chat.%player%} is set:
            delete {Chat.%player%}
            send "You can see now chat again"
        else:
            send "You disabled chat"
            set {Chat.%player%} to true
 
Last edited by a moderator:
Status
Not open for further replies.