Hello! I’m making a Title system where if you have enough currency, it will update your title. However, the text is not updating. And there are no errors in the output.
Code (ServerScript → ServerScriptService):
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TitlesFolder = ReplicatedStorage:FindFirstChild("Titles")
local PurchaseCurrency = "Gems" -- What currency do you need to unlock ranks
local Players = game:GetService("Players")
local Titles = {"Basic", "Beginner", "Novice", "Pro", "Elite", "Champion", "Master", "Grandmaster", "Legend", "Immortal", "Slayer", "Developer", "Owner", "Patner"}
local TitlesRequirements = {0, 1000, 10000, 100000, 2000000, 10000000,50000000,100000000,1000000000,2000000000,5000000000,50000000000.500000000000}
local Nametag = script.Nametag
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(character)
repeat wait() until character.Head
local PlayerTag = Nametag:Clone()
PlayerTag.Parent = character.Head
PlayerTag.PlayerName.Text = Player.DisplayName
local Plr = Player:FindFirstChild(Player.Name)
local Currency = Player:FindFirstChild("leaderstats"):FindFirstChild(PurchaseCurrency)
while wait() do
Currency.Changed:Connect(function()
for i,v in pairs(TitlesRequirements) do
if v <= Currency.Value then
if character.Head:FindFirstChild("Nametag") then
PlayerTag:FindFirstChild("Title").Text = Titles[i]
break
end
end
end
end)
end
character.Humanoid.Died:Connect(function()
task.wait(4)
local ClonedTag = Nametag:Clone()
PlayerTag.Parent = character.Head
PlayerTag.PlayerName.Text = Player.DisplayName
for i,v in pairs(TitlesRequirements) do
if v <= Currency.Value then
if character.Head:FindFirstChild("Nametag") then
PlayerTag.Title.Text = Titles[i]
break
end
end
end
end)
end)
end)
Please help, Thanks!