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 |
|
|
|
| 14 Aug 2015 01:13 AM |
| I thought it was IsA("BasePart") |
|
|
| Report Abuse |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 14 Aug 2015 01:18 AM |
> v:IsA"Part"
v:IsA("Part") possibly? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 14 Aug 2015 01:24 AM |
preach it ^
Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 14 Aug 2015 01:30 AM |
my motto in bed
Bʀᴏ ᴅᴏ ʏᴏᴜ ᴇᴠᴇɴ Lᴜᴀ? |
|
|
| Report Abuse |
|
|