Make a ChatActive event

I want to make the chat active when a player touches a part, but the script doesn’t work and there’s not much information about it.

local StarterGui = game:GetService("StarterGui")
script.Parent.Touched:Connect(function()
StarterGui:SetCore("ChatActive",{
true
})
end)
print("Chat is Active") -- Nothing does print.

Thanks!

Do you mean, show the chat core GUI?
If so, that would be

local StarterGui = game:GetService("StarterGui")
   script.Parent.Touched:Connect(function()
      StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end)

However, this script would enable it for the whole server, i believe. To only do it for one person, you could fire a RemoteEvent to the player who touched it.

No, there’s something called “ChatActive”. It is supposed to make the chat “active”.

I have found another topic about ChatActive, does this help? ChatActive Event Help

I read it before and it doesn’t give me any answer. Roblox says it makes the chat active, but in this post they’re checking if the chat is active.

1 Like

Maybe try putting the true not in a table?

local StarterGui = game:GetService("StarterGui")
   script.Parent.Touched:Connect(function()
      StarterGui:SetCore("ChatActive",true)
end)

I don’t know. I’m not familiar with StarterGui:SetCore() so I can’t help that much.

It’s okay. Thanks for the help! (It’s not working still)

1 Like

After doing some reading on the developer hub, I think I may have found your problem. There is no active= before the true. Try adding that, and see if it works.

local StarterGui = game:GetService("StarterGui")
script.Parent.Touched:Connect(function()
   StarterGui:SetCore("ChatActive",{active=true})
end)

I also tried that before and nothing.

1 Like

Are you getting any errors on the Output?

Many things could cause this. Before I start, make sure you are operating within a LocalScript. Secondly, what is the context of this? Do you simply wish to disable the player’s chat? If so, this is the correct solution:

ChatActive is the boolean value representing if the chat window is open or not. For example, if you set ChatActive to false, the player can simply reactivate the chat window by clicking on the chat icon. If you wish to completely disable the chat, go with what I quoted above. Please explain the reasoning behind your attempt to make the chat window inactive.

Thanks!

  • Galactiq

I want to make the chat active when a player touches the part, don’t be confused with SetCoreGuiEnabled. I did everything in a local script in many ways. If you’re curious, the part is not touching anything.

You can only use :SetCore() from a local script. Use Remote Events to communicate from server to client.

  1. localscripts dont work in workspace.
  1. SetCore only work in localscripts, not server scripts.

Thanks and it works! I put it in StarterPlayerScripts and referenced the part from there.