Hi!
I’m trying to make a badge where you have to trigger a proximity prompt 10 times. I did it 10 times, and I didn’t get the badge. I checked my inventory, and I didn’t have the badge.
Here’s the script:
local prompt = script.Parent.ProximityPrompt
local anim = script.Parent.Animation
local timesPlayed = 0
local badgeserv = game:GetService("BadgeService")
local badgeid = 1183682534100403
prompt.Triggered:Connect(function(player)
local hum = player.Character:WaitForChild("Humanoid")
local loadanim = hum.Animator:LoadAnimation(anim)
loadanim:Play()
hum.AutoRotate = false
hum.WalkSpeed = 0
wait(3.35)
loadanim:Stop()
hum.AutoRotate = true
hum.WalkSpeed = 16
timesPlayed = timesPlayed + 1
end)
if timesPlayed == 10 then
local player = game.Players:GetPlayerFromCharacter(timesPlayed.Parent)
badgeserv:AwardBadge(player.UserId,badgeid)
end
Try this script get badge on a part when touch or click
local badgeId = YOUR_BADGE_ID_HERE
local BadgeService = game:GetService(“BadgeService”)
script.Parent.Activated:Connect(function(player)
if not BadgeService:UserHasBadgeAsync(player.UserId, badgeId) then
BadgeService:AwardBadge(player.UserId, badgeId)
print(player.Name … " earned the badge!")
end
end)
try and put your badge id in the script
Try if this is helpful