|
| 22 Jun 2014 08:44 AM |
I am having trouble figuring out how I can stop the player from spawning in the game until they have clicked a play button in a GUI.
I would have attempted to write a script but I have no idea where to start :s Can anyone help? MD |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 08:53 AM |
excerpt from wiki, this may help (sorry I'm on mobile)
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 |
|
|
|
| 22 Jun 2014 08:57 AM |
In the starterpack or a GUI or something (a script that refreshes when the player spawns)
player = script.Parent.Parent.Parent -- or whatever game.Workspace:WaitForChild(player.Name):Destroy() -- removes the character
script.Parent.MouseButton1Click:connect(function() player:LoadCharacter() --spawns the character when a button is clicked end)
【◄[ϟ]〓☜✪ xWOWZABOYx; FCOM, SQN COM, Scientist, Veteran, Visionary ✪☞〓[ϟ]►】 |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 11:38 AM |
Hmm, I got the error that player is a nil value. I made sure that I have the right player (its inside a local script so game.Players.LocalPlayer) and that both variables match. Hmm Any ideas? |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jun 2014 03:52 AM |
game.Players.ChildAdded:connect(function(plr) plr.CharacterAdded:wait() --load gui end)
Using CharacterAdded:wait() so it doesn't repeat the process everytime they respawn. |
|
|
| Report Abuse |
|
|