Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i make a badge award you after a certain amount of time?

when i tried scripting a badge awarding you after 1800 seconds. here is what i put for the script local badgeservice = game:GetService("BadgeService") local id = 21283716

wait(1800) badgeservice:AwardBadge(id)

1 answer

✓ Accepted answer

You forgot to specifie which player you want to award, so it won't work!

what i understood is that you want a player awarded if he has 1800 seconds in game time here the script : (put on serverscriptservice, must be an global script)

game.Players.PlayerAdded:connect(function(plr)

local badgeservice = game:GetService("BadgeService") 
local id = 21283716

local break_ = false

local con = nil
con = game.Players.PlayerRemoving:connect(function(plr2)
if plr2 == plr then
      break_ = true
con:Disconnect()
end
end)
local time = 0

while true do
wait(1)
time = time + 1

if time >= 1800 then
badgeservice:AwardBadge(plr.UserId,id)
break
end

if break_ == true then
     break
end

end

con:Disconnect()

end)

This discussion is preserved as it was. New answers, comments, and votes are closed.