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

2 comments
Why dont u just try the server ban command wich comes with HD admin, type ;ban then u can choose all servers / that one server?
Oh i did not realise that HD admin had a built in one thanks