Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Badge given on phrase said?

Asked by 8 years ago

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

Log in to vote
3
Answered by
Wutras 294 Moderation Voter
8 years ago

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!

0
Thanks a ton! maximan123 5 — 8y
0
No problem. Click "Accept Answer" to give the both of us +1 reputation and close this question. Wutras 294 — 8y
0
yay this script is cool Jakob_Cashy 79 — 3y
Ad

Answer this question