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

Badge given on phrase said?

I'm looking for a way I can give a player a badge if they say a certain phrase in the chat. Is this possible? If so, how?

Thanks.

1 answer

✓ Accepted answer

That's no big deal. You'll need to combine the BadgeService and the .Chatted("string") event. http://wiki.roblox.com/index.php?title=API:Class/BadgeService http://wiki.roblox.com/index.php?title=API:Class/Player/Chatted

-- Put this script into workspace
badgeid = 0000000 -- Change the numbers to the id of the badge.
game.Players.PlayerAdded:connect(function(plr) -- The event of when a player enters.
	plr.Chatted:connect(function(msg) -- The event of when the player has sent a chat message.
		if msg == "string" then -- Checks if the message is the specific string.
			game:GetService("BadgeService"):AwardBadge(plr.userId, badgeid) -- Awards the badge
		end
	end)
end)

Hope this helps with the understanding! If you got any questions, feel free to ask!

3 comments

0

Thanks a ton!

0

No problem. Click "Accept Answer" to give the both of us +1 reputation and close this question.

0

yay this script is cool

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