I'm trying to create a simulator, and when my animation plays and the character moves, it looks weird, so is there some script i could use to make the player not be able to jump or move for a 1.25 seconds?
This is an implementation:
local hum = script.Parent.Parent.Humanoid local track = hum:LoadAnimation(anim) track.Priority = Enum.AnimationPriority.Action track.Looped = false local previousSpeed, previousJumpPower local debounce = false tool.Activated:Connect(function() if not debounce then debounce = true previousSpeed = hum.WalkSpeed previousJumpPower = hum.JumpPower track:Play() Humanoid.WalkSpeed = 0 Humanoid.JumpPower = 0 wait(1.25) Humanoid.WalkSpeed = previousSpeed Humanoid.JumpPower = previousJumpPower debounce = false end end) tool.Unequipped:Connect(function() track:Stop() Humanoid.WalkSpeed = previousSpeed Humanoid.JumpPower = previousJumpPower debounce = false end)
This changes the WalkSpeed
and JumpPower
and reverts it later on
Changing WalkSpeed and JumpPower via Humanoid should do it
local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:wait() repeat wait() until Character local Humanoid = Character:WaitForChild("Humanoid") local Delay = 1.25 -- Your Script Here wait(Delay) Humanoid.WalkSpeed = 0 Humanoid.JumpPower = 0 wait(Delay) Humanoid.WalkSpeed = 16 Humanoid.JumpPower = 50