Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making an animation pause after a 2 second wait?

Asked by
Qudt 0
9 years ago

local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer repeat wait() until player.Character ~= nil local character = player.Character local Humanoid = character.Humanoid

z_ = false example = Humanoid:LoadAnimation(script.Animation)

uis.InputBegan:connect(function(input, event) if not event then if input.KeyCode == Enum.KeyCode.Z then if z_ == false then Humanoid.WalkSpeed = 0 wait(1)
example:Play() z_ = true

wait(2) Adjust (float speed = 0)

elseif z_ == true then example:Stop() z_ = false Humanoid.WalkSpeed = 16 end end end end)

--I'm having trouble getting the "wait(2) Adjust (float speed = 0)" to properly work.

Answer this question