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
|
  |
| 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
|
  |
| Joined: 06 Sep 2014 |
| Total Posts: 7950 |
|
| |
|
devTools
|
  |
| Joined: 06 Sep 2014 |
| Total Posts: 7950 |
|
| |
|
devTools
|
  |
| Joined: 06 Sep 2014 |
| Total Posts: 7950 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|