I have a server script inside of serverscriptservice that makes the person playing's jump power increase by 1 every 1 second as well as their speed (although that was set to 0 since we decided we didnt want it enabled rn) as well as some leaderstats. The script does as intended, however once a players jump power reaches 1000, it stops increasing. Does anyone know what the problem is and if its possible to fix it?
function increaseStats(hum, speedVal, jumpVal)
spawn(function()
while wait(0.01) do
hum.JumpPower += 1
hum.WalkSpeed += 0
speedVal.Value = hum.WalkSpeed
jumpVal.Value = hum.JumpPower
end
end)
end
game.Players.PlayerAdded:Connect(function(plr)
local totalWalkspeed
local totalJumpHeight
local l = Instance.new("Folder")
l.Name = "leaderstats"
l.Parent = plr
local jumpVal = Instance.new("NumberValue")
jumpVal.Name = "Jump Power"
jumpVal.Parent = l
local speedVal = Instance.new("NumberValue")
speedVal.Name = "Speed"
speedVal.Parent = l
plr.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
if totalWalkspeed then
print(totalWalkspeed .. ", " .. totalJumpHeight)
hum.WalkSpeed, hum.JumpPower = totalWalkspeed, totalJumpHeight
end
increaseStats(hum, speedVal, jumpVal)
hum.Died:Connect(function()
totalWalkspeed = hum.WalkSpeed
totalJumpHeight = hum.JumpPower
end)
end)
end)

3 comments
you may need to change
/ 4to/ 5or other number if you need to precisely simulate JumpPower, i consider it a minor detail though if it's a sort of jumping simulatoractual legend thank you so much
wow pro