Aaaboy97
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 6612 |
|
|
| 10 Mar 2012 11:05 AM |
I'm trying to find the most efficient way to tell if `a` is a ROBLOX object, this is what I have.
select(2, pcall(a.IsA, a, "<<<ROOT>>>"))
is there a more efficient method of doing this? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 10 Mar 2012 11:23 AM |
| he wants to know if it's a roblox Instance like a Part or summit |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Mar 2012 11:33 AM |
All the roblox objects are userdata.. right?
So couldn't it just be;
userdata = type(object)=="userdata"
? |
|
|
| Report Abuse |
|
|
belial52
|
  |
| Joined: 10 Oct 2009 |
| Total Posts: 8074 |
|
|
| 10 Mar 2012 11:35 AM |
| @su, Using newporoxy can create a userdata too. |
|
|
| Report Abuse |
|
|
KingBoo
|
  |
| Joined: 16 Jul 2007 |
| Total Posts: 8495 |
|
| |
|
|
| 10 Mar 2012 01:53 PM |
What about
if Workspace.IsA(object, "Instance") then |
|
|
| Report Abuse |
|
|
owen0202
|
  |
| Joined: 27 Feb 2008 |
| Total Posts: 6912 |
|
|
| 10 Mar 2012 01:58 PM |
| Scratching my head and thinking of a scenario where a roblox object isn't a roblox objec.t |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2012 02:13 PM |
select(2, pcall(a.IsA, a, "<<<ROOT>>>")) and a.IsA == Workspace.IsA
~+[CROOKITY BANDED SNAKES]+~ |
|
|
| Report Abuse |
|
|