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
 

Stopping the player from spawning

Previous Thread :: Next Thread 
MasterDaniel is online. MasterDaniel
Joined: 28 Nov 2008
Total Posts: 2866
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
Theosolis is not online. Theosolis
Joined: 19 Jun 2014
Total Posts: 1
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
xWOWZABOYx is not online. xWOWZABOYx
Joined: 05 Aug 2010
Total Posts: 2689
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
MasterDaniel is online. MasterDaniel
Joined: 28 Nov 2008
Total Posts: 2866
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
xWOWZABOYx is not online. xWOWZABOYx
Joined: 05 Aug 2010
Total Posts: 2689
26 Jun 2014 03:47 AM
Show me your code
Report Abuse
boogerfingerss is not online. boogerfingerss
Joined: 11 Sep 2011
Total Posts: 32
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
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