here is script
script.Parent.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") local plr = game.Players.LocalPlayer local i = Instance.new("TextLabel",plr.PlayerGui.pack.Frame) if (humanoid ~= nil) then for _,tools in pairs(plr.Backpack:GetChildren()) do if tools:IsA("Tool") then i.Text = tools.Name print(tools.Name) end end end end)
script.Parent.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") local plr = game.Players.LocalPlayer local i = Instance.new("TextLabel",plr.PlayerGui.pack.Frame) if (humanoid ~= nil) then for _,tools in pairs(plr.Backpack:GetChildren()) do if tools:IsA("Tool") then i.Text = tools.Name print(tools.Name) break -- This is what aazkao means by break end end end end)
Closed as Not Constructive by shayner32, chexburger, green271, zblox164, and User#21908
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?