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
 

PlayerAdded on Solo

Previous Thread :: Next Thread 
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
09 Jun 2013 09:12 AM
So PlayerAdded doesn't work on Solo, and according to the Wiki, I need to use this line:

for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end



Here's my script.

game.Players.PlayerAdded:connect(function(player)
--code
end)

Where exactly do I put the line?

Thanks
Report Abuse
pauljkl is not online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
09 Jun 2013 09:15 AM
Well you would make the function inside your event as a separate function named ' PlayerAdded' and put that line at the bottom
Report Abuse
LiamScerri is not online. LiamScerri
Joined: 10 Oct 2010
Total Posts: 560
09 Jun 2013 09:15 AM
Below it
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
09 Jun 2013 12:00 PM
This is the script:

game.Players.PlayerAdded:connect(function(player)
--code
end)

for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end

The output is: attempy to call/index PlayerAdded (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