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 » Scripters
Home Search
 

Re: Why won't this work?

Previous Thread :: Next Thread 
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
14 Aug 2015 01:11 AM
for i, v in pairs(Workspace:GetChildren()) do
if v:IsA"Part" and v.Name ~= "Terrain" and v.Name ~= "Camera" then
if v.Material =="Plastic" then
print("ayy")
v:Destroy()
end
end
end

Works when I do it with brickcolors bust not materials. What am I doing wrong?

Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ?
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
14 Aug 2015 01:13 AM
I thought it was IsA("BasePart")
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
14 Aug 2015 01:13 AM
Enum.Material.Plastic

?
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
14 Aug 2015 01:13 AM
A BasePart and a Part are two different things.

http://wiki.roblox.com/index.php?title=API:Class/BasePart
http://wiki.roblox.com/index.php?title=API:Class/Part
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
14 Aug 2015 01:13 AM
Oh, thanks. I never work with material so I had no clue.

Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ?
Report Abuse
DyeTyeVideos is not online. DyeTyeVideos
Joined: 07 Sep 2013
Total Posts: 77
14 Aug 2015 01:18 AM
> v:IsA"Part"

v:IsA("Part") possibly?
Report Abuse
Iterum is not online. Iterum
Joined: 30 Jan 2009
Total Posts: 1982
14 Aug 2015 01:20 AM
You're going through that emo-teenager phase where you remove all possible parenthesis because "efficiency". Nah, keep them.


-ChiefDelta/Discommodate/iC7G/Vulnerite + 100 other accounts
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
14 Aug 2015 01:23 AM
nah, I usually keep parenthesis but its 2 am and im just fooling around with the command bar and some plugins

Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ?
Report Abuse
Iterum is not online. Iterum
Joined: 30 Jan 2009
Total Posts: 1982
14 Aug 2015 01:24 AM
Ah, the command bar, where you write a 20 line script and have to debug it because you miss an end somewhere.


-ChiefDelta/Discommodate/iC7G/Vulnerite + 100 other accounts
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
14 Aug 2015 01:24 AM
preach it ^

Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Aug 2015 01:25 AM
Lua has function string and table syntax.

print("hi")
print"hi"
print{}
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
14 Aug 2015 01:26 AM
for i, v in next, workspace:GetChildren() do
if v:IsA("BasePart") then
if v.Material == Enum.Material.Plastic then
v:Destroy()
end
end
end


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
14 Aug 2015 01:26 AM
thanks timeticks, but you're a bit late to the party

Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
14 Aug 2015 01:28 AM
Better late than never.


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
14 Aug 2015 01:30 AM
my motto in bed

Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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