Simple and clear. Make shoot anim loop if the player holds Leftmouse Button. and stop shoot anim if the player releases LeftMouse. So I made this gun shoot anim that I want it so if I hold the left mouse button it keeps playing the anim but if I release it it stops. How can I do this?
When you create the animation, make sure that the priority is action and it’s looped. Next, you need to get the Player’s mouse like so:
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
Then, you can use the Button1Down and Button1Up for playing and stopping animations respectively:
Mouse.Button1Down:Connect(function()
animation:Play()
end)
Mouse.Button1Up:Connect(function()
animation:Stop()
end)