When creating a tool, I inserted some animations and a few lines related to animation playing/loading. It works fine when I test it, but when I reset, the output says this:
LoadAnimation requires the Humanoid object (Sensei_Developer) to be a descendant of a game object
Here's my LocalScript inside of one of the tools:
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild('Humanoid')
local Food_Hold = humanoid:LoadAnimation(script.Parent.Food_Hold)
local Food_Interact = humanoid:LoadAnimation(script.Parent.Food_Interact)
script.Parent.Equipped:Connect(function()
Food_Hold:Play()
script.Parent.Handle.Equip:Play()
end)
script.Parent.Unequipped:Connect(function()
Food_Hold:Stop()
Food_Interact:Stop()
script.Parent.Handle.Equip:Stop()
end)
local CanInteract = true
script.Parent.Activated:Connect(function()
if CanInteract == true then
script.Parent.Handle.Eating:Play()
CanInteract = false
Food_Interact:Play()
wait(1.5)
Food_Interact:Stop()
CanInteract = true
end
end)
Other scripts inside of the tools are similar to this.
Can anyone help me? I feel like there's something wrong with the variables I defined.

1 comment
Ty.