Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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


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

✓ Accepted answer
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

1 comment

0

THANKS SO MUCH

This discussion is preserved as it was. New answers, comments, and votes are closed.