Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make the animation to play one by one?

Asked by 6 years ago

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?

1
You have your animation set to loop thats why it is continuously playing. Set looping to false in the animation editor awesomeipod 607 — 6y
0
No is is not. OniSanYamate -17 — 6y

1 answer

Log in to vote
0
Answered by
royee354 129
6 years ago

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.

0
one big* royee354 129 — 6y
0
Loop the animations. cooldude19774 -54 — 6y
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 OniSanYamate -17 — 6y
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. royee354 129 — 6y
Ad

Answer this question