LuckyAura
|
  |
| Joined: 25 Jul 2009 |
| Total Posts: 4444 |
|
|
| 26 Oct 2016 08:51 PM |
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 <--- refers to here 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 |
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 26 Oct 2016 09:12 PM |
you only have 3 ends but 3 if statements and a function which all need ends.
~ signature ~ |
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 26 Oct 2016 09:13 PM |
i meant for not function
anyways im pretty sure for loops need ends to
~ signature ~ |
|
|
| Report Abuse |
|
|
LuckyAura
|
  |
| Joined: 25 Jul 2009 |
| Total Posts: 4444 |
|
|
| 26 Oct 2016 09:15 PM |
| Won't it not work properly with an end after everything? Where do they go? |
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 26 Oct 2016 09:18 PM |
no you dont need them after everything
put 4 end instead of 3 at the end of the script
i think generic and numeric for loops need ends so try adding another one
~ signature ~ |
|
|
| Report Abuse |
|
|
LuckyAura
|
  |
| Joined: 25 Jul 2009 |
| Total Posts: 4444 |
|
| |
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 26 Oct 2016 09:21 PM |
"for _,v in pairs(game.ReplicatedStorage.Game_Tools[suit.Tools.Value]:GetChildren()) do"
thats a generic for loop
~ signature ~ |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 26 Oct 2016 09:22 PM |
| that's not a for loop that's a foreach loop |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 26 Oct 2016 09:22 PM |
You need ends after:
- Functions - Functions within functions - Loops, any kind - Loops within loops - Conditional statements - Conditional statements within conditional statements - Any of the above within any of the above
I may have missed one but that should be it.
One end each one. |
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 26 Oct 2016 09:23 PM |
taking what both of you said im still right that he needs an end
and for loop foreach loop
still a loop needing an end
~ signature ~ |
|
|
| Report Abuse |
|
|