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

How do I make a player win if he is the only one in a team?

Basicly I am making like a fighting game. And I have 2 teams, lobby, ingame. When the intermission finishes, game starts and all players go to the map and all of them get switched from the lobby team to ingame team. The players will start fighting and the last who stands, win and earns +1 win and +5 coins.

1 answer

✓ Accepted answer
local team = game:GetService("Teams").ingame
team.PlayerRemoved:Connect(function()
	if #team:GetPlayers() == 1 then
		local plrWon = team:GetPlayers()[1]
		plrWon.leaderstats.wins.Value = plrWon.leaderstats.wins.Value + 1
		plrWon.leaderstats.coins.Value = plrWon.leaderstats.coins.Value + 5
	end
end)

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