|
| 21 Mar 2013 10:02 AM |
I used this script before, I just added a couple things to it and now it won't work AT ALL
local not_allowed = { "Bus"; "TimebombDispenser"; "C4Explosive"; "UFO"; "TimebombDispenser"; "TrowelDispenser"; "Truck"; "SuperballDispenser"; "SwordDispenser"; "TeslaCoil"; "PoliceCar"; "RocketLauncherDispenser"; "SlingShotDispenser"; "FormulaOne"; "Jeep"; "NeutralSpawn" }
Workspace.ChildAdded:connect(function(x) for _, v in pairs(not_allowed) do if x.Name == v then x:Remove() end end end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Mar 2013 10:11 AM |
| Also, it didn't show any syntax errors. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2013 10:12 AM |
Here is the original one local not_allowed = { "LevelUpVendingMachine"; "TimebombDispenser"; "C4Explosive" }
Workspace.ChildAdded:connect(function(x) for _, v in pairs(not_allowed) do if x.Name == v then x:Remove() end end end) |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 21 Mar 2013 11:38 AM |
if x.Name == v.Name x:Destroy() |
|
|
| Report Abuse |
|
|
PlusJon
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 1522 |
|
|
| 21 Mar 2013 11:51 AM |
@Xnite
That won't make it not work.
@OP
Your problem is that in your table, you are using ';' when you need to use ','. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2013 12:03 PM |
@PlusJon
No, ';' works too. The problem is on your side.
@OP
function checkTools(x) for i,v in pairs(not_allowed) do if x.Name == v then x:Destroy() end end end game.Workspace.ChildAdded:connect(checkTools)
What I changed is to make this not an anonymous function, and changed :Remove() to :Destroy().
Report back the errors.
TB. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2013 12:05 PM |
Oh wait. Change if x.Name == v then to if v.Name:lower() == v:lower() then
It may not affect it, but it's better and you can be lazy when it comes to capitalization. :D
TB. |
|
|
| Report Abuse |
|
|