You could check if the player is on the correct team in the toggle button event:
-- if player is on right team
-- display overhead gui
If you are communicating between the server and client (ie. you have the teams stored on the server, or you want the overhead gui to be visible for ALL players in the server), then you will need to use remote functions and events.
Yes but let’s say there’s 3 people on team I don’t want all of them tp have the gui only let’s say chrisfs123 and I don’t want to have amprocop to have the gui toggle because the gui toggle would only be for a few people. I am a bit lost here.
A script on the server that gives players their overhead BillboardGuis on spawn by hooking onto the Players.PlayerAdded event followed by Player.CharacterAdded event per player. [if you don’t already have the overhead GUIs set up]
A RemoteEvent under ReplicatedStorage for authorized clients (players) to send “toggle my overhead GUI” requests to the server.
A script on the server (can be in the same aforementioned script) that listens to the RemoteEvent being fired by a client. When this happens, it checks that they are on the correct team, and if so, toggles the visibility of the overhead BillboardGui located somewhere under the player’s character.
A GUI on the client with a button and a localscript that checks if the player is on the correct/allowed team and makes the onscreen button visible/clickable accordingly. The localscript will also fire the RemoteEvent when the button is clicked.
local players = game:GetService("Players")
local teams = game:GetService("Teams")
if player.Name == "chrisfs123" then
--give yourself your own specific overhead gui
elseif player.Team == teams.Red then
--give red team players a specific overhead gui
elseif player.Team == teams.Blue then
--give blue team players a specific overhead gui
If you already have an overhead Gui system in place then all you need to do is something like in the above.