I’ve recently gotten into Lua scripting and I’ve been aiming to create a freerunning-style gamemode (nothing fancy to be honest).
However, I’ve been trying to get player acceleration, such that the player slowly picks up speed until he reaches the maximum speed he can travel. This is my code so far:
if ply:OnGround() then
Speed = Speed + 1.5
if Speed > Maxspeed then
Speed = Maxspeed
hook.Add(“SetupMove”, “PlayerRunning”, PlayerRunning)[/lua]
If I die, and then respawn, I slowly gain speed till I reach 400, however, I stop, the next time I start moving, I instantly reach 400…
Just wondering if someone can give me help or point me into the right direction!
Thanks in advance!