local TM = require(script.Parent.Parent:WaitForChild("ToolManagment"))
tool = script.Parent
player = game.Players.LocalPlayer
InputService = game:GetService("UserInputService")
ReplicatedStorage = game:GetService("ReplicatedStorage")
Debris = game:GetService("Debris")
Kick = false
Equipped = false
Usage = true

repeat wait() until player.Character:FindFirstChild("Humanoid")

local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://4055996954"
local PlayAnim = player.Character.Humanoid:LoadAnimation(Anim)

when respawning or when you refresh yourself really fast. It breaks the tool. Anyone can help??

what it says in dev console - humanoid to be a descendant to the game object

4 comments

0

the error means that the humanoid is not a descendant/is in the game object which it needs to be to work or it will error

0

ive never countered this before , who ever give me the answer to it will need to explain how and what

0

Tools get added before your character is in the world, you can try yielding until character's parent will not be changed to game or until it's not descendant of it.

0

I got the fix to it for me. i just added local Character = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) local Humanoid = Character:WaitForChild("Humanoid")