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

how to i make a sword play 2 animation?

Asked by 5 years ago
local plr = game.Players.LocalPlayer
local attack = false
    local mouse = plr:GetMouse()
    local char = plr.Character
script.Parent.Activated:Connect(function()

    local hum = char.Humanoid:LoadAnimation(script.Parent.Animation or script.Parent.Animationsd)
    script.Parent.Blade.Trail.Enabled = true
    hum:Play()
    attack = true
    wait(.50)
    hum:Stop()
    script.Parent.Blade.Trail.Enabled = false

    script.Parent.Blade.Touched:Connect(function(hit)

    local hum =  hit.Parent:FindFirstChild("Humanoid")
    if hum ~= nil and attack == true then
    hum.Health = 0
    attack = false
    end
end)
end)

0
I'm pretty sure only one animation at a time can be played. User#19524 175 — 5y
0
u can play mutiple animations at a time User#23365 30 — 5y
0
Playing at the exact same time? Or do you mean different anims per sword swing but in the same script? ABK2017 406 — 5y
0
yeah helleric -3 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

You don't need to stop the animation, it stops automatically. If you want to disable the trail after it stops, use:

hum.Stopped:Wait()
Ad

Answer this question