local player = game.Players.LocalPlayer
local chr = player.Character
local Humanoid = chr:WaitForChild("Humanoid")
local Anim = Humanoid:LoadAnimation(script.Parent.Movet)
local Anim2 = Humanoid:LoadAnimation(script.Parent.Moveta)
local VectorZero = Vector3.new(0, 0, 0)
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(Input,gameProcessedEvent)
if Input.KeyCode == Enum.KeyCode.E then
if Humanoid.MoveDirection ~= VectorZero then
Anim:Play()
Anim2:Stop()
else
Anim:Stop()
Anim2:Play()
end
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E then
Anim:Stop()
Anim2:Stop()
end
end)
"Anim" is a Movement Animation "Anim2" is an Idle Animation.
I need start Anim when the button "E" is pressed and player move. Same with "Anim2", but only when the player not move.
Sorry for bad english
How i can do?
