Jaitix
|
  |
| Joined: 03 May 2014 |
| Total Posts: 17724 |
|
|
| 05 Jul 2016 06:35 PM |
Hey,
so my game has the whole game mechanics, and no errors appear. It is a "While true do" loop.
But when there are two players, it just doesn't go around for another loop. Is there a special type of loop I need to go forever and while true do doesn't work anymore?
Thanks if you can help! :)
|
|
|
| Report Abuse |
|
|
|
| 05 Jul 2016 06:36 PM |
while wait() do?
You should avoid loops all together and use events when possible though. |
|
|
| Report Abuse |
|
|
|
| 05 Jul 2016 06:36 PM |
wheres the code
https://www.roblox.com/kermit-item?id=111404350 |
|
|
| Report Abuse |
|
|
Jaitix
|
  |
| Joined: 03 May 2014 |
| Total Posts: 17724 |
|
|
| 05 Jul 2016 06:44 PM |
I've tried learning ROBLOX Lua for a long time.
I stick to properties, takes longer but it takes even longer to learn how to use all the event crap.
Anyways, it's basically the whole game, I don't want to leak the code otherwise it'll basically give you a free copy of my game.
It just has
if num == 1 does something
or if num == 2 does something
SHOULD start from the top of the list, no errors are popping up.
|
|
|
| Report Abuse |
|
|
|
| 05 Jul 2016 06:46 PM |
| No one is going to steal your game, we need more information than this. If you don't want to post the script then troubleshoot using print() and seeing where the code makes it to before it breaks. |
|
|
| Report Abuse |
|
|
Jaitix
|
  |
| Joined: 03 May 2014 |
| Total Posts: 17724 |
|
|
| 05 Jul 2016 06:47 PM |
I just tried "while 2>1 do"
Same problem.
|
|
|
| Report Abuse |
|
|
|
| 05 Jul 2016 06:48 PM |
| That should work, something within the loop is breaking it. |
|
|
| Report Abuse |
|
|
Jaitix
|
  |
| Joined: 03 May 2014 |
| Total Posts: 17724 |
|
|
| 05 Jul 2016 06:48 PM |
Okay, I'll give you this.
elevatortime.Text = ("15") wait(1.2) elevatortime.Text = ("14") wait(1.2) elevatortime.Text = ("13") wait(1.2) elevatortime.Text = ("12") wait(1.2) elevatortime.Text = ("11") wait(1.2) elevatortime.Text = ("10") wait(1.2) elevatortime.Text = ("9") wait(1.2) elevatortime.Text = ("8") wait(1.2) elevatortime.Text = ("7") wait(1.2) elevatortime.Text = ("6") wait(1.2) elevatortime.Text = ("5") wait(1.2) elevatortime.Text = ("4") wait(1.2) elevatortime.Text = ("3") wait(1.2) elevatortime.Text = ("2") wait(1.2) elevatortime.Text = ("1") wait(1.2) elevatortime.Text = ("L") wait(1.2) elevatortime.Text = ("L") -- There is two L's because the first L doesn't show up when the map loads... Then after the the thing is selected, the text just stays as "L" and doesn't go back to "15".
|
|
|
| Report Abuse |
|
|
|
| 05 Jul 2016 06:50 PM |
| None of that would break the loop. |
|
|
| Report Abuse |
|
|
Jaitix
|
  |
| Joined: 03 May 2014 |
| Total Posts: 17724 |
|
|
| 05 Jul 2016 06:52 PM |
I tried without the two L's and just one L, still nothing.
It says this for teleporting tho
for i = 1, # players do players[i].Character:MoveTo(Vector3.new(15, 1.2, -48))
So I am confused how the # and 1 work. Took this right off the wiki. The teleporting works fine, but I feel like this is where it might mess up.
|
|
|
| Report Abuse |
|
|
Jaitix
|
  |
| Joined: 03 May 2014 |
| Total Posts: 17724 |
|
|
| 05 Jul 2016 06:54 PM |
Here is a whole section:
if num == 2 then --Copy and paste this next section for each map, changing the number from 1 to 2, 3, and so on. whole = game.Workspace.ElevatorBackWall.SurfaceGui --Creates a new message MapName = whole.MapName WhoMade = whole.WhoMade MiniDeciding = whole.MiniGameDeciding MiniDeciding.Text = "Choosing Obby..." --Feel free to change these next couple of lines as needed wait(3) MiniDeciding.Text = "Loading Obby" MapName.Text = "The School Obby was Chosen!" WhoMade.Text = "Creator: Jaitix" wait(4) MiniDeciding.Text = "This obby lasts for 30 seconds!" wait(4) MapName.Text = " " WhoMade.Text = " " MiniDeciding.Text = " "
--m.Parent = nil game.Lighting.SchoolLevel:clone().Parent = game.Workspace --Change the "Minigame1 to the name of your map (stored in Lighting)
doors.Parent = game.Lighting doors.Transparency = 0.2 wait(0.2) doors.Transparency = 0.4 wait(0.2) doors.Transparency = 0.6 wait(0.2) doors.Transparency = 0.8 wait(0.2) doors.Transparency = 1 --game.Lighting.LinkedSword:clone().Parent = players[i].Backpack --Change LinkedSword to the name of a weapon (in Lighting) you want to give to the players. You can either delete this line or copy paste more of it.
wait(30) --This is how long the game will last for i = 1, # players do players[i].Character:MoveTo(Vector3.new(15, 1.2, -48)) game.Workspace.SchoolLevel:Remove() --Change Minigame1 to the name of your map. doors.Parent = game.Workspace doors.Transparency = 1 wait(0.2) doors.Transparency = 0.8 wait(0.2) doors.Transparency = 0.6 wait(0.2) doors.Transparency = 0.4 wait(0.2) doors.Transparency = 0.2 wait(0.2) doors.Transparency = 0
--m.Parent = game.Workspace --m.Text = "Game over! Thank you for playing!" --wait(3) --m.Text = "You have 1 minute until the start of the next game." --wait(3) --m.Parent = nil end --m:Remove() end end end
|
|
|
| Report Abuse |
|
|