Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make the animation to play one by one?

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

1

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

0

No is is not.

1 answer

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.

4 comments

0

one big*

0

Loop the animations.

0

I mean. I want it to play like. Click, the first animation will play. Click again, the second animation will play. etc etc. :C

0

There is a video that can help you with that, that would be Snakeworl's sword tutorial, search it up, watch it. I do believe you will find the way to make what you wanted.

This discussion is preserved as it was. New answers, comments, and votes are closed.