|
| 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 |
|
|
|
| 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
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 26 Dec 2013 07:05 PM |
newPlayer:GetPlayerFromCharacter() newPlayer:LoadCharacter() |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Dec 2013 07:18 PM |
| loadcharacter() method instantly makes a player's character load, and spawn at the current spawn position. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|