I am making a leaderboard, and there are two things that aren’t showing up correctly. Here is the script that makes the leaderboard:
local Players = game:GetService("Players")
local function leaderboardSetup(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local points = Instance.new("IntValue")
points.Name = "Points"
points.Value = 0
points.Parent = leaderstats
local snowballs = Instance.new("IntValue")
snowballs.Name = "Snowballs"
snowballs.Value = 0
snowballs.Parent = leaderstats
local hours = Instance.new("IntValue")
hours.Name = "Hours"
hours.Value = 0
snowballs.Parent = leaderstats
local rank = Instance.new("IntValue")
rank.Name = "Rank"
rank.Value = player:GetRoleInGroup(11635716)
rank.Parent = leaderstats
end
Players.PlayerAdded:Connect(leaderboardSetup)
Hours is supposed to show how many hours they’ve been on, and I’m still working on that, but it won’t even show up in the leaderboard at all. Rank is supposed to show their rank in my group, Antarctic Eats, but it just shows up as 0 in the leaderboard.
I fixed your script the two mistakes that you got are:
local hours = Instance.new("IntValue")
hours.Name = "Hours"
hours.Value = 0
snowballs.Parent = leaderstats -- in this line you wrote snowballs.Parent instead of hours.Parent
local rank = Instance.new("IntValue") -- Its a IntValue you need to use a StringValue because its a text
rank.Name = "Rank"
rank.Value = player:GetRoleInGroup(11635716)
rank.Parent = leaderstats