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

Help with ban script?

local banned = {"xMegs", "rymikula", "SingleSided"}

msg = game.Workspace.Message
Text = msg.Text

if banned then -- I GOT STUCK HERE it's like. If one of the banned people joins, they get kicked.
	banned:Kick()
	msg.Text = "Someone has been kicked"
	wait(5)
end

On the if statement, I got stuck, can you help?

I think is if banned == game.Workspace then

I'm not that sure.

2 answers

✓ Accepted answer
local banland={"ultrabug", "CheeseMan"}
game.Players.PlayerAdded:connect(function(plr) --Gets when a player joins.
	for i,v in pairs(banland) do --Cycles through the table making every value into one in a way.
		if plr.Name==v then --Checks the player's name in case it is a banned name.
			message=Instance.new("Message") --Creates a new message.
			message.Parent=plr.PlayerGui --Puts the message into the player's PlayerGui so only they can see it.
			message.Text="You are banned, gbye :)"
			wait(3)
			plr:Kick() --Kick the player.
		end
	end
end)

Ugh, Ik how it works, I had the script itself for a ban script or kicked script but that was on my old computer so I don't have it. Later I can get it for you.

1 comment

0

Ok thanks

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