In a script, I’m trying to collect data from another server script that has an in-game countdown and change a variable to that data. However, the variable remains nil forever. Any way to fix this?
local t
function Countdown(num)
local connection
connection = game:GetService("RunService").Heartbeat:Connect(function()
num = game.ServerScriptService.RoundMaker:GetAttribute("TimeLeft")
if num == 0 then
connection:Disconnect()
end
return num
end)
end
t = Countdown(t)