How to combine these two Scripts?
I have this code
1 | local plr = game:GetService( 'Players' ).LocalPlayer |
2 | local backpack = plr:WaitForChild( "Backpack" ) |
4 | for i, v in pairs (backpack:GetChildren()) do |
that was given to me by ColdFoxy07(big thanks) and I have This code that I edited
02 | local button = script.Parent |
03 | local plr = game:GetService( 'Players' ).LocalPlayer |
04 | local tool = game.ReplicatedStorage.ACS_Engine.HOOD [ "Micro UZI" ] |
06 | button.Activated:Connect( function () |
07 | if cooldown = = false then |
09 | script.Parent.Parent.Visible = false |
10 | plr.Backpack:FindFirstChildWhichIsA( 'Tool' ):Destroy() |
12 | clone.Parent = plr.Backpack |
14 | script.Parent.Parent.Parent.ClassH.Visible = true |
16 | script.Parent.Parent.Parent.ClassH.Visible = false |
and Im trying to put the two together. but it doesent work here is the code( that I made trying to put the two together)
02 | local button = script.Parent |
03 | local plr = game:GetService( 'Players' ).LocalPlayer |
04 | local tool = game.ReplicatedStorage.ACS_Engine.HOOD [ "Micro UZI" ] |
05 | local backpack = plr:WaitForChild( "Backpack" ) |
07 | button.Activated:Connect( function () |
08 | if cooldown = = false then |
10 | script.Parent.Parent.Visible = false |
11 | for i, v in pairs (backpack:GetChildren()) do |
15 | clone.Parent = plr.Backpack |
17 | script.Parent.Parent.Parent.ClassH.Visible = true |
19 | script.Parent.Parent.Parent.ClassH.Visible = false |
Could anyone help thanks!