function Sprint( pl )
local Run = IsRunning( pl )
if Run then Power = math.Clamp( Power - 1, 0, 100 ) else Power = math.Clamp( Power + 1, 0, 100 ) end pl:SetRunSpeed( Power + 220 ) pl:setNWInt( "run_power", Power )
timer.Create( “timer”, 1, 0,Sprint,pl)
What it’s supposed to do is drain run energy when you sprint and replenish it when you’re not running. Timer should run it every one second, but I get a nice error every second.
Timer Error: SandboxModded/gamemode/init.lua:97: attempt to index local ‘pl’ (a nil value)
Don’t know what the fuck is wrong with it, I think the Timer.Create function is broken. Anyone have any insight into this?