So, what im trying to do is ban the player even if they don’t join a new updated server. Is there any way I can do this by shutting down the server?
The servers are only 1 player servers, so it would be fine.
You can use DataStoreService | Roblox Creator Documentation. Once their data has been synced, you can kick them and when they rejoin check if they have a ban arg in the datastore. If they do, kick the player. This acts like a ban system.
Here’s a simple ban system:
local DataStoreService = game:GetService("DataStoreService")
local BanStore = DataStoreService:GetDataStore("BanData")
local BanMessage = "You have been banned"
function GetBanData(Player)
local BanData = BanStore:GetAsync(Player.UserId)
return BanData
end
function Ban(Player)
BanStore:SetAsync(Player.UserId, true)
Player:Kick(BanMessage)
end
function Unban(Player)
BanStore:SetAsync(Player.UserId, false)
end
game.Players.PlayerAdded:Connect(function(Player)
local BanData = GetBanData(Player)
if BanData == true then
Player:Kick(BanMessage)
end
end)
You can improve the ban system by adding a unique data key, Chatted event, admin permissions, and pcall wrap functions.
The ban system is typically the main element of an admin system, so you can make your ban system into an admin system.