debounces = { } runspeed = { } jumppower = { } runstatus = { } jumpstatus = { } startconfig = { runstat = 0, jumpstat = 0, runspd = -10,jumppwr = -10, runstatfornxtlvl = 10, jumpstatfornxtlvl = 10, maxrunspd = 200, maxjumppwr = 75} --[[ startconfigrunstat = 0 startconfigjumpstat = 0 startconfigrunspd = -10 startconfigjumppwr = -10 startconfigrunstatfornxtlvl = 10 startconfigjumpstatfornxtlvl = 10 startconfigmaxrunspd = 200 startconfigmaxjumppwr = 75 --]] function getPlayerNum(player) local curPlayerNum = nil local p = game.Players:GetChildren() for i = 1,#p do if p[i] == player then curPlayerNum = i end end return curPlayerNum end function onRunning(player, speed) local playernum = getPlayerNum(player) print(player.Name, playernum) if speed > 0 then if runstatus[playernum] >= startconfig.runstatfornxtlvl then runstatus[playernum] = 0 runspeed[playernum] = runspeed[playernum] + 0.1 end player.Character.Torso.BodyVelocity.velocity = Vector3.new(player.Character.Torso.CFrame.lookVector.x, 0, player.Character.Torso.CFrame.lookVector.z) else player.Character.Torso.BodyVelocity.velocity = Vector3.new(0,0,0) end end function onJumping(player) local playernum = getPlayerNum(player) print(player.Name, playernum) if jumpstatus[playernum] >= startconfig.jumpstatfornxtlvl then jumpstatus[playernum] = 0 if jumppower[playernum] < startconfig.maxjumppwer then jumppower[playernum] = jumppower[playernum] + 0.1 end end player.Character.Torso.Velocity = player.Character.Torso.Velocity + Vector3.new(0, jumppower, 0) end function onRespawned(player) if player.Character~=nil then player.Character:findFirstChild("Humanoid").Running:connect(function(speed) onRunning(player, speed) end) player.Character:findFirstChild("Humanoid").Jumping:connect(function() onJumping(player) end) end local bv = Instance.new("BodyVelocity") bv.maxForce = Vector3.new(1e+010, 0, 1e+010) bv.velocity = Vector3.new(0,0,0) bv.Parent = player.Character.Torso end function onEntered(newPlayer) newPlayer.Changed:connect(function(prop) if prop == "Character" then onRespawned(newPlayer) end end) local p = game.Players:GetChildren() for i = 1,#p do if p[i] == player then localplayer = i end end table.insert(debounces, localplayer, false) table.insert(runspeed, localplayer, startconfig.runspd) table.insert(jumppower, localplayer, startconfig.jumppwr) table.insert(runstatus, localplayer, startconfig.runstat) table.insert(jumpstatus, localplayer, startconfig.jumppwr) end function onLeaving(player) local p = game.Players:GetChildren() for i = 1,#p do if p[i] == player then localplayer = i end end table.remove(debounces, localplayer) table.remove(runspeed, localplayer) table.remove(jumppower, localplayer) table.remove(runstatus, localplayer) table.remove(jumpstats, localplayer) end game.Players.PlayerAdded:connect(onEntered) game.Players.PlayerRemoving:connect(onLeaving)