|
| 02 Aug 2011 12:27 AM |
i have this script: ------------------------------------------------------------------------------------------ if game.Players.NumPlayers > 2 then wait(1) loc=Vector3.new(9,1,7) local m = Instance.new("Message") m.Parent = game.Workspace m.Text = "Required amount of players has reached, starting momentarily..." wait(3) m:Remove() wait(5) for i, v in pairs(game.Players:children()) do if v.Character then v.Character:MoveTo(loc) end end end ------------------------------------------------------------------------------------------ it checks if the number of players is greater than 2, and if it is, starts a message, and moves the players to the location.Question:will the first line work? main Question:how will i make a script to where if all players die, the game resets and this script plays again? |
|
|
| Report Abuse |
|
|
3465yoba
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 377 |
|
|
| 02 Aug 2011 12:31 AM |
plrs = game.Players:getChildren() if #plrs > 2 then --BLAH end
~Get the water boiling... I'll get the cauldron and the seasoning... |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 12:39 AM |
local died = 0
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) c.Humanoid.Died:connect(function() died = died + 1 end) end) end)
while true do if game.Players.NumPlayers > 2 then wait(1) loc=Vector3.new(9,1,7) local m = Instance.new("Message") m.Parent = game.Workspace m.Text = "Required amount of players has reached, starting momentarily..." wait(3) m:Remove() wait(5) for i, v in pairs(game.Players:children()) do if v.Character then v.Character:MoveTo(loc) end end repeat wait() until died == game.Players.NumPlayers end
|
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 12:40 AM |
Oops, put another end at the bottom, and after the repeat loop, put:
died = 0 |
|
|
| Report Abuse |
|
|