Hello.
I have this script, where it opens a gift live in a server, and award everyone playing with a badge.
The gift opens, but the badge awarding part doesn’t work.
Script:
local model = script.Parent
local specifiedDate = os.time({year = 2023, month = 12, day = 23, hour = 6, min = 36, sec = 0}) -- Change the date to the specified date
local badge = 1419255965342856 -- WHY ARE IDS OF NEW BADGES THIS LONG NOW LIKE WHAT
local badgeservice = game:GetService("BadgeService")
local players = game:GetService("Players")
local function checkDate()
local currentDate = os.time()
if currentDate >= specifiedDate then
game.ServerStorage.car1.Parent = game.Workspace
game.ServerStorage.car2.Parent = game.Workspace
wait(1)
for _, welds in pairs(script.Parent:GetChildren()) do
if welds:IsA("WeldConstraint") then
welds:Destroy()
end
end
local playerlist = players:GetPlayers()
for _, player in pairs(playerlist) do
badgeservice:AwardBadge(player.UserId, badge)
end
game.Players.PlayerAdded:Connect(function(plr)
badgeservice:AwardBadge(plr.UserId, badge)
end)
end
end
-- Check the date every second
while wait(1) do
checkDate()
end