Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Chatted event script works in output but won't pop up in game?

I have a chatted event script which when you say "yes" it will say "it's lonely, should sit with it." back. I see that it's putting the text in the 'output' but I want it to like pop up on screen then disappear.

This is the script (it's in the ServerScriptService) V V

game:GetService("Players").PlayerAdded:connect(function(Player)
	Player.Chatted:connect(function(Message)
		if Message == "yes" then
			print("It's lonely, should sit with it?")
		end
	end)
end)

5 comments

0

Use Lua brackets around code

0

What code? The whole script? I did that, then tested it, but the whole chat bar disappeared.

0

Edit:- code block

0

Oh, thanks for doing that :) now people can see the script. Thank you :D

0

Does my solution fix the problem>

1 answer

You can't do Player.Chatted in an actual script since it doesn't have the level of permission to do so, but the command line does, so, you have to use an event in the service, 'game.Players'; game.Players.PlayerChatted.

Here's how you can do it:

game.Players.PlayerChatted:Connect(function(Player, Message)
	--// Code here
end)

1 comment

0

Hopefully this helped.

This discussion is preserved as it was. New answers, comments, and votes are closed.