Umm.I mean, ****I made a local script inside a tool and type this codes.
01 | player = game.Players.LocalPlayer |
02 | tool = script.Parent |
03 | tool.Equipped:connect( function (mouse) |
04 |
05 | mouse.KeyDown:connect( function (key) |
06 | if key = = "h" then |
07 | print ( "You pressed h" ) |
08 | else |
09 |
10 | end |
11 | end ) |
12 | end ) |
I am confused with line 9, and i want to put a code in line 9 that can go inside through LocalPlayer's inventory and destroy the tool.. tool's name = tool
please tell me the answer scripting veterans..
Its pretty simple, on line 9 write the following code
1 | player.Backpack:FindFirstChild( "tool" ):Destroy() |
or
1 | tool:Destroy() |
the FindFirstChild function basically finds the first child with the name provided.