i have made a server ban custom command for HD admin
Module script
-- << RETRIEVE FRAMEWORK >>`` local main = _G.HDAdminMain local settings = main.settings local Players = game:GetService("Players") -- << COMMANDS >> local module = { ----------------------------------- { Name = "serverban"; Aliases = {'sban'}; Prefixes = {settings.Prefix}; Rank = 4; RankLock = false; Loopable = false; Tags = {}; Description = "Bans the player from 1 server"; Contributors = {}; -- Args = {'player'}; Function = function(speaker, args) Name = args[1] wait(1) table.insert(_G.Sban, Name) Name:kick('You have been banned from this server') end; UnFunction = function(speaker, args) end; -- }; }; return module
and normal script
_G.Sban = {} local Players = game:GetService("Players") game.Players.PlayerAdded:Connect(function(Player) if table.find(_G.Sban, Player.Name) then print('this part works') wait(1) Player:kick('You are banned from this server') end end)
all scripts are in serverscriptservice the player gets kicked when you run the command but when you rejoin the game nothing happens no errors no ban message
Edit: this is being tested in a live roblox server
HD Admin has a built-in command to ban the player only from the current server, you also might not have added the SPR.