-- Author: Reccur AKA Reactive Metal local dataStoreService = game:GetService("DataStoreService") local dataStore = dataStoreService:GetDataStore("Stuff") dataStore:RemoveAsync("1693468811" .. "-Banned") local groupId = 11571768 -- put your group id here if you have one local minRank = 254 -- minimum rank in your group to use the ban command local whitelisted = {"reccur", "player2"} --[[ additionally, you, can whitelist players that can use the ban command by adding their names in this table, (preferrable if you ont have a group) ]] game.Players.PlayerAdded:Connect(function(plr) local IsBanned = dataStore:GetAsync(plr.UserId.. "-Banned") or false if IsBanned then plr:Kick("You have been banned") end local command = "/ban ([%w_]+)" plr.Chatted:Connect(function(msg) if plr:GetRankInGroup(groupId) >= minRank or table.find(whitelisted, plr.Name) then local bannedPlrName = msg:match(command) for i, p in pairs(game.Players:GetChildren()) do if string.lower(p.Name) == string.lower(bannedPlrName) or string.lower(p.DisplayName) == string.lower(bannedPlrName) then local suc, err = pcall(function() dataStore:SetAsync(p.UserId.."-Banned", true) p:Kick("You have been banned!") end) if err then warn(err) end break end end end end) end)