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

In my personal server how can i ban C4's?

In my personal server C4's crash the game if used how can i ban them or get rid of them?

4 answers

✓ Accepted answer

So you can ban more than C4!

local notallowed = {"C4", "MoreThingsYouWantToBan","TypeIt'sNameHere"}

game.Workspace.DecendantAdded:connect(function(child)
if child.Name == notallowed and game.Players:GetPlayerFromCharacter(child) == nil then
child:Destroy()
end)

I have not tested this script. It should work though.

4 comments

0

Descendant*

0

Yeah, missed that. Say, did I reference the table correctly in the "if" statement?

0

No, if you were to do it that way it would require m

0

a metatable*

Quick yet inefficient way to do this -Add everything to table that you made in the game, then check with if anything else was added and destroy it.

Or you could always do something like this.

game.Workspace.DescendentAdded:connect(function(item)
	if item.Name == "whatever C4 is called when it's inserted [check this] then
		item:Remove()
	end
end)

--MightyWanderer

1 comment

1

Remove() is deprecated, use Destroy() instead.

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