Removing a player from leaderboard

Hey, how would I go about doing this?

I’ve tried this:

local DSS = game:GetService("DataStoreService")
local DS = DSS:GetDataStore("CurrencyStore")
local suc,err = pcall(function()
    DS:RemoveAsync(1204733303)
end)
if err then
    console.warn(err)
end
if success then
print("Removed")
end

It worked on myself, but trying to remove a player from a leaderboard gui isn’t working - I’m so lost (they cheated to get the points)

When I removed the points from myself, and joined the game - I was still on the leaderboard till it refreshed.


is there a way to spoof joining as the player?

2 Likes

Is the script in the leaderboard or in server script service?

2 Likes

i ran it via console, but the leaderboard model has its script inside the group

1 Like

console.warn() is a js syntax not lua.

2 Likes

script works in terms of removing the data, but on the leaderboard the player is still shown on the leaderboard

when tested on myself, when i removed my data i had to join the game, wait till the leaderboard refreshes and then i was removed from the global leaderboard

i want to help you but im on a phone.

2 Likes

If it’s a leaderboard you’re attempting to clean then you should be removing some data from an OrderedDataStore instead of a regular one, as leaderboards typically use the former.

how would i do that to clean the board

1 Like
local dss = game:GetService("DataStoreService")
local ods = dss:GetOrderedDataStore("OrderedDataStore") --replace with name of ordered datastore
ods:RemoveAsync(0) --replace with key

Same way as with any other DataStore record.

2 Likes

just tried this and it didnt remove the user

local dss = game:GetService(“DataStoreService”)
local ods = dss:GetOrderedDataStore(“CurrencyStore”) --replace with name of ordered datastore
ods:RemoveAsync(idoftheuser) --replace with key


1 Like

If you have multiple ordered data stores then you may need to clean them all, you’ll also need to make sure that whatever keys you’re attempting to wipe match the format of the keys which are used to store data.

https://developer.roblox.com/en-us/api-reference/function/GlobalDataStore/RemoveAsync

I only have one ordered datastore, which holds the time leaderstat. For the keys, I’m using a userid which holds it.

the leaderboard gui uses this:
local ods = game:GetService("DataStoreService"):GetOrderedDataStore("GlobalLeaderboard_🕙 Time")

1 Like

Add the leaderboard script so I can help.

ah ur (–) to tell me what it does, caused the removeasync to not be read, which is what caused the issue! finally the cheater is removed

1 Like