generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: HELP PLEASE!!!

Previous Thread :: Next Thread 
LV1Z is not online. 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
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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 is not online. LV1Z
Joined: 23 Jul 2011
Total Posts: 652
03 May 2012 04:55 PM
thanks
Report Abuse
LV1Z is not online. 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
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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 is not online. 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 is not online. 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
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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 is not online. LV1Z
Joined: 23 Jul 2011
Total Posts: 652
03 May 2012 05:12 PM
I'll try that right now....
Report Abuse
LV1Z is not online. 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 is not online. 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 is not online. LV1Z
Joined: 23 Jul 2011
Total Posts: 652
03 May 2012 05:27 PM
thx ^_^
Report Abuse
LV1Z is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image