Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Does not kick player on rejoin? [Solved]

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

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?

0

Oh i did not realise that HD admin had a built in one thanks

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.