Using Chat Events in Play Solo
Using Chat Events in Play Solo
Problem
You want to test a script that uses the Chatted event in Solo.
Solution
Use a StringValue with the .Changed event.
local p = game.Players.Player Workspace.Value.Changed:Connect(function(msg) -- etc... end)
Discussion
You may have noticed that in Solo testing, there is no area where you can type to test scripts that involve the Chatted event. Therefore instead of doing:
game.Players.PlayerAdded:Connect(function(p) p.Chatted:Connect(function(msg) -- etc... end) end)
We could use the code posted in the solution. So when you change the StringValue’s value, it will simulate the Chatted event.
Note: You could also use the Player object’s SetSuperSafeChat method, with false for argument. Doing this will make the chat bar appear.
game.Players.Player:SetSuperSafeChat(false)