Where would the ends go to make the error go away? Won't extra ends break the script?
for i,c in pairs(script.Parent:GetChildren()) do if c:IsA("ImageButton") then c.MouseButton1Click:connect(function() local p = script.Parent.Parent.Parent.Parent.Parent local GPS = game:GetService("MarketplaceService") if GPS:PlayerOwnsAsset(p, script.Parent.Rex.Value) or GPS:PlayerOwnsAsset(p, script.Parent.Sat.Value) or GPS:PlayerOwnsAsset(p, script.Parent.Fusion.Value) then for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do if v:IsA("HopperBin") or v:IsA("Tool") then if p:FindFirstChild'Backpack' then v:clone().Parent = p.Backpack end end end if GPS:PlayerOwnsAsset(p, script.Parent.Rex.Value) and GPS:PlayerOwnsAsset(p, script.Parent.Sat.Value) then for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do if v:IsA("HopperBin") or v:IsA("Tool") then if p:FindFirstChild'Backpack' then v:clone().Parent = p.Backpack end end end <-- error from here
No, notice how you opened an if statement, then an i,v in pairs, then an if, then an if, you need 4 ends to close all of them so you should do this:
for i,c in pairs(script.Parent:GetChildren()) do if c:IsA("ImageButton") then c.MouseButton1Click:connect(function() local p = script.Parent.Parent.Parent.Parent.Parent local GPS = game:GetService("MarketplaceService") if GPS:PlayerOwnsAsset(p, script.Parent.Rex.Value) or GPS:PlayerOwnsAsset(p, script.Parent.Sat.Value) or GPS:PlayerOwnsAsset(p, script.Parent.Fusion.Value) then for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do if v:IsA("HopperBin") or v:IsA("Tool") then if p:FindFirstChild'Backpack' then v:clone().Parent = p.Backpack end end end if GPS:PlayerOwnsAsset(p, script.Parent.Rex.Value) and GPS:PlayerOwnsAsset(p, script.Parent.Sat.Value) then for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do if v:IsA("HopperBin") or v:IsA("Tool") then if p:FindFirstChild'Backpack' then v:clone().Parent = p.Backpack end end end end end --This is to close the if statement you opened on line 26.
hope It helped ;)
Messy scripts are unefficient for the scripter himself.
for i,c in pairs(script.Parent:GetChildren()) do if c:IsA("ImageButton") then c.MouseButton1Click:connect(function() local p = script.Parent.Parent.Parent.Parent.Parent local GPS = game:GetService("MarketplaceService") if GPS:PlayerOwnsAsset(p, script.Parent.Rex.Value) or GPS:PlayerOwnsAsset(p, script.Parent.Sat.Value) or GPS:PlayerOwnsAsset(p,script.Parent.Fusion.Value) then end end end for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do if v:IsA("HopperBin") or v:IsA("Tool") then if p:FindFirstChild'Backpack' then v:clone().Parent = p.Backpack end end end if GPS:PlayerOwnsAsset(p, script.Parent.Rex.Value) and GPS:PlayerOwnsAsset(p, script.Parent.Sat.Value) then end for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do if v:IsA("HopperBin") or v:IsA("Tool") then if p:FindFirstChild'Backpack' then v:clone().Parent = p.Backpack end end end <-- error from here
Should work now. Post results , if it does not .