-
**so i want when the player click g animation player and if click it again the animation stop **
-
the animation look weird Include screenshots / videos if possible!
this script is in StarterCharacterScripts
-- This is an example Lua code block
local userinputservice = game:GetService("UserInputService")
local Animation = script.Animation
local playAnimation = false
local humanoid = script.Parent:WaitForChild("Humanoid")
local loadedAnmation = humanoid:LoadAnimation(Animation)
loadedAnmation.Looped = true
userinputservice.InputBegan:Connect(function(inputKey,GamePro)
print(humanoid)
if GamePro then return end
if inputKey.KeyCode == Enum.KeyCode.G then
if humanoid then
if not playAnimation then
playAnimation = true
loadedAnmation:Play()
else
playAnimation = false
loadedAnmation:Stop()
end
end
end
end)
video
the animation suppose to be like the npc animation but it doesn’t look like it tho both have the same Animation id