You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want a player to join the lobby team upon joining the game or if they die.
What is the issue? Include screenshots / videos if possible!
i have no idea how script it
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I searched it up in the forum but the solutions they provided only changes the players team upon death once. So if their team changes to the playing team and they die again they just stay in the playing team.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local LOBBY_TEAM = Game.Teams:WaitForChild("Team Name")
Game.Players.PlayerAdded:Connect(function(Player)
Player.Team = LOBBY_TEAM
end)
And try write these on StarterCharacterScripts (Server Script)
local LOBBY_TEAM = Game.Teams:WaitForChild("Team Name")
local MyPlayer = Game.Player:GetPlayerFromCharacter(script.Parent)
local Character = MyPlayer.Character
local Humanoid = Character:FindFirstChild("Humanoid")
Humanoid.Died:Connect(function()
MyPlayer.Team = LOBBY_TEAM
end)
Not everything I wrote were Accurate so try test it out and tell me later.