My Spear is animated and when its just in the workspace, i can pick it up and it does it's animation when it is clicked. However, i'm trying to put it in the StarterPack and it's not letting me do the animation. Here is the local script i used to play the animation:
local player = game:GetService("Players").LocalPlayer
local character = player.character
local animation = script.Parent:FindFirstChild("Stab")
local swingAnimation = character.Humanoid:LoadAnimation(animation)
local canswing = true
local debounce = 1
script.Parent.Activated:Connect(function()
if canswing then
canswing = false
swingAnimation:Play()
wait(debounce)
canswing = true
end
end)
Blue Lua icon in the editor creates code block, put code inside of it!!!!
Also, the error message says: Players.LegoDan0101.Backpack.Rusty Spear.LocalScript:4: attempt to index nil with 'Humanoid'

1 comment
This shows the exact same error message for me but thanks for trying.