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

Is there a way to set a spawn point?

Asked by 9 years ago

What I'm saying that is there way to set a players spawn point were the are standing by clicking a gui button? If there is, please tell me and give me a example script please. Thanks!

0
This is not a request site, please include any coding or research you have already done. Perci1 4988 — 9y
0
-_- PyccknnXakep 1225 — 9y

2 answers

Log in to vote
0
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

You can't directly set a player's spawn location. By default, the player will spawn at a randomly chosen SpawnLocation as long as it matches his TeamColor.

If you want to move the character as soon as he spawns, you can connect to the CharacterAdded event and teleport the player to a position.

function onPlayerAdded(player)
   player.CharacterAdded:connect(function(character)
      wait()
      character:WaitForChild("Torso")
      character:MoveTo(Vector3.new(0, 1000, 0))
      print("Teleported to position")
   end)
end

game.Players.PlayerAdded:connect(onPlayerAdded)

for _,player in pairs(game.Players:GetPlayers()) do
   onPlayerAdded(player)
end
Ad
Log in to vote
-1
Answered by 9 years ago

My best advice is to make a spawn point with transparency infinitely.

Go to properities and change it to 1 or higher for more transparency.

Answer this question