janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 26 Feb 2014 12:55 PM |
print(workspace:IsA("Model") ~= workspace.ClassName=="Model") ->false
Workspace is both a model and not a model |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
| |
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 26 Feb 2014 01:27 PM |
| Actually I misread. Assuming the RHS is evaluated first (I can't remember if that's left associative or right associative), you basically have "false ~= false" which is false. |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 26 Feb 2014 01:30 PM |
Or not... According to the wiki, Workspace extends RootInstance extends Model extends PVInstance extends Instance.
I'm confused now. And tired. |
|
|
| Report Abuse |
|
|
Merely
|
  |
| Joined: 07 Dec 2010 |
| Total Posts: 17266 |
|
|
| 26 Feb 2014 01:36 PM |
There's nothing strange about this.
The IsA method returns true if the instance's class is a subclass of the given class name. For example:
return Instance.new("Part"):IsA("BasePart") -> true
The part's classname is Part, but it inherits from BasePart.
Same goes for Workspace. It inherits from Model. So Workspace's class name is "Workspace" and Workspace:IsA("Model") returns true, even though Workspace.className ~= "Model" |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2014 10:24 PM |
@Merely but Workspace's class is "Workspace", not "Model"
What he has is true ~= false
which should be true, assuming Workspace is a model. |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
|
| 26 Feb 2014 10:27 PM |
| Workspace inherits from model. |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2014 10:27 PM |
To further myself,
> print(workspace:IsA("Model") ~= workspace.ClassName=="Model", workspace:IsA("Model"), workspace.ClassName == "Model") false true false
Workspace is a model, true Workspace's class name isn't model, false
true ~= false
But, yet
> print(true ~= false) true
so I'm confused. |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
|
| 26 Feb 2014 10:37 PM |
you nobs
print(workspace:IsA("Model") ~= workspace.ClassName=="Model")
...
a = workspace:IsA("Model") ~= workspace.className b = "Model"
print( a == b )
make sense now? |
|
|
| Report Abuse |
|
|
200AB
|
  |
| Joined: 24 Aug 2010 |
| Total Posts: 1604 |
|
|
| 26 Feb 2014 10:41 PM |
What Oysi said.
I think everyone knew this originally, but ended up confusing themselves.
Case closed! |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
|
| 26 Feb 2014 10:42 PM |
nono, whitespace confused them
silly scripters |
|
|
| Report Abuse |
|
|