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 » Scripters
Home Search
 

Re: How could I do this?

Previous Thread :: Next Thread 
devTools is not online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
22 Dec 2014 05:38 PM
I need to make a script where when a player joins or dies, he spawns at 1 of 4 spawnlocations but he needs to be cframed to it because it's in a low ceiling. The issue is that I need to make it so that when 15 people would respawn, the script doesn't freak out and they need to be able to spawn in eachother instead of on top.
Help?
Report Abuse
devTools is not online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
22 Dec 2014 05:39 PM
math.randomseed(tick())

Spawns = {spawn1,spawn2, spawn3, spawn4}

game.Players.PlayerAdded:connect(function(plr)
repeat wait() until plr.Character ~= nil
plr.Character.Torso.CFrame = game.Workspace[Spawns[math.random(1,4)]].CFrame * Vector3.new(0,3,0)

plr.Character.Humanoid.Died:connect(function()
repeat wait() until plr.Character ~= nil
plr.Character.Torso.CFrame = game.Workspace[Spawns[math.random(1,4)]].CFrame * Vector3.new(0,3,0)
end)

end)

idk about the players inside eachother issue though
Report Abuse
devTools is not online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
22 Dec 2014 05:41 PM
Bump
Report Abuse
devTools is not online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
22 Dec 2014 05:45 PM
Bumppp
Report Abuse
devTools is not online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
22 Dec 2014 05:46 PM
Bbuummmmpppppp
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 Dec 2014 05:50 PM
local spawns = {
workspace.spawn1;
workspace.spawn2;
workspace.spawn3;
workspace.spawn4;
}

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character.Torso.CFrame = spawns[math.random(#spawns)].CFrame
end)
end)
Report Abuse
devTools is not online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
22 Dec 2014 05:52 PM
I did that but what if there are 15 people joining then they will have issues spawning in eachother
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 Dec 2014 05:54 PM
Well what do you expect? The only way around that is add more spawns or let them spawn above the low roof
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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