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: I need Lua 5.2. Now.

Previous Thread :: Next Thread 
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Nov 2012 05:06 PM
What's taking so long!?
I'm creating a game reliant on two or more players, and if one player leaves in the middle of the game giving us only one player, I want it to go back to the beginning of the script. Goto would be extremely helpful right now and I don't want to go through the troubles of coroutines or anything like that for something so simple.
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 05:10 PM
Amen.

~ I ate Sorcus ~
Report Abuse
xSIXx is not online. xSIXx
Joined: 06 Aug 2010
Total Posts: 9202
23 Nov 2012 05:13 PM
workspace.Script.Disabled = true
workspace.Script.Disabled = false
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Nov 2012 05:15 PM
Oh yeah, and I'm referencing the need for GOTO.
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
23 Nov 2012 05:17 PM
Hey...

When you use goto, what happens to all the variables that were initialized and defined before the goto? Do they stay the same and make a huge mess in the flow of the program?
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
23 Nov 2012 05:25 PM
That's sloppy coding. You should be able to accomplish your task with the current implementation of Lua.
Report Abuse
Roundel is not online. Roundel
Joined: 20 Mar 2010
Total Posts: 469
23 Nov 2012 05:29 PM
Emess you grass lover
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 05:36 PM
^ This.

~ I ate Sorcus ~
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
23 Nov 2012 05:41 PM
[ Content Deleted ]
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Nov 2012 05:43 PM
@solo
LOL
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
23 Nov 2012 05:49 PM
function Init()
game.Players.ChildRemoved:connect(function()
if #game.Players:GetChildren() < 2 then break end
end)

-- the rest of your script
end

game.Players.PlayerAdded:connect(function(player)
if #game.Players:GetChildren() == 2 then Init() end
end)
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
23 Nov 2012 05:50 PM
Change break to return.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
23 Nov 2012 05:56 PM
> Goto would be extremely helpful right now

No. No. Nooo. Goto is evil. Horrible. You may think "I'll just add a little goto statement here*

It ruins your idea of how your program flows, and makes it really confusing to work with any large script. Seriously. Read the xkcd comic. Don't use goto's. Please don't.

I suggest instead of using a goto statement, you use a 'break' statement.



Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
23 Nov 2012 06:50 PM
function dogame()
while wait() do
--codepls
--use break for if players <= 2 then break end
end
dogame()
end

dogame() kyw.

~ Moo logic = logical logic ~
Report Abuse
Merely is not online. Merely
Joined: 07 Dec 2010
Total Posts: 17266
23 Nov 2012 07:47 PM
A goto isn't going to redefine variables or make things back to how they were before. It's just going to break your poorly coded script.
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Nov 2012 08:08 PM
@Merely
Please get the heck out, you moneybag.
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 08:12 PM
@Tenal
You're so mean to Merely :(
Here Merely, have a cookie.

~ I ate Sorcus ~
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Nov 2012 08:13 PM
@thumper
Well, he called my script 'poorly coded'. He was mean to me first.
Report Abuse
129K is not online. 129K
Joined: 23 Aug 2011
Total Posts: 19010
23 Nov 2012 08:14 PM
"He was mean to me first."

i've never thought you were this stupid
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 08:14 PM
@Tenal
Oh, mkay. I'll take that cookie back now.

~ I ate Sorcus ~
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
23 Nov 2012 08:15 PM
@129k
Learn some grammar, you MrNicNac fanboy.
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 08:16 PM
"i've never thought you were this stupid"
ur faic

On Topic:
Honestly I'm OK with 5.1, but I here 5.2 is "faster". The thing is, isn't Lua already fast?

~ I ate Sorcus ~
Report Abuse
129K is not online. 129K
Joined: 23 Aug 2011
Total Posts: 19010
23 Nov 2012 08:16 PM
"Learn some grammar"
oh no
she's going for the grammar
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 08:16 PM
GAH! *hear

~ I ate Sorcus ~
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
23 Nov 2012 08:17 PM
Tenal vs. 129K
This should be interesting. I'm betting on Tenal.

~ I ate Sorcus ~
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