Hello,
I'm assuming you already have a SpawnLocation for the team you are trying to set in this script. You can do this in a simpler way, after you set the player's TeamColor, you can just use :LoadCharacter(). LoadCharacter is different than setting a player's health to 0 because LoadCharacter immediately respawns the player and doesn't make them wait for the 5 second delay.
PS: You can also set a player's TeamColor by using, player.TeamColor = game.Teams["Team Name"].TeamColor.
Example of new code:
local player = game.Players.LocalPlayer
local Blue_Team = game.Teams.Blue_Team
local Button = game.StarterGui.Team_GUI.Frame.Blue_Team
local gui = script.Parent.Parent
local Blue_Spawn = game.Workspace.Blue_Base.Blue_Spawn
local function teleport()
end
local function onClicked(mouse)
player.TeamColor = BrickColor.new("1010")
player:LoadCharacter()
gui:Remove()
end
script.Parent.MouseButton1Down:connect(onClicked)
**If this worked for you please accept my answer. If you have any further questions, don't hesitate to ask.
**