The script works well in the Studio and Test Server, but when I decided to publish It, I got "LoadAnimation requires the Humanoid object (FlonexVorry.Humanoid) to be a descendant of the game object" error. Please help me, what should I do in order to make my script works?
Tool = script.Parent.Parent
repeat wait() until game.Players.LocalPlayer.Character
local char = game.Players.LocalPlayer.Character
local humanoid = char:WaitForChild("Humanoid")
local ButtonPressed = false
local Attacking = script.Parent.IsAttacking.Value
local Animation = script.Parent.Parent.Animations:WaitForChild("Attack")
Tool.Equipped:connect(function(Mouse)
Mouse.Button1Down:connect(function()
----------------------------------------------------------------------
if not ButtonPressed then
ButtonPressed = true
x = humanoid:LoadAnimation(Animation)
x:Play()
wait(1)
ButtonPressed = false
end
---------------------------------------------------------------------
end)
end)

1 comment
Very weird, I would guess it's a problem with another script, not sure though