I’m trying to create a script that creates a leaderboard that lists everybody’s rank and gives them an above-head nametag, with the same rank. However, for some reason, the script doesn’t work. Upon testing in-studio, the output shows no errors. The script itself also shows no errors.
I also added some print
functions at several points within the script, and only 3 of the 6 have worked. In-studio, there were zero changes or errors prior to adding the prints.
Code
local billboard = script.BillboardGui
print("Begin")
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
print("Mid1")
local RankAbrv = "Rank Loading"
local GR = Player:GetRankInGroup(5290077)
if GR == 15 then RankAbrv = "Pending"
elseif GR == 45 then RankAbrv = "SUSPICOUS"
elseif GR == 75 then RankAbrv = "Polar"
elseif GR == 90 then RankAbrv = "Ardent"
elseif GR == 105 then RankAbrv = "Team"
elseif GR == 120 then RankAbrv = "Kinetic"
elseif GR == 135 then RankAbrv = "Advancement"
elseif GR == 150 then RankAbrv = "Order"
elseif GR == 165 then RankAbrv = "Developer"
elseif GR == 180 then RankAbrv = "Ally"
elseif GR == 195 then RankAbrv = "International"
elseif GR == 210 then RankAbrv = "Blaze"
elseif GR == 225 then RankAbrv = "Morning"
elseif GR == 250 then RankAbrv = "Council"
elseif GR == 252 then RankAbrv = "Commander"
elseif GR == 255 then RankAbrv = "older"
elseif GR == 0 then RankAbrv = "Guest"
elseif Player.name == "AFuturisticFox" then RankAbrv = "Ally"
elseif Player.name == "MainDragon1971" then RankAbrv = "Ally"
--------------------------------------------------------------------------------------------------------------------------------------
print("Mid2")
local Stats = Instance.new("IntValue")
Stats.Name = "leaderstats"
local Rank = Instance.new("StringValue")
Rank.Name = "Rank"
Rank.Value = RankAbrv
Rank.Parent = Stats
--------------------------------------------------------------------------------------------------------------------------------------
print("Mid3")
local CloneGUI = billboard:Clone()
local Usrnm = Player.name
CloneGUI.Parent = char.Head
CloneGUI.Rank.TextTransparency = 0
CloneGUI.Rank.Text = "["..RankAbrv.."]"
CloneGUI.Username.TextTransparency = 0
CloneGUI.Username.Text = Usrnm
print("Mid4")
end
end)
end)
print("End")
Small Fixes
@Minstrix mentioned adding an end to my elseif
s. While this did allow all of my print
functions to work, and assign an above-head nametag, it still hasn’t set the leaderboard, oddly enough.
I’ve been struggling to solve this for a while, thanks!