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
 

Need help

Previous Thread :: Next Thread 
Hypnoxic is not online. Hypnoxic
Joined: 03 Apr 2013
Total Posts: 199
18 May 2013 01:16 PM
I want it to only happen once, but it happens every time I respawn...

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
script.LocalScript:clone().Parent = character
script.Start:clone().Parent = player.PlayerGui
end)
end)

- Run while you can.
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
18 May 2013 01:18 PM
player.CharacterAdded:connect(function(character)

When the character respawns it is triggered because it was 'Added' to Workspace
If you only want it to happen once (when you join the game) delete this line and one of the 'end)'s
Report Abuse
Hypnoxic is not online. Hypnoxic
Joined: 03 Apr 2013
Total Posts: 199
18 May 2013 01:19 PM
Thats how it adds the localscript though

- Run while you can.
Report Abuse
justin2865 is not online. justin2865
Joined: 30 Dec 2011
Total Posts: 4677
18 May 2013 02:03 PM
Put it in lighting then clone it to workspace.

I think, sorry I'm a beginner.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
18 May 2013 02:10 PM
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
local character = player.Character
script.LocalScript:clone().Parent = character
script.Start:clone().Parent = player.PlayerGui
end)
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