In my personal server C4's crash the game if used how can i ban them or get rid of them?
✓ ANSWER ACCEPTED
In my personal server how can i ban C4's?
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.
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.
Thanks all.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Descendant*
Yeah, missed that. Say, did I reference the table correctly in the "if" statement?
No, if you were to do it that way it would require m
a metatable*