Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I find a Humanoid in a server script for a tool?

Basically, tool is getting a humanoid but instead is giving me "error: Humanoid is not a valid member of Player "Players.TheBuliderMC" - Server - AbilityServer:4"

local Humanoid = script.Parent.Parent.Parent.Humanoid

1 answer

✓ Accepted answer

The problem here is that you try and get the humanoid as soon as the tool is inside of the player and not in the character

What you want to do inside of your script is:

local Humanoid = nil
local tool = script.How_many_Parents_for_you_to_get_the_tool

tool.Equipped:Connect(function()
   humanoid = tool.Parent:WaitForChild("Humanoid")
end)

This should fix your problem :)

1 comment

0

I should do that next time. Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.