lewisw60
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 193 |
|
|
| 03 May 2014 01:41 PM |
| How would I check whether or not say, an object was a script, a part, or a tool? |
|
|
| Report Abuse |
|
|
samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
|
| 03 May 2014 01:56 PM |
http://wiki.roblox.com/index.php/API:Instance/ClassName
if child.className == "Part" then -- will find Parts, but NOT TrussParts, WedgeParts, and other part-like objects end
if child.className == "Script" then
end
if child.className == "Tool" then
end
|
|
|
| Report Abuse |
|
|
lewisw60
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 193 |
|
| |
|
|
| 03 May 2014 02:04 PM |
Or you could just do:
if instance:IsA("Script") or instance:IsA("Part") or instance:IsA("Tool") then do stuff end |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 02:23 PM |
| I highly recommend using the IsA method over checking the ClassName, because you can use superclasses such as BasePart. |
|
|
| Report Abuse |
|
|