How to find a tool on the server script

I have tried looping through player for a tool but it doesn’t print any tool?

					for i,TOOL in pairs(Player.Character:GetChildren()) do
						print("1 RAN ________________-------------------")
						print(TOOL)
						if TOOL:IsA("Tool") then
							print("2 RAN ________________-------------------")
							for i, v in pairs(require(game.ReplicatedStorage.MiningModule)) do
								print("3 RAN ________________-------------------")
								if i == TOOL then
									print("4 RAN ________________-------------------")
									Strength = v.Strength
									print(Strength)
								end
							end
						end
					
local function getUnequippedTools(player: Player): {Tool}
	local tools = {}
	for _, tool in pairs(player.Backpack:GetChildren()) do
		if tool:IsA("Tool") then table.insert(tools, tool) end
	end
	return tools
end

local function getEquippedTool(player: Player): Tool?
	local character = player.Character
	if not character then return nil end
	for _, child in pairs(character:GetChildren()) do
		if child:IsA("Tool") then return child end
	end
	return nil
end

local function getTools(player: Player): {Tool}
	local tools = getUnequippedTools(player)
	table.insert(tools, getEquippedTool(player))
	return tools
end

for _, tool in pairs(getTools(Player)) do
	print(tool)
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.