|
| 07 Apr 2015 02:09 PM |
I've tested it, it doesn't bring out the map. This is not the full script. I'm scripting this project just for fun. :)
local choices = game.SeverStorage.Maps:GetChildren(math.random(1,1))
if choices == 1 then local mapname = "OBBY1" game.ServerStorage.Maps.mapname:Clone().Parent = game.Workspace wait(5) |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 02:39 PM |
*facepalm*
if choices == 1 then local mapname = "OBBY1" game.ServerStorage.Maps.mapname:Clone().Parent = game.Workspace wait(5) end < |
|
|
| Report Abuse |
|
|
| |
|
Haggie125
|
  |
| Joined: 02 Apr 2008 |
| Total Posts: 761 |
|
|
| 07 Apr 2015 03:09 PM |
| Since when does GetChildren() take an arguement? It returns a table of all the items in Maps, so you cant compare a table to 1. If you say #choices, thatll give you the number of items in the table. |
|
|
| Report Abuse |
|
|
Haggie125
|
  |
| Joined: 02 Apr 2008 |
| Total Posts: 761 |
|
|
| 07 Apr 2015 03:11 PM |
Also, this line game.ServerStorage.Maps.mapname:Clone().Parent = game.Workspace is looking for an item called "mapname" in Maps, not something named mapnames value.
so that should be changed to game.ServerStorage.Maps:FindFirstChild(mapname):Clone().Parent = game.Workspace |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 03:11 PM |
along with not closing the if statement you created the local variable mapname without using it.
also you should load the map with a function and call the function with an argument to make a system that's easier to work with:
local maps = game.SeverStorage.Maps:GetChildren()
function LoadMap(map) e = map:Clone() map.Parent = game.Workspace map.Name = "OBBY1" end
LoadMap(maps[math.random(1, #maps)])
-- any maps in the Maps folder are put into a table, then a function randomly selects a map from the table, puts it into Workspace and names it OBBY1. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 07 Apr 2015 03:13 PM |
*facesaw*
local maps = game.ServerStorage:WaitForChild("Maps"):GetChildren()
local choice = maps[math.random(#maps)]:Clone()
choice.Parent = game.workspace choice:MakeJoints()
I script -~ chimmihc |
|
|
| Report Abuse |
|
|