Hello, I want to make an IntValue to increase endlessly, but when I try to, the IntValue doesn’t move up. Can anybody help me here?
I have tried adding the “boomboxadd” value (Is it a value?) and using parameters. (I am not good at scripting so I just tinkered with it)
local boombuxvalue = script.Parent.Parent:WaitForChild("leaderstats").BoomBux.Value
for boombuxadd = 1, math.huge do
boombuxvalue = boombuxadd
wait(1)
end
local boombuxvalue = script.Parent.Parent:WaitForChild("leaderstats").BoomBux.Value
while true do
boombuxvalue.Value = boombuxvalue.Value + 1
wait()
end
I’d probably recommend using the run service over a while loop, and move this to the server. You don’t want exploiters to be able to edit their money.
local RunService = game:GetService("RunService")
local CheckTime = 1 -- how many seconds to wait between increases
local LastCheck = 0
RunService.Heartbeat:Connect(function()
if os.time() - LastCheck < CheckTime then
return
end
LastCheck = os.time()
boombux.Value += 1
end)