Im working on making a stamina script where it always checks (in a span of 3 seconds) if the stamina has changed or not. If it hasnt, then it will gradually increase until it detects it is decreased again.
Here is my script:
while wait(.167) do
if c:FindFirstChild("Stamina") then
local stamina = c:FindFirstChild("Stamina").Value
spawn(function()
delay(3,function ()
if c:FindFirstChild("Stamina").Value == stamina and stamre == false then
stamre = true
else
stamre = false
end
end)
end)
if stamre == true then
c.Stamina.Value = c.Stamina.Value + 1
end
end
end
And it isnt working too well. Can someone help fix it up for me? Thanks
