Does anyone know how to ban players and make it save?

I have this command to ban someone that adds them to a table but that only saves for the server. I need help with saving the data across all the servers. Here is the command.

commands.ban = function(sender, arguments)
	local player = findPlayer(arguments[1], sender)
	
	local note = findValuesAfter(1, arguments)
	
	if player and not bannedPlayers[player.Name] and player.Name ~= "SpySethy" and not banned then
		player:Kick("you are banned: "..note)
		bannedPlayers[player.Name] = note
	elseif not player then
		print("player not found")
	end
end
3 Likes

I’d recommend you to use their UserId instead of their Name.

You can store banned players on DataStoreService or use other’s resources e.g.

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.