I assume this is a scripting thing but does anyone have a click detector script where you get a badge if you click the click able block?.. Like in Inoobies find the noobs.
6 Likes
You can award badges using the BadgeService.
6 Likes
Using ClickDetector.MouseClick, you can listen for the clicking event. The player is passed as a parameter to the functions bound to the event, so you can get the Player.UserId property in order to award the badge using BadgeService:AwardBadge. Here’s an example:
local badgeId = 123456789 -- Replace the badge ID with your own obviously!
local badgeServ = game:GetService("BadgeService")
local clickDetector = Instance.new("ClickDetector") -- Insert a new click detector in the part
--local clickDetector = script.Parent.ClickDetector -- Alternatively, index an already existent one
clickDetector.MouseClick:Connect(function(plr) -- Listen for the click
badgeServ:AwardBadge(plr.UserId, badgeId) -- Award the player the badge
end)
clickDetector.Parent = script.Parent -- Parent the click detector to the part
25 Likes
Both @General_Scripter and @Dev_Tony worked thank you for your help. From John.
5 Likes
Would this work the same for awarding a badge when the player clicks a model?
4 Likes