#Animation still plays after another one has played

1 messages · Page 1 of 1 (latest)

ashen fox
#
local players = game.Players.LocalPlayer
local anim1 = script.Parent.Animation
local anim2 = script.Parent.FireAnimation

local anim = script.Parent.Rest


local track
local track2
local trackA

local UIS = game:GetService("UserInputService")

local CanFire = false

script.Parent.Equipped:Connect(function()

track = players.Character.Humanoid:LoadAnimation(anim1)
track:play()
end)

script.Parent.Unequipped:Connect(function()
    trackA = players.Character.Humanoid:LoadAnimation(anim)
    track:stop()
    trackA:stop()
    script.Parent.LocalScript.Disabled = false
end)

local debouce = false

script.Parent.Activated:Connect(function()
    if debouce == false then
        debouce = true
    track2 = players.Character.Humanoid:LoadAnimation(anim2)
    track2:play()
    wait(.8)
    debouce = false
end
end)

local Temp = false

local UIS = game:GetService("UserInputService")
local players = game.Players.LocalPlayer

local anim = script.Parent.Rest
local track


UIS.InputBegan:Connect(function(key)
    if players.Character:FindFirstChild("M911") then
    if key.KeyCode == Enum.KeyCode.E then
        if Temp == false then
            Temp = true
        print("K")
        trackA = players.Character.Humanoid:LoadAnimation(anim)
        trackA:play()
    elseif Temp == true then
        Temp = false
            trackA:stop()
    end
    end
    end
end)
#

When you press E, plays a different animation

#

but when you active the weapon it plays a different one

#

im unsure of how to dix it

high rampart
ashen fox
#

Yes

#

The input animation has a higher priority than the activated one

high rampart
#

maybe the problem is the animations overlapping or interrupting each other

#

add checks before stopping the track

high rampart
thorn lodge
#

I mean on discord

#

in this format

lethal horizon
#

@thorn lodge ^^^

thorn lodge