generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Script not working for some odd reason?

Previous Thread :: Next Thread 
swimeralex is not online. swimeralex
Joined: 07 Mar 2010
Total Posts: 426
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
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
21 Mar 2013 10:08 AM
output?
Report Abuse
swimeralex is not online. swimeralex
Joined: 07 Mar 2010
Total Posts: 426
21 Mar 2013 10:11 AM
Also, it didn't show any syntax errors.
Report Abuse
swimeralex is not online. swimeralex
Joined: 07 Mar 2010
Total Posts: 426
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 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
21 Mar 2013 11:38 AM
if x.Name == v.Name
x:Destroy()
Report Abuse
PlusJon is not online. 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
Terrabytes is not online. Terrabytes
Joined: 13 Jan 2012
Total Posts: 5839
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
Terrabytes is not online. Terrabytes
Joined: 13 Jan 2012
Total Posts: 5839
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image