Is this the right script for finding the stringvalue in a player then getting that and if that value matches then their name tag will change?
if player.EquippedTitle.Value == "Beginner" then
if char.Head:FindFirstChild("BillboardGui") then
else
lowertext.Text = "Beginner" --This is that the text will say.
lowertext.TextColor3 = Color3.fromRGB(103, 24, 245) --This is what the color of the text will be.
end
end
``
--Variables
local rep = game:GetService("ReplicatedStorage")
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
newtext.Parent = head
newtext.Adornee = head
uppertext.Text = player.Name --Changes the text to the player's name.
if player.EquippedTitle.Value == "Beginner" then
if char.Head:FindFirstChild("BillboardGui") then
else
lowertext.Text = "Beginner" --This is that the text will say.
lowertext.TextColor3 = Color3.fromRGB(103, 24, 245) --This is what the color of the text will be.
end
end
end)
end)
The name of the BIllboardGui is NameTag. But if you wanted you could do if char.Head:FindFirstChildOfClass(“BillboardGui”) then, but if you added another billboard gui it wouldn’t work so I recommend if char.Head:FindFirstChild(“NameTag”) then
Make an EquippedTitle.Value changed function:
player.EquippedTitle.Changed:Connect(function()
if player.EquippedTitle.Value == “Beginner” then
if char.Head:FindFirstChild(“BillboardGui”) then
lowertext.Text = “Beginner” --This is that the text will say.
lowertext.TextColor3 = Color3.fromRGB(103, 24, 245) --This is what the color of the text will be.
– then put the end statements or whatever will close the script
You could try making a new script and add the nametag when the player joins:
–Variables
local rep = game:GetService(“ReplicatedStorage”)
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
newtext.Parent = head
newtext.Adornee = head
uppertext.Text = player.Name --Changes the text to the player's name.
player.EquippedTitle.Changed:Connect(function()
if char.Head:FindFirstChild("NameTag") then
lowertext.Text = player.EquippedTitle.Value --This is that the text will say.
lowertext.TextColor3 = Color3.fromRGB(103, 24, 245) --This is what the color of the text will be.
end
end
end)