|
| 16 Aug 2014 05:00 AM |
Instead of script.Parent.Parent.Parent.Character:remove(), is their a way to make the character wait to spawn?
function onPlayerEntered(newPlayer) repeat wait() until newPlayer:FindFirstChild("PlayerGui") ~= nil script.Parent.Parent.Parent.Character:remove() wait(1) for i,v in pairs(newPlayer.PlayerGui:GetChildren()) do v:Remove() end local Gui = script.Gui:Clone() Gui.Parent = newPlayer.PlayerGui end
Game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 16 Aug 2014 05:17 AM |
| http://wiki.roblox.com/index.php?title=API:Class/Players/CharacterAutoLoads |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:22 AM |
| Ahead of you, and i'm stuck. Please state your examples. I've already been trying the wiki. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 16 Aug 2014 05:23 AM |
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 |
|
|
|
| 16 Aug 2014 05:24 AM |
This is so simple it's not even funny... Wrote this for you, took like 2 mins
local Players = game:GetService("Players") Players.CharacterAutoLoads = false local RespawnTime = 3
Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) Character:WaitForChild("Humanoid").Died:wait() wait(RespawnTime) Player:LoadCharacter() end) Player:LoadCharacter() end)
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:26 AM |
@breuning There's no need for a connection, it will just take up unnecessary threads
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:26 AM |
| I've already tried this. If you actually read what I said. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 16 Aug 2014 05:28 AM |
I took the example from the wiki, isn't mine.
People are you using a localscript? This only works in scripts. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:29 AM |
| Where do I even put the loading gui? This just makes you spawn. I want it to wait until because I have a script that already loads the character. I just need the character to wait with the loading gui. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2014 05:30 AM |
For some weird reason you still say you are stuck. Above you have 2 perfectly working scripts that do exactly what you asked for, a wait time before the character respawns. If you want it to do something else, say it. We can't read your mind.
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:31 AM |
repeat wait(1/30) until Player.PlayerGui:FindFirstChild("loading gui name")
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:33 AM |
local Players = game:GetService("Players") Players.CharacterAutoLoads = false
Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) local Gui = script.Gui:Clone() Gui.Parent = Player.PlayerGui Character:WaitForChild("Humanoid").Died:wait() end) end)
??? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 05:36 AM |
| I'm so sorry. I had the script disabled by accident. Very sorry about that. |
|
|
| Report Abuse |
|
|