generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Expected 'end' (to close 'then' at line 16), got eof?

Previous Thread :: Next Thread 
LuckyAura is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
26 Oct 2016 09:20 PM
Where are there loops?
Report Abuse
Bit_blox is not online. 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 is online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image