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

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

Asked by 11 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

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

4 answers

Log in to vote
0
Answered by
Mowblow 117
11 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

So you can ban more than C4!

1local notallowed = {"C4", "MoreThingsYouWantToBan","TypeIt'sNameHere"}
2 
3game.Workspace.DecendantAdded:connect(function(child)
4if child.Name == notallowed and game.Players:GetPlayerFromCharacter(child) == nil then
5child:Destroy()
6end)

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

0
Descendant* OniiCh_n 410 — 11y
0
Yeah, missed that. Say, did I reference the table correctly in the "if" statement? Mowblow 117 — 11y
0
No, if you were to do it that way it would require m Archonious2 160 — 11y
0
a metatable* Archonious2 160 — 11y
Ad
Log in to vote
0
Answered by 11 years ago

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.

Log in to vote
0
Answered by 11 years ago

Or you could always do something like this.

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

--MightyWanderer

1
Remove() is deprecated, use Destroy() instead. Archonious2 160 — 11y
Log in to vote
0
Answered by 11 years ago

Thanks all.

Answer this question