I have made this script with the aid of the roblox wiki and it seem that when I run the localscript from a players backpack the game Outputs Players.Player1.Backpack.LocalScript:3: attempt to index global 'Humanoid' (a nil value) 15:35:03.697 - Stack Begin 15:35:03.698 - Script 'Players.Player1.Backpack.LocalScript', Line 3 15:35:03.699 - Stack End
Could sombody point out the mistake i must be making
local animation = Instance.new("Animation")
animation.AnimationId = "235600467"
local animTrack = Humanoid:LoadAnimation(animation)
function onKeyDown(key)
key = key:lower()
if key == "e" then
animTrack:Play()
end
end
script.Parent.Parent:GetMouse().KeyDown:connect(onKeyDown)

1 comment
Humanoid is nil, because it has no parent.