Hi guys! Any ideas why this doesn't award the badge? There are no errors. Any help would be appreciated ;) Thanks!
local LeaderboardString = "Coins"
local RequiredValue = 1000
local BadgeID = 217045131
game.Players.PlayerAdded:connect(function(Player)
local LeaderboardInstance = Player:WaitForChild(LeaderboardString)
wait(1)
if LeaderboardInstance.Value >= RequiredValue then
game:GetService("BadgeService"):AwardBadge(Player.userId, BadgeID)
end
end)

8 comments
Still doesn't work :( Any ideas?
Ah - it works if you rejoin the game once you have earned the required coins... but just realised why :D
Oh sorry. Edited.
Thanks!
No problem :)
Changed event still doesn't work :/ Just tested it... sorry, but do you mind trying to fix it again ?:/ I'm rubbish at badge awarding lol :D
Cant see why it doesn't work :/ Tried to fix it but not sure what's wrong!
Try now