Need help on a nametag script

Scripting Issue

Hello, I have recently made a working name tag script, and when I join the game it will say that I’m the Chairman and others will be called visitor. But I have a friend who should be called Vice Chairman. All I need for the game is to give him that tag and the rest should be fine, but does anyone know how I can add that to my script?

```lua
local rep = game:GetService("ReplicatedStorage")
local nametag = rep.NameTag

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        
        local head = char.Head
        local newtext = nametag:Clone()
        local uppertext = newtext.UpperText
        local lowertext = newtext.LowerText
        local humanoid = char.Humanoid
humanoid.DisplayDistanceType = "None"

        newtext.Parent = head
        newtext.Adornee = head
        uppertext.Text = player.Name
        
        if player.Name == "delvuur" then 
            lowertext.Text = "Chairman"
        end
    end)
end)

I have tried doing this and adding it to under the other if statement:

        if player.Name == "playername" then 
            lowertext.Text = "Vice Chairman"
         end

But that didn’t work and it was glitching the script. Does anyone know how to do this properly?

Replace

if player.Name == "delvuur" then 
            lowertext.Text = "Chairman"
        end

with

if player.Name == "delvuur" then 
    lowertext.Text = "Chairman"
elseif player.Name == "(your friends name)" then
    lowertext.Text = "Vice Chairman"
end

You might’ve had issues because your code had an extra space before "Vice Chairman" so that it became " Vice Chairman"

Do any errors appear in the output?

1 Like

How would this help in solving his problem? I’m a bit confused.

1 Like

It gives your friend the title of Vice Chairman on the billboard GUI.

The Vice Chairman space was a typing mistake, sorry. I’ll try to do the elsif andsee if that works, thank you.

Yes but even if there’s a space in the beginning, the text should still show.

1 Like

It’s worth a try, test out that code.

Thank you, this worked. I tried the same thing but with an “if” instead of “elsif”. The elseif made it work, thanks a lot!

lol i have the same problem just that my studio isn’t showing anything of my tags which i did anymore