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
 

When a player dies, they don't spawn?

Previous Thread :: Next Thread 
truefire2 is not online. truefire2
Joined: 04 Jul 2010
Total Posts: 5330
22 Feb 2014 11:36 AM
Hi. I've created a custom spawning system, however I've discovered a flaw. When a player dies and they're still on the team, they don't spawn back at where the bricks where they're supposed to spawn at?

How do I fix this problem?
Thank you.

function customspawn()
local redcolor = BrickColor.new("Bright red")
local blucolor = BrickColor.new("Bright blue")
local curmap = Workspace.MapHolder:GetChildren()[1]
for i,v in next, game.Players:GetPlayers() do
if curmap then
if v.TeamColor == redcolor then
local reds = curmap.redspawns
local spawn1 = reds:GetChildren()
local spawn = spawn1[math.random(1,#spawn1)]
v.Character:MoveTo(spawn.Position)
elseif v.TeamColor == blucolor then
local blus = curmap.bluespawns
local spawn2 = blus:GetChildren()
local spawn = spawn2[math.random(1,#spawn2)]
v.Character:MoveTo(spawn.Position)
end
end
end
end
Report Abuse
truefire2 is not online. truefire2
Joined: 04 Jul 2010
Total Posts: 5330
22 Feb 2014 02:37 PM
bump
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
22 Feb 2014 02:45 PM
Use a Died event, then make it wait() then teleport them to the location. That should work.
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