|
| 03 Sep 2013 04:02 PM |
I have a disaster type game, and I need it to go like this. Servers begins > wait(30) teleport all players to first voting booth > disasters > lobby > wait(30) teleport all players to voting booth #2 Problem: It teleports to the first voting booth, but never goes to the second voting booth after they come back from the first disasters.
I made two scripts that I want to try to loop the teleporting with, Script #1:
db = false
while wait() do if db == false then db = true if game.Workspace.Rounds.Value == 0 then local Pos = Vector3.new(-133.659, 60.293, -248.462) wait(30) for _,v in next, game.Players:GetPlayers() do if v.Character then v.Character:MoveTo(Pos); wait(300) db = false end end end
Script #2: db = false
while wait() do if db == false then db = true if game.Workspace.Rounds.Value == 1 then local Pos2 = Vector3.new(-102.843, 10.099, 187.896) wait(30) for _,v in next, game.Players:GetPlayers() do if v.Character then v.Character:MoveTo(Pos2); wait(300) db = false end end end
Please help, this is one of the core scripts I need for my game.
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 03 Sep 2013 04:32 PM |
| You guys are SO smart and helpful... |
|
|
| Report Abuse |
|
|
| |
|
Exus100
|
  |
| Joined: 11 Aug 2007 |
| Total Posts: 351 |
|
|
| 03 Sep 2013 04:42 PM |
| why do you have 2 scripts? |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 04:43 PM |
| Because I tried writing it all in one, and I tried EVERYTHING else, so I tried splitting up, still doesnt work. |
|
|
| Report Abuse |
|
|
Exus100
|
  |
| Joined: 11 Aug 2007 |
| Total Posts: 351 |
|
|
| 03 Sep 2013 04:44 PM |
when does the rounds.Value increase?
|
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 04:45 PM |
| Right after the first disasters is done. |
|
|
| Report Abuse |
|
|
Exus100
|
  |
| Joined: 11 Aug 2007 |
| Total Posts: 351 |
|
|
| 03 Sep 2013 04:47 PM |
| and whats with the wait(300)? |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 04:49 PM |
| Thats just try to to make it wait so it doesnt teleport everyone again until the rounds value changes. |
|
|
| Report Abuse |
|
|
Exus100
|
  |
| Joined: 11 Aug 2007 |
| Total Posts: 351 |
|
|
| 03 Sep 2013 04:55 PM |
--The only bad about this script is that it will teleport the players after 30 seconds everytime the rounds.Value is changed function teleportPlayers(pos) for _,v in pairs(game.Players:GetPlayers()) do if v.Character then v.Character:MoveTo(pos); end end end
function roundChanged(val) wait(30); if (val == 0) then teleportPlayers(Vector3.new(-133.659, 60.293, -248.462)) elseif (val == 1) then teleportPlayers(Vector3.new(-102.843, 10.099, 187.896)) end end
game.Workspace.Rounds.Changed:connect(roundChanged); |
|
|
| Report Abuse |
|
|
Exus100
|
  |
| Joined: 11 Aug 2007 |
| Total Posts: 351 |
|
|
| 03 Sep 2013 04:56 PM |
and add roundChanged(0); to the end of it
|
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 05:04 PM |
I forgot all about the "Changed" event, thanks. Btw your script doesnt really work, but it gave me an idea for another script. |
|
|
| Report Abuse |
|
|
tummey2
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 1802 |
|
|
| 03 Sep 2013 05:15 PM |
| Try CFraming the player's Torso? |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 05:16 PM |
| Thats not the problem tummey. |
|
|
| Report Abuse |
|
|