Unbanning people who are not in the same game as you?

Hey developers. I am trying to make a unban command that can unban people who are not in the same server as you. You can unban then by using a ;unban [userid] command. The command and the arguments are running just fine, but whenever I try to unban a user that is not in the same game as me it fails to complete. The error I am consistently getting is that the player I am getting from game.Players:GetPlayerFromUserId is equal to nil. Here is the script I am using:

commands.unban = function(sender, arguments)
	if tonumber(arguments[1]) ~= nil then
		local toBeBanned = nil
		print(arguments[1])
		toBeBanned = game.Players:GetPlayerByUserId(tonumber(arguments[1]))
		
		local succccsess, errorrrrrmsg = pcall(function()print(toBeBanned.Name .. " will be unbanned.")end)
		if not succccsess then warn(errorrrrrmsg) end
		if toBeBanned ~= nil then
			local banner = 0
			local length = 0
			if arguments[2] ~= nil then
				length = arguments[2]
			end
			local data = adminDs:GetAsync("User-=-" .. toBeBanned.UserId) or {"Guest", {0, 0}}
			local toSave = {data[1], {length, banner}}
			save(toBeBanned, toSave)
		end
	end
end

Does anyone know how I can achieve unbanning people who are not in the same game as me?

Thank you all for your help!

How does this help me?

you probably would input the Name of the player, so you can just get their userId by
using that method.

local toBeBanned_UserId = game.Players:GetUserIdFromNameAsync("Iwillbebanned!")

Wrap it in a pcall just incase if the username given doesn’t exist or it fails getting the userId from the username.

and then, just set their datastore, they don’t have to be in-game for you to set it.

adminDs:SetAsync("User-=-" .. toBeBanned_UserId,"banned")