Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change Team of a Player? [closed]

Asked by 6 years ago

This question already has an answer here:

How Do I Change The TeamColor Of A Player?

I want to be able to change a player's team on a gui button, any help? I think somebody else has same problem lol

0
If your game is FE, use a RemoteEvent to change the player's TeamColor upon pressing your gui button. Le_Teapots 913 — 6y

Marked as Duplicate by Avigant, GingeyLol, User#20388, Gey4Jesus69, Leamir, Le_Teapots, Vulkarin, and Programical

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

Change the Team property of the player upon the button click

local targetTeam = game:GetService("Teams")["Team name"]
button.MouseButton1Click:Connect(function()
    game:GetService("Players").LocalPlayer.Team = targetTeam
end)
1
Changing a player's team client-side will not replicate. Avigant 2374 — 6y
0
Yeah User#20388 0 — 6y
Ad