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

Teleport to Team Spawn GUI?

So i made a respawn sort of button that doesn't kill you but instead just loads your character and what im trying to do is make it so it spawns you on your team spawn?

how would i do that i believe,

maybe by setting a value?

local Button = script.Parent
local Hold = nil

Button.MouseButton1Down:connect(function()
	if (Hold ~= nil) then return end
	Hold = true
wait(1)
Button.Text = "5"
wait(1)
Button.Text = "4"
wait(1)
Button.Text = "3"
wait(1)
Button.Text = "2"
wait(1)
Button.Text = "1"
wait(1)
Button.Text = "0"
wait(1)

	Button.Parent.Parent.Parent:LoadCharacter(true)

	Hold = nil
end)

2 comments

0

It should be spawning on a team spawn if the TeamColor is set and a SpawnLocation with such a TeamColor exists

0

The thing is i have a neutral spawn as well.. Should i change the team color to something that is actually considered a team or is there a way to code it so it doesnt spawn you there?

1 answer

You can set a Player's RespawnLocation to a certain SpawnLocation, to do this just

local plr = game.Players.LocalPlayer

plr.RespawnLocation = SpawnLocationInWorkspace

Hope I've helped!

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