I suggest when the player is banned creating a table of the data
Here’s an example
function banuser(admin, plr)
local data = {}
data.AdminID = admin.UserId
data.PlayerID = plr.UserId
local success, errormessage = pcall(function()
banDataStore:SetAsync(data, plr.UserId)
end)
end
function RetrieveIds(playername)
local data = nil
local success, errormessage = pcall(function()
data = banDataStore:GetAsync(game:GetService("Players"):GetUserIdFromNameAsync(playername))
end)
if success then
return data
else
return false
end
end
The RetrieveIds function uses the players username as a parameter and returns the data table that was saved. Here’s an example of using it
local data = RetrieveIds("ExampleName")
local adminid = nil
local playerid = nil
if data ~= false then
adminid = data.AdminID
playerid = data.PlayerID
end