Remove player from chat recipients help

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

_theXZR

Member
Dec 15, 2025
1
0
1
Hi,

Im kinda new to skript and wanted to ask how to fix my script

I was trying to make so players in the world "event" can only see messages from other people in "event", but somehow it isnt working

My current skript:
on chat:
if world of player is "event":
cancel event
remove player from chat recipients
loop all players:
if world of loop-player is "event":
if {_host::%loop-player%} is true:
set {_ch.prefix::%loop-player%} to "&eHOST"
else if loop-player has permission "op":
set {_ch.prefix::%loop-player%} to "&eOP"
else:
set {_ch.prefix::%loop-player%} to "&7PLAYER"
send "&7[&b&lEVENT&7] %{_ch.prefix::%loop-player%}% &8- &f%player%: %message%" to loop-player
else:
add player to chat recipients

My addons: SkQuery, SkBee, SkRayfall
 
The following is possible, and works efficiently, though the whole "using a command to detect something from a player" is a little controversial around the Skript community

Code:
on chat:
    if world of player is "event":
        cancel event
        make all players execute command "chatscan"
        wait 1 tick
        send "<%player%> %message%" to {event::*}
    else:
        cancel event
        make all players execute command "chatscan"
        wait 1 tick
        send "<%player%> %message%" to {event::*}

command /chatscan:
    trigger:
        clear {event::*}
        clear {world::*}
        if world of player is "event":
            add player to {event::*}
        else:
            add player to {world::*}
 
Code:
on chat:
    player's world is "event"
    set chat recipients to all players where [name of input's world is name of player's world]

Your problem is that you cancel the event - this is like the message was never sent to anyone. You can change the message format with this expression: https://skripthub.net/docs/?id=882