Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How To Spawn One Player in One spawn ?

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 .

4 comments

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

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

0

Is this the full script? If so then where are you getting the Player from?

0

local script

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.