Jezz11
|
  |
| Joined: 30 Jan 2009 |
| Total Posts: 19 |
|
|
| 11 Apr 2015 07:18 PM |
I am trying to make a simple script to check how many players are in the game, but it keeps giving me an error at the point where I open a table saying "Expected identifier, got ')'"
Any tips? |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 11 Apr 2015 07:22 PM |
| We need to see the portion of the code. |
|
|
| Report Abuse |
|
|
Jezz11
|
  |
| Joined: 30 Jan 2009 |
| Total Posts: 19 |
|
|
| 11 Apr 2015 07:24 PM |
while true do -- wait for 2 players wait(3) people = () for _, player in pairs(game.Players:GetPlayers()) do if player and player.Character then local humanoid = player.Character:WaitForChild("Humanoid") if humanoid and humanoid.Health > 0 then table.insert(people, player) end end end if #people >= 2 then break end end |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 11 Apr 2015 07:25 PM |
while true do -- wait for 2 players wait(3) people = {} for _, player in pairs(game.Players:GetPlayers()) do if player and player.Character then local humanoid = player.Character:WaitForChild("Humanoid") if humanoid and humanoid.Health > 0 then table.insert(people, player) end end end if #people >= 2 then break end end
try that |
|
|
| Report Abuse |
|
|
Jezz11
|
  |
| Joined: 30 Jan 2009 |
| Total Posts: 19 |
|
|
| 11 Apr 2015 07:27 PM |
| That worked perfectly! Thank you! |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 11 Apr 2015 07:29 PM |
no problemo
[just in case]: the problem is that u used () instead {} |
|
|
| Report Abuse |
|
|