Hello there,
I have a small problem with my badge giver script which gives you a badge when you click it. Everything looks fine, but it doesn't give you any badge when you click it. I'm pretty sure the badge ID is correct (my friends also tried it too) and I get no errors in the output. Where did I do wrong?
Here's the script:
local badgeID = [theBadgeID]
local badgeService = game:GetService("BadgeService")
script.Parent.ClickDetector.MouseClick:Connect(function(playerWhoClicked)
if playerWhoClicked.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(playerWhoClicked.Parent)
badgeService:AwardBadge(plr.UserId,badgeID)
end
end)

2 comments
Can you make a print statement after the AwardBadge function so it will make sure it runs?
I did, but it didn't print anything in the output. The weird thing is, script keeps working after the badge function (the script I have showed in my question) ends without any errors. Nothing seems wrong...