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 » Scripters
Home Search
 

Re: Script wait for Player???

Previous Thread :: Next Thread 
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
28 Dec 2015 01:52 PM
Is there a way to make the scripts wait for player to load in Roblox?
Can you plz give me the code?? My scripts load before the character when I join the server. So my run script is looking for something that's not even there yet
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
28 Dec 2015 01:54 PM
repeat wait() until player.Character.
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
28 Dec 2015 01:55 PM
this works for all players??
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
28 Dec 2015 01:57 PM
Depends on how you get the player.

if it's in a localscript then it will be just for the local player.

If it's in a for loop getting all the players then it will work for all the players.
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
28 Dec 2015 02:03 PM
I figured it out!

repeat wait()
local plr = game.Players.LocalPlayer
print("nope")
until plr ~= nil
print("gotcha!")
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
28 Dec 2015 02:06 PM
nvm, I tried testing it in server. But it kept printing nope
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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