script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	local plr = game.Players.LocalPlayer
	if (humanoid ~= nil) then	
 for _,tools in pairs(plr.Backpack:GetChildren()) do
	if tools:IsA("Tool") then
		local i = Instance.new("TextLabel",plr.PlayerGui.pack.Frame)
		i.Text = tools.Name
		print(tools.Name)
	end
	
end
	end
end)

4 comments

1

The point of a loop is that it does something multiple times. You are not very clear with your question. Could you explain your problem in more depth?

0

The parent argument of Instance.new is deprecated. Also, I'm unsure exactly what you're trying to do. Either you don't know how loops work or you need to add a debounce.

0

"Break"

0

This is in much need of articulation, can you do that? It would help a lot. One more thing: what is the script supposed to actually do?