Hey so I'm new to scripting, very new.
I'm trying to make it so the nametag GUI will change depending on individual users. So for default users (as seen below) it will just show their name, but for individuals like myself and Peter_Ashford it will show specialized nametags custom to their role. However this script is having problems as lets say Peter and I were in a game, I would be given his title and he would be given some random citizens title and the random citizen might have my title. If someone could help me figure out as to why this is happening (also it's not giving anyone below peter a title)
game.Players.PlayerAdded:connect(function(Player)
script.Parent.RankGui.Holder.PlayersName.Text = Player.Name
if Player.Name == "Na_n" then
script.Parent.RankGui.Holder.PlayersName.Text = "His Majesty".." "..Player.Name
end
if Player.Name == "Peter_Ashford" then
script.Parent.RankGui.Holder.PlayersName.Text = "His Royal Highness".." "..Player.Name.." ".."KM"
end
if Player.Name == "Alexander_Ashford" then
script.Parent.RankGui.Holder.PlayersName.Text = "His Royal Highness".." "..Player.Name
end
if Player.Name == "William_Houghton" then
script.Parent.RankGui.Holder.PlayersName.Text = "His Royal Highness".." "..Player.Name
end
if Player.Name == "KeirYandem" then
script.Parent.RankGUI.Holder.Playersname.Text = "The Rt. Hon.".." "..Player.Name.." ".."MR"
end
if Player.Name == "Griggi" then
script.Parent.RankGUI.Holder.Playersname.Text = "The Rt. Hon.".." "..Player.Name.." ".."MR"
end
if Player.Name == "TimothyJWolfe" then
script.Parent.RankGUI.Holder.Playersname.Text = "The Rt. Hon. Speaker".." "..Player.Name.." ".."MR"
end
if Player.Name == "TracticDev" then
script.Parent.RankGUI.Holder.Playersname.Text = "The Hon.".." "..Player.Name.." ".."MR"
end
if Player.Name == "sanderdebouwer" then
script.Parent.RankGUI.Holder.Playersname.Text = "The Hon.".." "..Player.Name.." ".."MR"
end
if Player.Name == "Benjamin_Paisley" then
script.Parent.RankGUI.Holder.Playersname.Text = "The Rt. Hon.".." "..Player.Name.." ".."MR"
end
end)

3 comments
I'll try that!
Update: https://gyazo.com/e60c90703e02c221f4f4451d39a555ee This keeps happening! As you can see I am not Peter_Ashford but for some reason I have his title!
I think I may know your issue. Don't use id as the same variable. Make it id2, id3, etc.