|
| 05 May 2013 05:21 PM |
Maps = {"Test1","Test2","Test3","Test4","Test5"} while wait(600) do Map = script:FindFirstChild(math.random(#Maps)) if Map then Map.Disabled = false end end
Trying to make it choose a random map, I've found that when testing it uses numbers, any way to make it use lets say, Test1 instead of 1? |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:24 PM |
Map = script:FindFirstChild("Test"..math.random(#Maps))
|
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:27 PM |
| Anyone better methods to where every model/script has to be named the same thing with a number after it? |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2013 05:31 PM |
make variables? or do if's like this
a = math.random(1,3)
if a == 1 then --your script here end
if a == 2 then --your script here end
if a == 3 then --your script here end
a bit long but convenient
|
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:39 PM |
btw, If you're going to use a table you could also do:
Maps = {"Test1","Test2","Test3","Test4","Test5"} while wait(600) do Map = script[Maps[math.random(#Maps)]] |
|
|
| Report Abuse |
|
|