I’m trying to make a round system and every time the repeat loop ends the function would get called again.
But I was curious should it cause any issues like stack overflow.
(function()
coroutine.wrap(function()
if #Players:GetPlayers() >= 1 then
local function Start()
Counter.Value = 600
repeat
task.wait(1)
Counter.Value -= 1
until Counter.Value <= 0
workspace:SetAttribute("GameENDED",true)
-- ... other stuff
Start()
end
end
end)()
end)()
your code currently checks if the data’s highest amount is less than or equal to ( 0 / highest amount) which i believe isn’t what you were intending to do.
HighestAmount still remains the same and doesn’t check whats the highest value.
Nvm I managed to fix it. But to add the highest value I do this?
if v.Value > TemplateTable.Holders[tostring(v)].HighestAmount then
table.insert(TemplateTable.Holders[tostring(v)].Amount, v.Value)
TemplateTable.Holders[tostring(v)].HighestAmount = v.Value
TemplateTable.Holders[tostring(v)].Owner = v.Parent.Parent.Name
end