Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Spawn One Player in One spawn ?

Asked by 8 years ago
Player.Character.Humanoid.Died:connect(function()   

if(Player:FindFirstChild("PlayerGui"):FindFirstChild("Check")~=nil)then

game.Workspace.SpawnLocation.Enabled = false    
local FakeSpawn = game.Workspace.SpawnLocation:Clone()
FakeSpawn.Name = "FakeSpawn"..Player.Name
FakeSpawn.Size = Vector3.new(6,1,1)
FakeSpawn.Enabled = true
FakeSpawn.CanCollide = false
FakeSpawn.Anchored = true
FakeSpawn.Transparency = 1
FakeSpawn.Parent = game.Workspace
FakeSpawn.Position = Player.Character:FindFirstChild("Torso").Position
end

end)``

i am trying to spawn the player by name lets say player1 died we creat a FakeSpawnPlayer1 but if 2 players died only they BOTH spawn in random spawn between FakeSpawnPlayer1 and FakeSpawnPlayer2 .

how can i spawn each player in his own private spawn ? should i make a team color ? although i dont like it .

0
i can give you the code, but im busy so, make a table with the spawn names and when a player spawns on that specific spawn, remove it from the table GullibleChapV2 155 — 8y
0
how do i know which spawn he spawned on , also removing it from the table wont cause anything since the player spawn automatically to some random spawn unless theres some function that control the player's spawn or something temprezors 0 — 8y
0
Is this the full script? If so then where are you getting the Player from? UserOnly20Characters 890 — 8y
0
local script temprezors 0 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I don't understand what you mean by "but if 2 players died only they BOTH spawn in random spawn between FakeSpawnPlayer1 and FakeSpawnPlayer2", but the rest of your problem could be solved by keeping track of the player's last known location and teleporting them thee when they respawn. This would be in a normal script (not LocalScript) that listens for each player's CharacterAdded event. For each time this event fires except the first, teleport the player to the proper location. In all cases, start a loop that records the player's torso's Position until the player dies.

Ad

Answer this question