lately i’m working on a power simulator and i made a script that adds power when the player activates the pushup “Tool” and with that i have to temporarily stop his walking / jumping.
I already have a script that executes this, but if the player constantly changes tools the speed and the player’s jump will always be 0.
This is the script I have…
Pushups.Activated:Connect(function()
local Hum = Pushups.Parent.Humanoid
local OldSpeed = Hum.WalkSpeed
local OldJump = Hum.JumpPower
if not debounce then
debounce = true
Hum.WalkSpeed = 0
Hum.JumpPower = 0
local Ani = Hum:LoadAnimation(script.SpeedTraning)
local Power = game.Players[Pushups.Parent.Name].leaderstats.Power
Power.Value = Power.Value + 199
Ani:Play()
Ani.Stopped:Wait()
Hum.WalkSpeed = OldSpeed
Hum.JumpPower = OldJump
debounce = false
end
end)
I want to know how you guys would make this script. and if it has a function of “Locking” the walk and the jump without the method of setting it to 0.
I think it would affect my animation. and I already have it but when the player changes tools quickly when the animation is playing at speed and the jump locks at “0”.
I made a thread asking this and got solved, check it out:
--This is a LocalScript
local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()---GetControls
Controls:Disable()