Is there anyway to award badges to players for being in game at a certain time (using os.time)
I am currently making a times square ball drop game (I know it is August, I had a random spark of motivation)
I have been testing it, no error messages when i changed the time to five minutes from then and waiting that time, but no badge?
I’ve tried looking for solutions here and I had no luck so that is why I am making this post
here is the code i am working with (normal script to answer your question on script type)
local badgeService = game:GetService("BadgeService")
local id1 = "hidden id for privacy reasons"
local id2 = "hidden id for privacy reasons" -- this is the badge id for the os time
local id3 = "hidden id for privacy reasons"
local ostime = 1658608636 -- the os time i want to award the badges in
local Owner = "Whos_DatGuy"
game.Players.PlayerAdded:Connect(function(plr)
if not badgeService:UserHasBadgeAsync(plr.UserId, id1) then
badgeService:AwardBadge(plr.UserId, id1)
end
if plr.Name == Owner then
for i, plr in pairs(game.Players:GetChildren()) do
local hadBadge = badgeService:UserHasBadgeAsync(plr.UserId, id3)
if not hadBadge then
badgeService:AwardBadge(plr.UserId, id3)
end
end
end
if os.time == ostime then
local hadBadge = badgeService:UserHasBadgeAsync(plr.UserId, id2)
if not hadBadge then
badgeService:AwardBadge(plr.UserId, id2)
end
end
end)
if you can help, i would really appreciate it