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

Team Change When Reseting Character?

Hey! I'm making a game, and let's say I change my team to Red(Or Blue lol). When I reset, I want it so that it'll change to a Neutral Team. Anyway possible to do that? Thanks! Idk what needs to be fixed, so please help (:

Simpler Version:

  1. Change Team Red
  2. Reset from Menu
  3. Team Changes to Gray (For Neutral)
function onTouch(hit)
	local hum = hit.Parent:findFirstChild("Humanoid")
	if hum ~= nil and hum.Health > 0 then
		local player = game.Players:findFirstChild(hit.Parent.Name)
		if player ~= nil then
			player.TeamColor = script.Parent.TeamColor
		end
	end
end

script.Parent.Touched:connect(onTouch)

-LukeGabrieI

1 answer

✓ Accepted answer
game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		char.Humanoid.Died:connect(function()
			plr.Team = neutralteam
		end)
	end)
end)

2 comments

0

so what do I call the neutralteam? I'm trying to put like workspace.Teams.Bystanders, but it won't change teams. Please help! (:

0

Nvm got it to work haha (:

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