I was making a switch team script, but for some reason, it doesn’t really team you. It does team you, but doesn’t spawn you on the spawn team and team only tools.
I believe I do need a remote event, since I inserted the script in the local script.
local groupid = 12648144
local rank = 2
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if plr:IsInGroup(groupid) then
plr.TeamColor = BrickColor.new("Navy blue")
plr.Team = game.Teams["FBI Operatives"]
plr.Character:BreakJoints()
end
end)
Or you could use a server script and avoid remotes
in server script:
local groupid = 12648144
local rank = 2
game.Players.PlayerAdded:Connect(function(player)
if player:IsInGroup(groupid) then
player.TeamColor = BrickColor.new("Navy blue")
player.Team = game.Teams["FBI Operatives"]
player.Character:BreakJoints()
end
end)
Because when you wrote in a local script, you become the “FBI Operative” team only on your screen, to others you are not in that team, when you press play in roblox studio, theres a button that says “Current: Client” or something like that, when you press it it will switch to the server POV, and you can see how others see you
You could set the property of one of the teams to AutoAssignable (make it the default team) and the other team to not AutoAssignable, then have the script assign players to the team which is for group members only (the non-AutoAssignable team). Doing away with the gui entirely.