Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does not kick player on rejoin? [Solved]

Asked by 3 years ago
Edited 3 years ago

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

0
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? Jay123abc2 241 — 3y
0
Oh i did not realise that HD admin had a built in one thanks serioussam26 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

HD Admin has a built-in command to ban the player only from the current server, you also might not have added the SPR.

Ad

Answer this question