I’m experiencing issues with the textlabels not showing the correct information, I’ve attempted to re-script multiple times but I’m still experiencing the same issue.
It says LAPD when it should be:
Script:
local Player = game.Players.LocalPlayer
local TextLabel = script.Parent
local function updateText()
local Team = Player.Team
if Team then
if Team.Name == "Civilian" then
TextLabel.Text = "<b>OCCUPTION:</b> UNEMPLOYED"
else
TextLabel.Text = "<b>OCCUPATION:</b> "..Team.Name:upper()
end
end
end
updateText()
Player:GetPropertyChangedSignal("Team"):Connect(function()
updateText()
end)
No errors in the output, and I’ve also been experiencing issues when I change the font when it’s richtext it stays as the same font.
Check to make sure RichText in the Textlabel’s properties is set to true.
Without that you can’t use …
<b> </b>
from your output: LAPD from TextLabel.Text = "<b>OCCUPATION:</b> "..Team.Name:upper()
It is working right but skipping <b>OCCUPATION:</b>
pointing directly to this not being set to true.
ScreenGui with a TextLabel with a script in that. Label set to RichText true …
local label=script.Parent
local job="lapd"
label.Text="<b>OCCUPATION:</b> " .. job:upper()
label text: OCCUPATION: LAPD
Worked fine … just as it was formatted.
So try this …
local Player = game.Players.LocalPlayer
local TextLabel = script.Parent
local function updateText()
local Team = Player.Team
if Team then
if Team.Name == "Civilian" then
TextLabel.Text = "<b>OCCUPATION:</b> UNEMPLOYED"
else
TextLabel.Text = "<b>OCCUPATION:</b> " .. Team.Name:upper()
end
else
print("Player has no team.")
end
end
updateText()
Player:GetPropertyChangedSignal("Team"):Connect(function()
updateText()
if not TextLabel.RichText then
print("Warning: RichText is not enabled in TextLabel")
end
end)