#Animation doesnt play when first equipping tool

1 messages · Page 1 of 1 (latest)

chrome sinew
#

what it says on the tin

animation script:

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local e:AnimationTrack = char:WaitForChild("Humanoid"):LoadAnimation(script.e)
local i:AnimationTrack = char:WaitForChild("Humanoid"):LoadAnimation(script.i)
local u:AnimationTrack = char:WaitForChild("Humanoid"):LoadAnimation(script.u)

function eq()
    e:Play()
    e.Stopped:Wait()
    i:Play()
end

function ueq()
    e:Stop()
    i:Stop()
    script.f:Fire()
end

script.Parent.Equipped:Connect(eq)
script.Parent.Unequipped:Connect(ueq)

script to clone into tools:

local p = game:GetService("Players")
local l = p.LocalPlayer
local b = l.Backpack or l:WaitForChild("Backpack")
local r = game:GetService("ReplicatedStorage")

b.ChildAdded:Connect(function(t)
    if t:IsA("Tool") then
        if t.Name == "G.I.D.D.Y" then
            local tc = r.tool.a_g:Clone()
            tc.Parent = t
            tc.Enabled = true
        else
            local tc = r.tool.a:Clone()
            tc.Parent = t
            tc.Enabled = true
        end
    end
end)

hierarchy:

#

properties

#

nevermind, fixed it myself

#

uhh for any people seeing this in the future

#

i just equipped each tool to the player then immediately unequipped it, and that seemed to fix it

last pecan
#

glad you fixed it but seriously, give variables and instances proper names. what is a supposed to be? what is a_g? what is e? what is i?

celest phoenix
#

are you interseted in making games

opaque elk
#

WHY IS EVERYTHING A SINGLE LETTER

#

ts is unreadable bro