i have NO clue how to put this into a well-formed question title i'm so sorry
okay, so i'm trying to do overhead gui ranks for a sim game i'm doing (no it is NOT about stick eating at all), and i've been trying to get it to sync with a certain leaderstats value.
the code looks like this:
script.Parent = game.ServerScriptService
local billboard = script.BillboardGui
function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end
counter = 0
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if player.leaderstats.Cronches.Value >= 0 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(255,255,255)
newgui.TextLabel.Text = "New Croncher"
elseif player.leaderstats.Cronches.Value >= 10000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(136,93,46)
newgui.TextLabel.Text = "Bronze Croncher"
elseif player.leaderstats.Cronches.Value >= 100000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(211,211,211)
newgui.TextLabel.Text = "Silver Croncher"
elseif player.leaderstats.Cronches.Value >= 1000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(255,255,0)
newgui.TextLabel.Text = "Gold Croncher"
elseif player.leaderstats.Cronches.Value >= 10000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(0,221,255)
newgui.TextLabel.Text = "Diamond Croncher"
elseif player.leaderstats.Cronches.Value >= 100000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(147,147,147)
newgui.TextLabel.Text = "Platinum Croncher"
elseif player.leaderstats.Cronches.Value >= 1000000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(255,170,0)
newgui.TextLabel.Text = "Expert Croncher"
elseif player.leaderstats.Cronches.Value >= 10000000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(255,109,0)
newgui.TextLabel.Text = "Croncher Extraordinaire"
elseif player.leaderstats.Cronches.Value >= 100000000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
newgui.TextLabel.TextColor3 = Color3.fromRGB(255,0,0)
newgui.TextLabel.Text = "Superior Croncher"
elseif player.leaderstats.Cronches.Value >= 1000000000000 then
local newgui = billboard:Clone()
newgui.Parent = char.Head
while wait(0.1)do
newgui.TextLabel.TextColor3 = Color3.fromHSV(zigzag(counter),1,1)
counter = counter + 0.01
end
newgui.TextLabel.Text = "The Absolute Croncher"
end
end)
end)
Cronches is the leaderstat value i'm wanting to track, the zigzag function atop is just for being a part of the color of the final title to be color-changing
it sorta works, the issue being it doesn't go past the 1st title of new croncher, and i'm wondering what i can do to get past my issue of the text not changing according to the leaderstats value of a player changing
maybe i'm missing a part where i should add LocalPlayer somewhere into this, i am not sure
if anyone can guide me as to a way to fix this and/or guide me to a way as to make a more efficient script instead of this that'd be kind. thank you. i hope i explained enough and i hope this doesn't sound like a request

2 comments
are you getting any errors in the output or is there none?
i'm not getting any errors in the output for this