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
 

**Question:)

Previous Thread :: Next Thread 
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
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 is not online. 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 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
02 Jan 2014 08:32 PM
^ lol'd
Report Abuse
Arkose is not online. Arkose
Joined: 26 May 2013
Total Posts: 745
02 Jan 2014 08:33 PM
y






~ắṝḱờṧἓ
Report Abuse
WillScriptForFood is not online. WillScriptForFood
Joined: 03 Aug 2013
Total Posts: 701
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
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
02 Jan 2014 08:38 PM
Thank you guys:) appreciate this forum
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