Unknown User in OrderedDataStore

While testing my game, I noticed that a user called chameleongirl, whom I have no idea about is also in the leaderboard. Just to confirm, is there a vanruability in my script that causes the error?

This is my script that manages the leaderboard:

local DataStoreService = game:GetService("DataStoreService")
local OrderedPlayerScore = DataStoreService:GetOrderedDataStore("OrderedPlayerScore")
local PlayerDataFol = game.ReplicatedStorage.PlayerData


function FilterODSK(key)
	return string.sub(key,2,#key)
end


function SyncLeaderB()
	local Data = OrderedPlayerScore:GetSortedAsync(false,10,0,math.huge)
	local CurPage = Data:GetCurrentPage()
	for rank, inf in pairs(CurPage) do
		local Username = game.Players:GetNameFromUserIdAsync(FilterODSK(inf.key))
		local Score = inf.value
		local isOnLB = false
		for i, v in pairs(game.Workspace.ScoreLB.LBgui.CoreFrame.BaseFrame:GetChildren()) do
			if v.NameF.Text == Username then
				isOnLB = true
				break
			end
		end
		if isOnLB == false and Score then
			local NFrame = game.ServerStorage.Storage.GUI.PointFrame:Clone()
			NFrame.Parent = game.Workspace.ScoreLB.LBgui.CoreFrame.BaseFrame
			NFrame.Position = UDim2.fromScale(0,(0.9*(rank/10)))
			NFrame.CountF.Text = Score
			NFrame.NameF.Text = Username
		elseif isOnLB == false and not Score then
			warn("Score is missing")
		end
	end
end


function SaveScore()
	local suc, err = pcall(function()
		for _, v in pairs(PlayerDataFol:GetChildren()) do
			local Score = v["Score"].Value
			OrderedPlayerScore:SetAsync("s"..v.Name,Score)
		end
	end)
	if suc then game.Workspace.ScoreLB.LBgui.CoreFrame.BaseFrame:ClearAllChildren() end
end

while true do 
	SaveScore()
	local suc, err = pcall(SyncLeaderB)
	if not suc then warn(err) end
	task.wait(35)
	
end
```.0
1 Like

And it is not a one-time error, I restarted the game many times and that user was still on there.
Doing some extra research, the user seems like an ordinary roblox user. Here is their profile:

1 Like

That is the wrong player, the name doesn’t mach and so does the userid.

2 Likes

if the name doesn’t match, then what is causing that?

1 Like

What is the filterOSDK function for?

Edit: ignore my post above where i stated abt the userID, i realized that the numbers were score count not userID XD.

2 Likes

just turns the key ("s<userId.") into "userId to make key overflow less likely

1 Like

Are you sure someone didn’t just join your game?

2 Likes

I am in studio and that account hasn’t been active for 4 years

1 Like

Can you use a data store editing plugin and check the ordered datastore?

2 Likes

I did some reasearch, and ur filterOSDK function is causing it. It somehow is deleting the first 2 numbers from ur userID, whichthen converts it into chameleongirls userID.

Your UserID = 407478547
Chameleon’s id = 7478547

1 Like

what it does is just remove the first character of the modified ID, which is the s,

It does that but then reruns again to remove the first 2 numbers on ur ID.

1 Like

looking at that again, it seems like a fair arguement,

I modified my code to resolve that issue:

function FilterODSK(key)
	if string.sub(key,1,1) == "s" then
		return string.sub(key,2,#key)
	else
		return key
	end
end

In a previous topic u made, i noticed that in the data autosaver, u inputted the userID without any <s, mite tht b the problem?

1 Like

no, That was my old data saver, it no longer saves for the ordered data store,