Globel Ban System (GBS)

This server is owned by VexTheProtogen - zv800 / z3ck200

This is a server to manage globally banned players across EEI games and certain affiliated connected games
The BannedUsers.txt file contains a list of banned players across EEI games from multiple accounts. These players have violated not only EEI rules but also global rules including Roblox's own Terms of Service such as exploiting (hacking).

🔗 EEI Discord: Join Server
🔗 EEI Roblox Group: Visit Group
🔗 Unknown Technologies Discord: Join Server
🔗 Unknown Technologies Roblox Community: Visit Community

You can implement this system by downloading the recommended server API or you can just use our server API URL: https://eei-api-533b.netlify.app/ This database is constantly being updated by Roblox TOS violators and contains exploiters, asset stealers, and creeps.

If you would like to report someone to us please contact Unknown Technologies at: rb.unknown.technologies@gmail.com or contact EEI at: extremeenergyincorporated@gmail.com (the EEI email may be inactive for long periods of time)


--[[ 
Scripted by VexTheProtogen:
Roblox: z3ck200 (4071774573) aka ZV800

This GBS is a secure method for handling a global ban system. Even if we were to be compromised for any reason, it would be completely 
impossible for attackers to affect the game's integrity. If, for some reason, the GBS server goes down, a data storage backup will 
automatically take over.

Yes, we are aware that BannedUsers.txt has a typo in it. Unfortunately, we are unable to fix it, as doing so would break existing GBS scripts. 


---UPDATE LOG---
----------------------------------------------------
UPDATE 6/2/2025 5:35 PM (CT)

I've noticed that the data storage backup system was not functioning properly—this has now been fixed. We've also added more redundancy in
case the primary data storage fails for any reason. 

Additionally, we've implemented some bug fixes and cleaned up the code. 

----------------------------------------------------

----------------------------------------------------
UPDATE 6/2/2025 6:30 PM (CT)
Added a few more settings for convenience
----------------------------------------------------

----------------------------------------------------
UPDATE 6/3/2025 4:24 AM (CT)
Fixed a bug where the code was sending a new API request for every user in the server. This should help prevent the server from being 
overwhelmed and avoid hitting data storage API rate limits.
----------------------------------------------------
]]


--SETTINGS:
--=========================================================================================================================

local SerevrAddress = "https://eei-api-533b.netlify.app/api/BanedUsers.txt" --This is the server URL that it downloads the banned users from

local DataStoreKey = "GlobelBanSystem_1" -- This is the DataStore key name

local DataStore = "GBSBackup" -- This is the data storage name
local DoPrint = true --Prints usefull information to the console. Recomended to keep enabled.
local BanMessage = "Banned | " 

local ShutdownServerIfGBSFailure = true --If GBS is unable to function properly, the server will shutdown.
local ShutdownKickMsg = "The GBS failed to initialize please try and rejoin" 

local ExternalBanSystem = nil --*OPTIONAL* If you would like to disconnect a banned player in a way other than the default kick—for example, sending
--them to a separate place with a ban screen—provide the path to a BindableEvent you would like to fire instead of kicking the player.

--=========================================================================================================================



--===================================================================================================================
--DO NOT MODIFY PAST THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING
--===================================================================================================================


local DataStoreService = game:GetService("DataStoreService")
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local GBS_DataS = DataStoreService:GetDataStore(DataStore)


local BannedUsersBackupString = nil

local print = function(...)
	if DoPrint then
		print("## GBS MAIN SCRIPT | " .. ...)
	end
end



function csvToTable(BannedUsers)
	local out = {}
	for entry in string.gmatch(BannedUsers, "[^,]+") do
		table.insert(out, entry)
	end
	return out
end

GetUserIdFormList = function(String)
	local str = String
	local userID = str:match("USERID: (%d+)")
	return userID
end

GetBanedReson = function(String)
	local str = String
	local message = str:match("MESSAGE: (.+)")
	return message
end



local BannedUsers = nil

local CheckUser = function(Player:Player)
	pcall(function()
		for _,v in pairs(csvToTable(BannedUsers)) do
			if Player.UserId == tonumber(GetUserIdFormList(v)) then
				if ExternalBanSystem then
					local s,e = pcall(function()
						ExternalBanSystem:Fire(BanMessage .. GetBanedReson(v),Player)
					end)

					if not s then
						Player:Kick(BanMessage .. GetBanedReson(v))
					end
				else
					Player:Kick(BanMessage .. GetBanedReson(v))
				end
			end
		end
	end)
end

local UpdateGBS = function()
	local s,e = pcall(function()
		BannedUsers = HttpService:GetAsync(SerevrAddress)
	end)

	if not s then
		print("HTTP FAIL: Relying on GBS backup ERROR: " .. e)
		local s,e = pcall(function()
			BannedUsers = GBS_DataS:GetAsync(DataStoreKey)
		end)

		if not s and BannedUsersBackupString ~= nil then
			print("Data storage failure: Relying on Secondary GBS backup")
			BannedUsers = BannedUsersBackupString
		end
	end

	if BannedUsers ~= nil then

		BannedUsersBackupString = BannedUsers

		s,e = pcall(function()
			GBS_DataS:SetAsync(DataStoreKey,BannedUsers)
		end)
		if not s then print("GBS Data SetAsync FAIL: " .. e) end
	else
		if ShutdownServerIfGBSFailure then
			for _,Player in pairs(Players:GetPlayers()) do
				pcall(function() Player:Kick(ShutdownKickMsg) end)
			end

			Players.PlayerAdded:Connect(function(Player)
				pcall(function() Player:Kick(ShutdownKickMsg) end)
			end)
		else
			warn("GBS complete failure!!! # COULD NOT RESOLVE BANNED USERS LIST BY ANY MEANS #")
		end
	end

end


task.spawn(function()
	while true do
		UpdateGBS()
		for i,v in pairs(Players:GetPlayers()) do
			CheckUser(v)
		end
		task.wait(10)
	end
end)

Players.PlayerAdded:Connect(CheckUser)
    

Copyright 2025 zv800

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.