It's part of my sprint script, and I was wondering instead of making it change it back to 16, if there was a way to make it keep your original walkspeed, so if you were to pick up a speed power up that gave you 36 walkspeed, and you sprinted, and you stopped, it'd make it stay at 36 until the script from the powerup reset your walkspeed to default. Here is the script:
mouse.KeyUp:connect(function(key) key = key:lower() if key == string.char(48) then character.Humanoid.WalkSpeed = 16 end end)
I would suggest making a value and have an if statement to do so. For example,
if character.Powerup.Value = false then character.Humanoid.Walkspeed = 16
Pseudo Code:
--[[This is th powerup script]] script.Parent.Touched:connect(function(part) --blalblballlbalb part.Parent.Humanoid.Speed = 36 wait(5) --How any secs before the speed returns back to 16 part.Parent.Humanoid.Speed = 16
If it helps, pls vote!!!