So I am working on a border game (so original) and I am designing an overhead player GUI to display their group rank (whether their a citizen, a soldier, etc.) However, I want the players name to appear at the end of their rank. For example;
Soldier (Player Name)
I have searched for this particular issue, however, when I try solutions they are either A) Adding a number to a string, or B) They don’t work.
Sometimes, however, they will completely delete the overhead text, or will just return it to it’s default state (just saying label)
A list of solutions that I have tried:
"Citizen".. tostring(game.Players.LocalPlayer.Name)
Completely deleted the overhead text.
"Citizen".. game.Players.LocalPlayer.Name
Returned text to default state.
Here is my complete code:
local ServerStorage = game:GetService("ServerStorage")
local GUI = ServerStorage:WaitForChild("PlayerOverhead")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local ClonedGUI = GUI:Clone()
ClonedGUI.Parent = game.Workspace:WaitForChild(player.Name).Head
ClonedGUI.StudsOffset = Vector3.new(0, 2, 0)
if player:GetRankInGroup(12672676) == 255 then
ClonedGUI.TextLabel.Text = "Prime Minister"
ClonedGUI.TextLabel.TextColor3 = Color3.new(0.639216, 0.407843, 0.141176)
end
if player:GetRankInGroup(12672676) == 0 then
ClonedGUI.TextLabel.Text = "Guest"
end
if player:GetRankInGroup(12672676) == 1 then
ClonedGUI.TextLabel.Text = "Citizen"
ClonedGUI.TextLabel.TextColor3 = Color3.new(0.168627, 0.176471, 0.513725)
end
end)
end)
I am just asking if maybe I did the code wrong for the tostring, or if there is another method. Thanks!