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
 

Why does this only work when they respawn?

Previous Thread :: Next Thread 
kinglime is not online. kinglime
Joined: 27 Jun 2008
Total Posts: 2751
16 Jul 2013 07:10 PM
Workspace.ChildAdded:connect(function(child)
print(child.Name)
end)


New to this.
How can I make it so that when they enter game and respawn it does this?
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
16 Jul 2013 07:14 PM
If your testing in solo mode, it may be character added before script loaded?
Report Abuse
kinglime is not online. kinglime
Joined: 27 Jun 2008
Total Posts: 2751
16 Jul 2013 07:21 PM
I try'ed added waits in a couple places and still nothing.
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
16 Jul 2013 07:21 PM
Because that script only works when the character has been respawned.

game.Players.ChildAdded:connect(function(p) -- player enters the server
p.CharacterAdded:connect(c) -- player's character has loaded
print(p.Name)
end
end)
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
16 Jul 2013 07:22 PM
I forgot something. D:

game.Players.ChildAdded:connect(function(p) -- player enters the server
p.CharacterAdded:connect(c) -- player's character has loaded
print(p.Name)
end)
end)
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
16 Jul 2013 07:27 PM
D: what's wrong with me today.

game.Players.ChildAdded:connect(function(p) -- player enters the server
p.CharacterAdded:connect(function(c) -- player's character has loaded
print(p.Name)
end)
end)
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
16 Jul 2013 07:35 PM
a better way is

Game.Players.PlayerAdded:connect(function(p)
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
16 Jul 2013 07:38 PM
@Samuel
But playeradded has been acting pretty weird lately.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
16 Jul 2013 07:45 PM
I prefer

playerAdded = function(player)
player.CharacterAdded:connect(function(character)
print('Character Added', player)
end)
end

game.Players.PlayerAdded;connect(playerAdded)

for i, v in next, game.Players:GetPlayers() do
playerAdded(v)
end



As this will work in Play Solo.
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