Hello, I am trying to make some code that awards a badge based on a leaderboard stats. Basically, if someone gets 5 minutes into their leaderboard status, they get a badge.
I've put this script into ServerScriptService, and I haven't got any error message saying where I've messed up. I need help please, thanks.
game.Players.PlayerAdded:Connect(function(test)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = test
local minutes = Instance.new("IntValue")
minutes.Name = "Minutes"
minutes.Parent = stats
minutes:GetPropertyChangedSignal("Value"):Connect(function()
print("Changed")
if minutes.Value >= 5 then -- This is the amount of minutes I want the badge to be rewarded in.
game:GetService("BadgeService"):AwardBadge(test.UserId,2124612890)
end
end)
end)

1 comment
Are you chaning the [minutes] value? Does it print [Changed]? We can't know, you should post more details.