I am making a tag like game with the tagger having a tool but i want it when the tag tool comes in contact with a player that is on the other team. that player changes teams how do i do that?
✓ ANSWER ACCEPTED
Tool that changes the team of a player?
1 answer
✓ Accepted answer
Just setup the TeamName variable to match the Team you want to change the tagged person to.
--Assuming the script is directly inside the tool:
local Handle = script.Parent:WaitForChild("Handle")
local TeamName = "" -- Put name of the team between the quotes
local NewTeam = game.Teams:FindFirstChild(TeamName)
Handle.Touched:Connect(function(partHit)
if partHit.Parent:FindFirstChild("Humanoid") and partHit.Parent ~= script.Parent.Parent then
local Tagged = partHit.Parent
game.Players:GetPlayerFromCharacter(Tagged).TeamColor = NewTeam.TeamColor
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you very much this worked perfectly :)