|
| 09 May 2015 11:16 AM |
help me fix the below script, idk whats wrong with it
-------------------------------------------------------
while game.Players.NumPlayers > 2 do local i = Instance.new('Message', workspace) i.Text = "You need 2 or more players to play" wait(10) i.Parent = nil end
while game.Players.NumPlayers >= 2 do (insert round script here)
end
-------------------------------------------------------------
As u can [hopefully] tell, this script makes a message appear if theres only one player in the game that says "You need two or more players to play". But when theres more than 2 players in the game, it begins the round. Please help me fix this script |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 09 May 2015 11:23 AM |
'> 2' should be < 2
siggys are controverial |
|
|
| Report Abuse |
|
|
|
| 09 May 2015 11:34 AM |
>>As u can [hopefully] tell, this script makes a message appear if theres only one player in the game that says "You need two or more players to play".
No actually it doesn't because you flunked first grade math and didn't learn the difference between less than and greater than. |
|
|
| Report Abuse |
|
|
|
| 09 May 2015 12:31 PM |
| If you havent noticed m8, its less than 2. When thers less than 2 players, it says the message. k bye. |
|
|
| Report Abuse |
|
|
|
| 09 May 2015 12:35 PM |
I just made something like this. Let me help you.
function CountPlayers() return #game.Players:GetPlayers() end
local r = 4 --Players Needed to start a game
while true do --count players while (CountPlayers() < r) do msg("Waiting for ".. (r - CountPlayers()) .." more player(s)") wait(.1) end --intermission for i = 45, 1, -1 do msg("Game starting in "..i.." second(s)!") wait(1) end --handle game stuff PlayGame() end
|
|
|
| Report Abuse |
|
|