For scripting with FE, you'll need to use Remote Events a lot of the time. If you aren't familiar with those, you can read more about them here: http://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events
I would suggest making it so when you click the button, it fires an event to a server script, and when the server script receives the remote event, it will change that player's team.
something like this:
Local Script ~
local button = script.Parent
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
button.MouseButton1Click:connect(function()
remoteEvent:FireServer()
end)
Server Script ~
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
remoteEvent.OnServerEvent:connect(function(player)
if player:IsInGroup(3761159) then
player.TeamColor = BrickColor.new("Bright red")
player:LoadCharacter()
end
end
2 comments
You will need to move the validation code onto a script with a remote event to allow the server to change the players team and load the character. The client should only ask the server to chaneg the team.
I did something like that, it changed the players team, but the player didn't spawn at the right spawn.