Hello, I’m making a obby system which when completed, the player gets rewards. Everything works except for the obby cooldown textlabel, which doesnt change at all to the countdown! this is the part of the server script:
local function updateCountdown()
while true do
wait(1)
for userId, _ in pairs(playerRewarded) do
local plr = game.Players:GetPlayerByUserId(userId)
if plr then
for _, portalConfig in ipairs(ObbyModule.Portals) do
local remainingTime = math.max(0, playerRewarded[userId] - tick())
game.ReplicatedStorage.Remotes.UpdateCountdown:FireClient(plr, portalConfig.ObbyName, remainingTime)
end
end
end
end
end
updateCountdown()
this is my local script:
local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local function updateCountdown(PortalName, remainingTime)
local portal = workspace.Map.Obbies.Portals:FindFirstChild(PortalName)
if portal then
local billboard = portal.Touch:FindFirstChild("BillboardGui")
local textLabel = billboard and billboard:FindFirstChild("Countdown")
if textLabel then
if remainingTime > 0 then
textLabel.Text = string.format("Ready in: %02d:%02d", math.floor(remainingTime / 60), math.floor(remainingTime % 60))
else
textLabel.Text = "Ready to Redo obby!"
end
end
end
end
ReplicatedStorage.Remotes.UpdateCountdown.OnClientEvent:Connect(updateCountdown)
Any help is greatly appreciated!