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

Check for tools with :GetChildren and for do not working?

Hi, I'm making a script that detects if a character is using a tool, and if it does, save the tool at a Value. I made this, but It seems like it doesn't work....

local children = plr.Character:GetChildren()
for i = 1, #children do
    	if children[i].ClassName == "Tool" then
		local tool = children[i]
	end
end

It's inside a script and plr is a Player inside Players.

Could someone explain what am I doing wrong? Or if there is another more efficient way to get the tool a character is using, please tell me!

1 answer

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