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.
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
1 | -- Put this script into workspace |
2 | badgeid = 0000000 -- Change the numbers to the id of the badge. |
3 | game.Players.PlayerAdded:connect( function (plr) -- The event of when a player enters. |
4 | plr.Chatted:connect( function (msg) -- The event of when the player has sent a chat message. |
5 | if msg = = "string" then -- Checks if the message is the specific string. |
6 | game:GetService( "BadgeService" ):AwardBadge(plr.userId, badgeid) -- Awards the badge |
7 | end |
8 | end ) |
9 | end ) |
Hope this helps with the understanding! If you got any questions, feel free to ask!