|
| 04 Sep 2012 11:35 AM |
I was planing to make a game with a minimal of four players.
I saw some games with shouts if you're the only the only person "Not enough players!"
I wanted to know how to make a scipt it? Or do you know whats the name of it or is it avaleblie in free models? |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2012 11:41 AM |
Ok, this is how.
Game.Players:PlayerAdded:connect(function() { players = Game.Players:GetChildren() if(#players < 4) then Instance.new("Message", Workspace).Text = "Not enough players" else Workspace.Message:Destroy() end } |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Sep 2012 04:05 PM |
or
repeat wait() until #game.Players:GetChildren() >= 4
FAIL COBRAS! |
|
|
| Report Abuse |
|
|
galaxen
|
  |
| Joined: 27 Sep 2008 |
| Total Posts: 1841 |
|
|
| 04 Sep 2012 04:24 PM |
Use
game.Players.NumPlayers
or
game.Players:GetPlayers()
instead, a :GetChildren() can get unwanted results (rearly but still) |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2012 06:36 PM |
| repeat wait(1) until Game.Players.NumPlayers >= 4 |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 02:55 PM |
| So what would the script look like? |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 03:48 PM |
playersNeeded = 4 whenThereIsEnoughPlayers = function() -- what happens when there is a substantial amount of players end
repeat wait(1) until Game.Players.NumPlayers >= playersNeeded whenThereIsEnoughPlayers() |
|
|
| Report Abuse |
|
|
| |
|