I want to make it where if the timer on the leaderboard goes to 60 minutes, then you get a 1 hour badge. I'm not sure how to do this though. Here's a script I half made that doesn't work
game.Players.PlayerAdded:connect(function(player)
local Stats = Instance.new("Model", player)
Stats.Name = "leaderstats"
local Timer = Instance.new("IntValue", Stats)
Timer.Name = "Time Wasted"
Timer.Value = 0
while true do
wait(60)
Timer.Value = Timer.Value +1
if player.Stats.Timer.Value>=60 then -- if they are at 60 minutes it awards the badge
AwardBadge(player.userId,badgeId)
end
end
end)
local badgeId=2100422700
local badgeService=game:GetService("BadgeService")
function AwardBadge (userId,badgeId)
if not badgeService:UserHasBadge(userId,badgeId)then
badgeService:AwardBadge(userId,badgeId)
end
end

2 comments
The parent argument to Instance.new is deprecated, assign the parent in another line. Player.userId is deprecated, switch to Player.UserId. :connect is deprecated, switch to :Connect.
where is the parent argument to instance.new?