|
| 02 Jan 2014 08:27 PM |
Is it possible to delay when a player spawns, as he/she first joins the game. If so what is the function?
-Thanks |
|
|
| Report Abuse |
|
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
|
| 02 Jan 2014 08:31 PM |
Straight off the wiki
local respawnTime = 5 local Players = Game:GetService("Players") Players.CharacterAutoLoads = false Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) -- find the humanoid, and detect when it dies local Humanoid = Character:FindFirstChild("Humanoid") if Humanoid then Humanoid.Died:connect(function() -- delay, then respawn the character wait(respawnTime) Player:LoadCharacter() end) end end) Player:LoadCharacter() -- load the character for the first time end)
~ắṝḱờṧἓ |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
| |
|
Arkose
|
  |
| Joined: 26 May 2013 |
| Total Posts: 745 |
|
| |
|
|
| 02 Jan 2014 08:33 PM |
game:GetService('Players').AutoCharacterLoads = false
game:GetService('Players').PlayerAdded:connect(function(player) -- your code before player spawns
player:LoadCharacter()
player.CharacterAdded:connect(function(character) character.Humanoid.Died:connect(function() wait(5) player:LoadCharacter() end) end) end) |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2014 08:38 PM |
| Thank you guys:) appreciate this forum |
|
|
| Report Abuse |
|
|