here is script
01 | script.Parent.Touched:Connect( function (hit) |
02 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
03 | local plr = game.Players.LocalPlayer |
04 | local i = Instance.new( "TextLabel" ,plr.PlayerGui.pack.Frame) |
05 | if (humanoid ~ = nil ) then |
06 | for _,tools in pairs (plr.Backpack:GetChildren()) do |
07 | if tools:IsA( "Tool" ) then |
08 |
09 | i.Text = tools.Name |
10 | print (tools.Name) |
11 | end |
12 |
13 | end |
14 | end |
15 | end ) |
01 | script.Parent.Touched:Connect( function (hit) |
02 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
03 | local plr = game.Players.LocalPlayer |
04 | local i = Instance.new( "TextLabel" ,plr.PlayerGui.pack.Frame) |
05 | if (humanoid ~ = nil ) then |
06 | for _,tools in pairs (plr.Backpack:GetChildren()) do |
07 | if tools:IsA( "Tool" ) then |
08 | i.Text = tools.Name |
09 | print (tools.Name) |
10 | break -- This is what aazkao means by break |
11 | end |
12 | end |
13 | end |
14 | 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?