tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 26 Jun 2014 02:42 PM |
Essentially my gui has 5 options you pick one it spawns you to a random block named 1 2 3 or 4 I also have a map script to scroll through my maps and I want to make the blocks namde 1 2 3 or 4 specified within them so I grouped them into the lighting for each map, my function is supposed to find those but I don't know how to do it 1 2 3 and 4 are not grouped inside of the maps so they are still just labeled 1 2 3 4. Please help
function FindSpawns () if workspace:findFirstChild("Map1") then local spawns spawns = workspace.Map1:GetChildren() else if (workspace:findFirstChild("Map2")) then local spawns = {} spawns2 = workspace.Map2:GetChildren() else if (workspace:findFirstChild("Map3")) then local spawns = {} spawns2 = workspace.Map3:GetChildren() end
function OnClicked() wait (5) spawns = {"1","2","3","4"} --Names of the bricks that are used for spawns spawn = spawns[math.random(1,#spawns)] actual = game.Workspace:findFirstChild(spawn) game.Players.LocalPlayer.Character.Torso.CFrame = Workspace[math.random(4)].CFrame -- teleports person from neutral spawn to whatever your spawns are set to. end script.Parent.Main.Assault.MouseButton1Up:connect(OnClicked) script.Parent.Main.Commando.MouseButton1Up:connect(OnClicked) script.Parent.Main.Sniper.MouseButton1Up:connect(OnClicked) script.Parent.Main.Scout.MouseButton1Up:connect(OnClicked) script.Parent.Main.Demolition.MouseButton1Up:connect(OnClicked) |
|
|
| Report Abuse |
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
| |
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
| |
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
| |