i want to make the punching anim. to play one by one. but when i press the keycode the animation continuously play in just one click of the button.
math.randomseed(tick())
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local punchEvent = Instance.new("RemoteEvent", ReplicatedStorage)
punchEvent.Name = "PunchEvent"
local function onPunchFired(plr)
local char = game.Workspace:FindFirstChild(plr.Name)
local humanoid = char.Humanoid
local anim1 = plr.Character.Humanoid:LoadAnimation(script.Animation1)
local anim2 = plr.Character.Humanoid:LoadAnimation(script.Animation2)
local anim3 = plr.Character.Humanoid:LoadAnimation(script.Animation3)
anim1:Play()
wait(0.5)
anim1:Stop()
anim2:Play()
wait(0.5)
anim2:Stop()
anim3:Play()
wait(0.5)
anim3:Stop()
local dmgScript = script.DmgScript:Clone()
if anim1.IsPlaying then
dmgScript.Parent = char.RightLowerArm
elseif anim2.IsPlaying then
dmgScript.Parent = char.LeftLowerArm
elseif anim3.IsPlaying then
dmgScript.Parent = char.RightLowerArm
end
dmgScript.Disabled = false
wait(0.01)
dmgScript:Destroy()
end
punchEvent.OnServerEvent:Connect(onPunchFired)
this is a server script inside the server script service. the damage also don't work what would i need to do? and what is wrong about it?

2 comments
You have your animation set to loop thats why it is continuously playing. Set looping to false in the animation editor
No is is not.