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

How can I Make an event happen onchat? (UnAnswered)

I Am making A Four Corners Game...

What I need Is A Script .. Which Has An Onchat Function

When I Say "Game" I would Like A Message to appear at the top saying Game in progress When I Say "End" I Would Like it to say A New Game Will Start Soon

Extra Info : I Want Just Me To Have The Command

2 answers

You want to use the Chatted event, then if statements to check if it's you chatting and what the message is.

http://wiki.roblox.com/index.php?title=Chatted_%28Event%29 You want to use it like this:

game.Players.PlayerAdded:connect(function(player)
	player.Chatted:connect(function(message)
		--code
	end)
end)

Just as a note, the parameter "message" is a variable for the message that the player chatted. message == "this is my chat"

--MightyWanderer

1 comment

0

Sorry I Could See What You Were Trying To Say But I Dont Understand Sorry

h = Instance.new("Hint", game.Workspace)

names = {"Player1"} --Where you put your name.

game.Players.PlayerAdded:connect(function(player)
	for i, v in pairs(names) do
		if v == player.Name then 
			player.Chatted:connect(function(chatmsg)
				if chatmsg:sub(1,4) == "game" then 
					if game.Lighting:FindFirstChild(map) then
					h.Text = "Whatever Your Message Is"
					wait(5)
					h:Remove()
		end
	end
end)

1 comment

0

Thumbs Up! :)

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