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: Respawn Player

Previous Thread :: Next Thread 
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
26 Dec 2013 07:00 PM
Ok, so on a thing I'm working on I need a player to respawn a few seconds after they first join the game:

function Enter(newPlayer)
wait(1)
newPlayer:Respawn
end

game.Players.ChildAdded:connect(Enter)




Is "newPlayer:Respawn" a valid statement?
Report Abuse
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
26 Dec 2013 07:03 PM
If it isn't a valid statement can you please state the corrected version of that line?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Dec 2013 07:05 PM
newPlayer:GetPlayerFromCharacter()
newPlayer:LoadCharacter()
Report Abuse
kubuto2 is not online. kubuto2
Joined: 16 Jul 2008
Total Posts: 1275
26 Dec 2013 07:06 PM
This will have to be in a regular script.
Also in the Players Object you can turn off auto spawn character.

newPlayer:LoadCharacter()
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Dec 2013 07:06 PM
Or you could kill them;

newPlayer.Humanoid.Health == 0
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
26 Dec 2013 07:10 PM
^ Why double "="
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Dec 2013 07:12 PM
Oh sorry, I thought there was an if statement before the killing.
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
26 Dec 2013 07:12 PM
Use this:

game.Players.PlayerAdded:connect(function(nP)
nP:LoadCharacter()
end)
Report Abuse
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
26 Dec 2013 07:16 PM
The :LoadCharacter part isn't making them respawn. What I want the script to do is to automatically respawn a player a few seconds after they join the server.

Could anyone make that for me and explain it?


-Renas...
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
26 Dec 2013 07:18 PM
loadcharacter() method instantly makes a player's character load, and spawn at the current spawn position.
Report Abuse
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
26 Dec 2013 07:21 PM
@jetta

Ok, I exchanged that for the newPlayer:Respawn part of my script but it didn't work. Which is why I need someone to make a script that will respawn the player a few seconds after they join and explain it.
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
26 Dec 2013 07:23 PM
game.Players.PlayerAdded:connect(function(player)--Checks for added player
repeat wait() until player.Character--waits for their character to load
wait(5)--waits 5 seconds
player:LoadCharacter()--loads the character
end)--ends the connection
Report Abuse
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
26 Dec 2013 07:26 PM
@jetta

Yeah that works, thanks man. I think my problem was that I didn't make it wait for the player to load the first time when I added the :LoadCharacter() part.


Thanks, -Renas...


[Thread resolved]
Report Abuse
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
26 Dec 2013 07:33 PM
@jetta

I made it one of my models because I need it to work with a spawn I made, I have your name in the desc. for it though.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
26 Dec 2013 07:47 PM
Respawn()
maybe?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
26 Dec 2013 07:47 PM
oh,nvm thread resolved...
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