BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 20 Mar 2015 06:20 PM |
while (map1 ==map2 or map3) or (map2==map1 or map3) or (map3==map1 or map2) do map1=Maps[math.random(1,#Maps)] map2=Maps[math.random(1,#Maps)] map3=Maps[math.random(1,#Maps)] wait(1) end
Will this just go on forever? How can I fix it? |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
| |
|
|
| 20 Mar 2015 08:19 PM |
mapTime = 180 maps = {"","",""} while wait(mapTime) do local map = math.random(#maps)do map:Clone() map.Parent = game.Workspace end end)
Thats prob not right, but sometin like dat |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 20 Mar 2015 08:21 PM |
| I'm trying to select maps for a voting system, not do a round |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Mar 2015 09:28 PM |
function ChooseMaps() wait() map1=Maps[math.random(1,#Maps)] map2=Maps[math.random(1,#Maps)] map3=Maps[math.random(1,#Maps)] end
repeat ChooseMaps() until map1 ~= map2 or map3 and map2 ~= map1 or map3 and map3 ~= map1 or map2
That could help, if not, I can write up something a little bit better. I just wrote this up in a matter of 30 seconds or so, so if it doesn't work, just say so and I'll write one that'll work for sure. |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Mar 2015 10:12 PM |
Guys let's be efficient here:
map1 = table.remove(maps, math.random(#maps)); map2 = table.remove(maps, math.random(#maps)); map3 = table.remove(maps, math.random(#maps)); |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 21 Mar 2015 10:42 AM |
Well, cn't i tried this map1=Maps[math.random(1,#Maps)] table.remove(Maps,map1) etc, but didn't work |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Mar 2015 01:22 PM |
| Because you're doing it wrong, look at mine. table.remove takes the index, not the value. |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
| |
|