NameTag script glitch

I have a script for custom name tags, but the script is just keeping me as a Guest. how do I fix?

--Variables
local rep = game:GetService("ReplicatedStorage") --You can change this to ServerStorage for more security.
local nametag = rep.NameTag 

--Functions
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		--Varibles
		local head = char.Head
		local newtext = nametag:Clone() --Cloning the text.
		local uppertext = newtext.UpperText
		local lowertext = newtext.LowerText
		local humanoid = char.Humanoid
		
		humanoid.DisplayDistanceType = "None"
		
		--Main Text
		newtext.Parent = head
		newtext.Adornee = head
		uppertext.Text = player.Name --Changes the text to the player's name.
		
		--"If" Statements
		--You can add as many of these as you wish, just change it to the player's name.
		if player.Name == "joshuaThe5th" then
			lowertext.Text = "Owner" --This is that the text will say.
			lowertext.TextColor3 = Color3.fromRGB(255, 51, 0) --This is what the color of the text will be.
		end
	end)
end)

Use a print debug. Is it getting inside this if statement? If it’s not, then there is your issue.

if player.Name == "joshuaThe5th" then
            print("1")
			lowertext.Text = "Owner" --This is that the text will say.
			lowertext.TextColor3 = Color3.fromRGB(255, 51, 0) --This is what the color of the text will be.
end```
1 Like