-
What do you want to achieve?
I want to fix a bug with my overhead tag script. -
What is the issue?
The issue is that I have an overhead team tag that displays the player team, when the player uses the team switch GUI it does switch their team but the overhead tag is not changed on their character but instead on the most recently joined player. -
What solutions have you tried so far?
I don’t really know what the problem is so I don’t know where to start looking for solutions.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local lesbianClickEvent = ReplicatedStorage:WaitForChild("LesbianEvent")
local transgenderClickEvent = ReplicatedStorage:WaitForChild("TransgenderEvent")
local gayClickEvent = ReplicatedStorage:WaitForChild("GayEvent")
local biClickEvent = ReplicatedStorage:WaitForChild("BisexualEvent")
local asClickEvent = ReplicatedStorage:WaitForChild("AsexualEvent")
local panClickEvent = ReplicatedStorage:WaitForChild("PanEvent")
local straightClickEvent = ReplicatedStorage:WaitForChild("StraightEvent")
local otherClickEvent = ReplicatedStorage:WaitForChild("OtherEvent")
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
teamOverheadClone = game.ReplicatedStorage.OverheadGui:Clone()
teamOverheadClone.Parent = Character.Head
teamInfo = teamOverheadClone.Team
local PlayerTeam = Player.Team.Name
teamInfo.Text = PlayerTeam
teamOverheadClone.Team.TextColor3 = Player.TeamColor.Color
end)
end)
local function lesbianTeam(Player)
teamInfo.Text = 'Lesbian'
teamOverheadClone.Team.TextColor3 = game.Teams.Lesbian.TeamColor.Color
Player.Team = game.Teams.Lesbian
end
local function transgenderTeam(Player)
teamInfo.Text = 'Transgender'
teamOverheadClone.Team.TextColor3 = game.Teams.Transgender.TeamColor.Color
Player.Team = game.Teams.Transgender
end
local function gayTeam(Player)
teamInfo.Text = 'Gay'
teamOverheadClone.Team.TextColor3 = game.Teams.Gay.TeamColor.Color
Player.Team = game.Teams.Gay
end
local function biTeam(Player)
teamInfo.Text = 'Bisexual'
teamOverheadClone.Team.TextColor3 = game.Teams.Bisexual.TeamColor.Color
Player.Team = game.Teams.Bisexual
end
local function aSexualTeam(Player)
teamInfo.Text = 'Asexual'
teamOverheadClone.Team.TextColor3 = game.Teams.Asexual.TeamColor.Color
Player.Team = game.Teams.Asexual
end
local function panSexualTeam(Player)
teamInfo.Text = 'Pansexual'
teamOverheadClone.Team.TextColor3 = game.Teams.Pansexual.TeamColor.Color
Player.Team = game.Teams.Pansexual
end
local function StraightTeam(Player)
teamInfo.Text = 'Straight'
teamOverheadClone.Team.TextColor3 = game.Teams.Straight.TeamColor.Color
Player.Team = game.Teams.Straight
end
local function otherTeam(Player)
teamInfo.Text = 'Other'
teamOverheadClone.Team.TextColor3 = game.Teams.Other.TeamColor.Color
Player.Team = game.Teams.Other
end
lesbianClickEvent.OnServerEvent:Connect(lesbianTeam)
transgenderClickEvent.OnServerEvent:Connect(transgenderTeam)
gayClickEvent.OnServerEvent:Connect(gayTeam)
biClickEvent.OnServerEvent:Connect(biTeam)
asClickEvent.OnServerEvent:Connect(aSexualTeam)
panClickEvent.OnServerEvent:Connect(panSexualTeam)
straightClickEvent.OnServerEvent:Connect(StraightTeam)
otherClickEvent.OnServerEvent:Connect(otherTeam)
If anyone could help me it would be appreciated 