16:58:52.419 - Workspace.MapChanger:169: 'for' limit must be a number
here's line 169;
for i = 0, time do
& here's the full script;
local event = Instance.new("RemoteEvent")
event.Parent = game.ReplicatedStorage
event.Name = "Timer"
event.OnServerEvent:connect(function()
for i,v in ipairs(game.Players:GetChildren()) do
local timeremaining = v.PlayerGui.MapChangerGUI.Selector.TimerConfirm.Amount.Text
local button = v.PlayerGui.MapChangerGUI.Selector.Timer
local lol = game.Workspace.Boards.TrainingInfo.SurfaceGui.MainFrame.Display.Host.Time
local time = tonumber(timeremaining)
for i = 0, time do
local minutes = math.floor(time/60)
local seconds = math.floor(time%60)
local seconds2 = math.floor(time)
wait(1)
time = time - 1
lol.Text = "Timer: "..tostring((minutes..":"..(seconds > 9 and seconds or "0"..seconds2)))
script.Parent.Parent.Time.Text = "Timer: "..tostring((minutes..":"..(seconds > 9 and seconds or "0"..seconds2)))
end
lol.Text = ""
end
end)
purpose of the script is to create a timer when fired (it's an event). it is called upon in another script though.
i'm pretty confused. help would be greatly appreciated!

1 comment
i would make the time a numbervalue, but that's just my dumb way of doing things