sncplay42Join Date: 2008-11-27 Post Count: 11891 |
They think it's just a pointless duplicate of .className.
It isn't. It takes inheritance into account.
Instance.new("Seat").className == "Part" --> false, "Seat" ~= "Part"
Instance.new("Seat"):IsA("Part") --> true, Seat has all the members of Part.
So, which is shorter?
obj:IsA("Part")
or
obj.className == "Part" or obj.className == "Seat" or obj.className == "VehicleSeat" --and any others I missed
? |
|
BonecussJoin Date: 2008-02-15 Post Count: 6979 |
Can't see where i'd use this... |
|
1waffle1Join Date: 2007-10-16 Post Count: 16381 |
A Truss has different properties than a Part. Would it still work? |
|
zac352Join Date: 2009-02-20 Post Count: 4657 |
[ Content Deleted ] |
|
|
But I Wike Making Wong Scwipts =3 |
|
|
I noticed that there are some members of SpawnLocation, and Seat, that say they are members of
'Part'...
:IsA("Instance") would return true for everything, wouldn't it? |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
@1waffle1: yes, because a truss has all the properies of part, the fact that it has others as well is irrelevant.
@BlueTaslem: probably. |
|
JKM103Join Date: 2008-12-11 Post Count: 1762 |
[ Content Deleted ] |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
[object]:IsA("Instance")
true |
|
AnaminusTop 100 PosterJoin Date: 2006-11-29 Post Count: 5945 |
":IsA("Instance")"
"Is a Instance."
"a Instance"
*requests IsAn function* |
|
sroge445Join Date: 2008-06-02 Post Count: 5590 |
@Anaminus
LOLGRAMMERPWNT
And yes, I'm back. No bother gloating... |
|
chhhTVJoin Date: 2009-07-07 Post Count: 80 |
what about workspace? you cant use Instance.new on it (says not part of XML)
and you have to call it with GlobalService or somthing like that.. |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
print(game.Workspace:IsA("Instance")) --> true |
|
chhhTVJoin Date: 2009-07-07 Post Count: 80 |
wait...so why cant we do Instance.new("Workspace")? |
|
|
Roblox safety measure, maybe? |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
Uhh... because creating a new Workspace is crazy?
And Instance.new isn't actually a member of Instance, it's a member of a table of the same name... |
|
1waffle1Join Date: 2007-10-16 Post Count: 16381 |
Ok, I get it.... Sortof.
So Part:IsA("Truss") wouldn't work, because a Part dosen't have all the properties of a Truss? Um, is Instance a property? |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
Yup, a Truss is a Part, but not all Parts are Trusses. |
|
chhhTVJoin Date: 2009-07-07 Post Count: 80 |
a new workspace isint crazy its fun*spazes* fun...fun...fun...fun...fun...
ok...maby it is crazy....
XD |
|
fugglesJoin Date: 2008-03-01 Post Count: 13937 |
However... Last time I checked you can clone the Workspace... |
|
fugglesJoin Date: 2008-03-01 Post Count: 13937 |
Oops, nevermind... Just checked, you can't now. :/ |
|