LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 04:25 PM |
This is a portion of my script that needs editing, the game keeps freezing when I start a test:
players = game.Players:GetPlayers() if #players ==1 then hnt.Text = "Waiting for more players to be ready to race..." wait(1) repeat until #players ==2 end
what is wrong with it? |
|
|
| Report Abuse |
|
|
|
| 03 May 2012 04:32 PM |
for _,v in pairs(game.Players:GetPlayers())do if #v==1 then hnt.Text="Waiting for more players to begin race." repeat wait(1)until #v==2 end end
You need a wait in the repeat, I believe. |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 05:00 PM |
ummm... output says:
17:59:15 - Workspace.GamingScript:168: attempt to get length of local 'v' (a userdata value) |
|
|
| Report Abuse |
|
|
|
| 03 May 2012 05:04 PM |
for _,players in pairs(game.Players:GetPlayers())do if #players==1 then hnt.Text="Waiting for more players to begin race." repeat wait(1)until #players==2 end end
You must have had another variable named 'v' which caused it to break when you attempted to utilize it later on in the script. |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 05:05 PM |
o so its players, not v, because you didnt state v thanks man |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 05:08 PM |
| the output said the samething again exept it said players instead of v, I stated that players = game.Players:GetChildren() |
|
|
| Report Abuse |
|
|
|
| 03 May 2012 05:11 PM |
e={} for _,v in pairs(game.Players:GetPlayers())do e[#e+1]=v if #v==1 then hnt.Text="Waiting for more players to begin race." repeat wait(1)until #v==2 end end |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 05:12 PM |
| I'll try that right now.... |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 05:14 PM |
:'(
18:13:57 - Workspace.GamingScript:170: attempt to get length of local 'v' (a userdata value)
|
|
|
| Report Abuse |
|
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 03 May 2012 05:21 PM |
e={} for _,abejsbje in pairs(game.Players:GetPlayers())do e[#e+1]=v if #v==1 then hnt.Text="Waiting for more players to begin race." repeat wait(1)until #abejsbje==2 end end
- Cheers! |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 03 May 2012 05:29 PM |
| v.v now the output says v is a nil value |
|
|
| Report Abuse |
|
|