I'm having this error where Humanoid is not the descendant of the game when trying to load an animation.
Here is the script; [NOTE]: It's in a LocalScript and not Filtering Enabled.
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
local mouse = player:GetMouse()
local hum = char:WaitForChild("Humanoid")
local data = player:WaitForChild("Data")
local strength = data:WaitForChild("Strength")
local levelxp = data:WaitForChild("LevelXP")
local strengthxp = data:WaitForChild("StrengthXP")
local can = true
local animation = script:WaitForChild("PunchAnimation")
local anime = hum:LoadAnimation(animation)
mouse.KeyDown:Connect(function(pressed)
local key = pressed:lower()
if key == "f" and can and anime and char:FindFirstChildOfClass("Tool") == nil then
for i,child in pairs(char:GetChildren()) do
if child:IsA("Tool") then return end
end
can = false
levelxp.Value = levelxp.Value + 1
strengthxp.Value = strengthxp.Value + 2
anime:Play()
local s = script:WaitForChild("DamageScript"):Clone()
s.Parent = char:WaitForChild("Right Arm")
s.Disabled = false
local creator = Instance.new("ObjectValue")
creator.Name = "Creator"
creator.Value = char
creator.Parent = s
local damage = Instance.new("IntValue")
damage.Name = "Damage"
damage.Value = (((strength.Value^2)/100)*20)
damage.Parent = s
anime:Play()
anime.Stopped:wait()
anime:Stop()
s:Destroy()
can = true
end
end)

1 comment
That's strange. Someone else had a problem with it, too.