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

How do I get script to find the animation inside a folder?

local Gun = script.Parent
local Animations = Gun:FindFirstChild("Animations")


Gun.Equipped:Connect(function(part)
	print("equip")
	local humanoid = Gun.Parent:FindFirstChild("Humanoid")
	print(humanoid.Parent)
	local Hold = humanoid:LoadAnimation(Animations.Hold)
	Hold:Play()
end)

This gives the error 15:09:40.441 - Players.AthenaThorn.Backpack.Gun.GunScript:9: attempt to index nil with 'Hold'

But there's an animation called Hold in Animations folder.

1 answer

✓ Accepted answer

local Hold = script.parent.Hold

1 comment

0

just put the animation in the script

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