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.
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
-- 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!
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Thanks a ton!
No problem. Click "Accept Answer" to give the both of us +1 reputation and close this question.
yay this script is cool