|
| 13 Jul 2015 02:50 AM |
so im trying to delete the clone of the map but im not sure how.
while wait() do wait(10) workspace.LobbyMessage.Text = "Preparing..." -- we'll get fancy with GUIs later local maps = game.ReplicatedStorage.Maps:GetChildren() Map = maps[math.random(1,#maps)] Map:Clone().Parent = workspace wait(1) workspace.LobbyMessage.Text = "" for i,players in pairs(game.Players:GetPlayers()) do players.Character.Torso.CFrame = CFrame.new(Map.Start.Position.X+i,Map.Start.Position.Y+12,Map.Start.Position.Z+i) players.Character.Humanoid.WalkSpeed = 0 wait(2) workspace.LobbyMessage.Text = "GO" players.Character.Humanoid.WalkSpeed = 40 wait(.3) workspace.LobbyMessage.Text = "" Map.End.Script.EndTouched:FireServer() Map:Destroy() end end
<3 cats <3 |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 13 Jul 2015 02:58 AM |
while wait() do wait(10) workspace.LobbyMessage.Text = "Preparing..." -- we'll get fancy with GUIs later local maps = game.ReplicatedStorage.Maps:GetChildren() local Map = maps[math.random(1,#maps)] local NewMap = Map:Clone().Parent = workspace wait(1) workspace.LobbyMessage.Text = "" for i,players in pairs(game.Players:GetPlayers()) do players.Character.Torso.CFrame = CFrame.new(Map.Start.Position.X+i,Map.Start.Position.Y+12,Map.Start.Position.Z+i) players.Character.Humanoid.WalkSpeed = 0 wait(2) workspace.LobbyMessage.Text = "GO" players.Character.Humanoid.WalkSpeed = 40 wait(.3) workspace.LobbyMessage.Text = "" Map.End.Script.EndTouched:FireServer() NewMap:Destroy() end end |
|
|
| Report Abuse |
|
|
lomo0987
|
  |
| Joined: 31 May 2008 |
| Total Posts: 2461 |
|
|
| 13 Jul 2015 03:01 AM |
Let me just clean up your script..
------------------------------------------ Message = Workspace.LobbyMessage maps = game.ReplicatedStorage.Maps:GetChildren()
while true do -- Set this to true. :D wait(10) Message.Text = "Preparing..." -- Made that clean :D Map = maps[math.random(1,#maps)] Map:Clone().Parent = workspace wait(1) Message.Text = "" -- Clean :D for i,players in pairs(game.Players:GetPlayers()) do players.Character.Torso.CFrame = CFrame.new(Map.Start.Position.X+i,Map.Start.Position.Y+12,Map.Start.Position.Z+i) players.Character.Humanoid.WalkSpeed = 0 wait(2) workspace.LobbyMessage.Text = "GO" players.Character.Humanoid.WalkSpeed = 40 wait(.3) Message.Text = "" --Clean :D Map.End.Script.EndTouched:FireServer() --Uhh.. What? Map:Destroy() -- this should work :D end end |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2015 03:01 AM |
it doesnt like an equal sign in a variable
<3 cats <3 |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2015 03:03 AM |
and i added a RemoteEvent in the 'End' with a script because i cant out functions in the loop
<3 cats <3 |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2015 03:06 AM |
and while wait() do is much more efficient with while loops
<3 cats <3 |
|
|
| Report Abuse |
|
|
lomo0987
|
  |
| Joined: 31 May 2008 |
| Total Posts: 2461 |
|
|
| 13 Jul 2015 03:08 AM |
Really, by how much?
You would just get the clone the same way you made it's parent game.Workspace :D |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2015 03:11 AM |
it saves you a line of code instead of saying while true do wait(1) end
and what do you mean?
<3 cats <3 |
|
|
| Report Abuse |
|
|
lomo0987
|
  |
| Joined: 31 May 2008 |
| Total Posts: 2461 |
|
|
| 13 Jul 2015 03:16 AM |
| Uhh, My waits are in different spots within a functions that are getting called :D So I don't really need to add a wait() instead of true.. Besides, if you name it to "Run" and have Run = true. if you ever make Run false you can stop the loop :D |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2015 03:17 AM |
so what do you mean by getting the clone?
<3 cats <3 |
|
|
| Report Abuse |
|
|
lomo0987
|
  |
| Joined: 31 May 2008 |
| Total Posts: 2461 |
|
|
| 13 Jul 2015 03:19 AM |
I forgot to add that XD
You named the clone "Map" in the script... So "Map" is the clone..
map = maps[math.random(1,#maps)] -- This names the map.. map.Parent = game.Workspace map:Destroy() -- Removes the map :D |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2015 03:19 AM |
No, that deletes the stored one, not the clone
<3 cats <3 |
|
|
| Report Abuse |
|
|
lomo0987
|
  |
| Joined: 31 May 2008 |
| Total Posts: 2461 |
|
|
| 13 Jul 2015 03:22 AM |
Ohh, I see the problem, you forgot to name the clone. ClonedMap = Map:Cloned().Parent = game.Workspace ClonedMap:Destroy() |
|
|
| Report Abuse |
|
|