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?
I would suggest that instead of making 3 animations play one after each other, you will make a big one animation that performs all of the animations one after each other.