#leaderboard
50 messages · Page 1 of 1 (latest)
ill send a vid gimme a sec
Ye no ur script is trash
u aint even seen it
i just dont know how to make it so it displays its peak on the leaderboard and not current
my script for it is fine
just not sure how to make it peak clicks not current
Do you have a datastore set up?
for the lb?
For the statistics
local dss = game:GetService("DataStoreService")
local ODS = dss:GetOrderedDataStore("Clicks")
local stat = script.Parent.Stats
local template = game:GetService("ServerStorage"):WaitForChild("Template")
local cd = 30 * 2
local function updateBoard()
local data =ODS:GetSortedAsync(false, 10)
local page = data:GetCurrentPage()
for i,v in ipairs(page) do
local name = game:GetService("Players"):GetNameFromUserIdAsync(v.key)
local clicks = v.value
local rank = i
local onBoard = false
for i,v in pairs(stat:GetChildren()) do
if v:IsA("UIListLayout") then continue end
if v.Name == name then
onBoard = true
end
end
if clicks and not onBoard then
local temp = template:Clone()
temp.Name = name
temp.Player.Text = name
temp.Rank.Text = rank
temp.Clicks.Text = clicks
temp.Parent = stat
end
end
end
while true do
for i,v in ipairs(game:GetService("Players"):GetPlayers()) do
ODS:SetAsync(v.UserId, v.leaderstats.Clicks.Value)
end
for i,v in pairs(stat:GetChildren()) do
if v:IsA("UIListLayout") then continue end
v:Destroy()
end
updateBoard()
task.wait(cd)
end
and got a ds for clicks
The leaderboard should be taking their data from a datamanger, not straight from the datastore
Welp time to read
Please don’t tell me your datamanager is split up over multiple access points
i just got a datastore for the clicks in SSS and this script in the leaderboard part in workspace
where my datastore for my clicks is has over 700 lines i cant be asked
What kind of fucking datamanger is over 700 lines?
😂
Please tell me you know how modules work
sorta
I can barely think off how a datamanager can be over 200 lines, how did you ever get to 700
just combind most of my scripts into one to keep it clean
Please tell me you at least structured it in some way
nah
Then how is it cleaned up?
Please fix this mentality
ill clean everything up later
if i do one thing im focused on thast
not 2-3 or more things at once
Hang on, why does your leaderboard need to save stuff?
But just wondering, does your main datamanager save a max clicks amount?
as I’m guessing “clicks” is the name for the current clicks
Well the leaderboard is receiving the datastore saving your current keys
At least by name I’m guessing that as your datastore naming is a tad weird
I recommend having your main datahandler save a max amount of clicks. Then just have a system in place to check if currentClicks > maxClicks. If so then maxClicks = currentClicks
Save it on a maxClick index/variable