local badgeservice = game:GetService("BadgeService")
local id = 2128449719
local part = script.Parent
local detector = part.ClickDetector
detector.MouseClick:Connect(function(player)
print("clicked")
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
badgeservice:AwardBadge(plr.UserId, id)
end)
im attempting to give a player a badge when clicking an object. However when testing in Roblox Studio's test area, nothing occurs. I have added a ClickDetector as a child to said object as well, i haven't forgotten.

4 comments
Do you already own the badge? Did you try it in a live server?
no i tried to get it with a different account but it still didnt work
Did you make sure to publish the game?
yes i published it and enyone can join