Disabling chat for specific players

Hello fellow developers! I was creating a system to where at a specific point of the game, I can type inside of a UI(textbox of any player inside of game), click submit, then their chat disables to where they can’t read chat anymore or see it. This is to avoid a player to leave the game, then come back later when being messaged in their DMs to do so. I wonder if there’s a type of way to disable to chat so users can’t see any of the answers people type in chat. I think it is possible but I’m not sure how I can retrieve their scripts and disable the proper script. I know how to find the player and all, however, I don’t know how to disable them from chatting or reading messages/answers until I allow their chat to enable itself again. I don’t want anything to change inside of the modules, I just only want to disable their chatting features until I enable them again. If you could help me out with this, it would be gladly appreciated. :smile:

1 Like

I dont know if you are planning something more advanced, or maybe you just need to use this:

2 Likes

Would this be possible to disable it for one specific player though?

Yup. Well. Using SetCoreGui is only possible on ClientSide(local scripts). So only the player who has that local script in his character would be the one who cant see the chat or any other GUI element. So yes

SetCoreGuiEnabled can only be called in a local script. This means that any changes to the GUI you make will only apply to the player who owns that local script.

3 Likes