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: Little playerAdded help

Previous Thread :: Next Thread 
jetlogan is not online. jetlogan
Joined: 05 May 2010
Total Posts: 1423
21 Jul 2013 11:14 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
print(player.Name.." has joined the server!")
repeat wait() until player.PlayerGui

script.Parent.Parent.ForPlayers.Menu:Clone().Parent = player.PlayerGui
script.Parent.Parent.ForPlayers.MenuScript:Clone().Parent = player.PlayerGui

characterChild = character:GetChildren()

for times=1,#characterChild do
if characterChild[times]:IsA("Part") then
characterChild[times].BrickColor = BrickColor.new(137)
end
end
end)
end)

Says PlayerGui isn't a member of player.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jul 2013 11:18 PM
Roblox cannot do ANYTHING right,..

Add

repeat wait until player:findFirstChild"PlayerGui"


It's not posting! Stupid Internet!
Report Abuse
jetlogan is not online. jetlogan
Joined: 05 May 2010
Total Posts: 1423
21 Jul 2013 11:25 PM
Still won't work.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jul 2013 11:28 PM
You replaced your current repeat loop with it?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Jul 2013 11:36 PM
Do:

player:WaitForChild("PlayerGui")

I heard using repeat will continue infinitely if the condition's already true, or something like that. And the loop will occur everytime time the character spawns. Plus, it's a built-in function.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jul 2013 11:39 PM
I never found that issue...
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Jul 2013 11:39 PM
I don't know, it was something like that, apparently a moderator said it, though I can't confirm it.
Report Abuse
jetlogan is not online. jetlogan
Joined: 05 May 2010
Total Posts: 1423
21 Jul 2013 11:46 PM
Yes, I do wait() right?
Report Abuse
ember1465 is not online. ember1465
Joined: 09 Apr 2009
Total Posts: 398
22 Jul 2013 12:13 AM
Let me just do some stuff here:


local Players = game.Players;
local forPlayers = script.Parent.Parent.ForPlayers;

Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
print(player.Name .. " has joined the server!");
repeat wait() until player:FindFirstChild("PlayerGui");
-- OR player:WaitForChild("PlayerGui");

forPlayers.Menu:Clone().Parent = player.PlayerGui;
forPlayers.MenuScript:Clone().Parent = player.PlayerGui;

for _, object in next, (character:GetChildren()) do
if (object:IsA("Part")) then
object.BrickColor = BrickColor.new(127);
end
end
end)
end)


It's the same thing, just looks nicer and works.

~ Rainbow Dash is best pony ~
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