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

It wont load my animation for my gun idle animation. Can anyone help?

Asked by 3 years ago
Edited 3 years ago

local Tool = script.Parent local Handle = Tool:WaitForChild("Handle") local GunIdleR6 = Tool:WaitForChild("GunIdleR6") local GunIdleR15 = Tool:WaitForChild("GunIdleR15") Tool.Equipped:Connect(function() local Character = Tool.Parent local Humanoid = Character.Humanoid if Humanoid.RigType == Enum.HumanoidRigType.R6 then Humanoid:LoadAnimation(GunIdleR6) else Humanoid:LoadAnimation(GunIdleR15) end end)

1 answer

Log in to vote
0
Answered by
lolenko 17
3 years ago
local Tool = script.Parent

local Handle = Tool:WaitForChild("Handle")

local GunIdleR6 = Tool:WaitForChild("GunIdleR6")

local GunIdleR15 = Tool:WaitForChild("GunIdleR15")

Tool.Equipped:Connect(function()

    local Character = Tool.Parent

    local Humanoid = Character.Humanoid

    if Humanoid.RigType == Enum.HumanoidRigType.R6 then

    local play1 = Humanoid:LoadAnimation(GunIdleR6)
    play1:Play()
    else    

    local play2 = Humanoid:LoadAnimation(GunIdleR15)
    play2:Play()
    end 

end)

Should work

0
THANKS SO MUCH Trampyling 43 — 3y
Ad

Answer this question