Experiencing Issues with TextLabels

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.

image
It says LAPD when it should be:
image

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.

If someone could help me I would be grateful.

1 Like

If anyone could help, this would be very helpful. I’m sure it’s just a roblox bug, because roblox has been mucking up lately.

Thank you.

It seems like it may be another script interfering with it, or something to do with the rich text.
Can you please try:

  • Disabling the script provided and see if the text still changes
  • Try removing the and see if it affects the outcome
1 Like

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. 

I put it into a completely new template, still doesn’t work. I’ve deleted the script, moved the script and re-scripted and nothing works.

It is set to true, yes. I’ve done it multiple times.

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)

Enable Rich Text Property of that text label