That doesn’t work, attempted to put it in a local & server script but to no avail. I wonder if it has anything to due with it being inside a GUI, but I doubt that would be why.
found the solution! its a server script, in workspace it works but not in startergui, the code would be
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
print(message)
end)
end)
I just did some investigating, and it appears to work in scripts stored in ServerScriptService, but not when printed out from a script stored inside a GUI.
I would prefer not to have to move all my scripts outside that GUI, but if I have to I will.
If you set Script.RunContext to Server the script will be able to run nearly anywhere, including from GUIs. However, it is much better to keep scripts in ServerScriptService than inside of a gui, unless that script is specifically modifying that gui.