hyrumcoop
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 618 |
|
|
| 03 Mar 2012 10:37 AM |
| I know in the IsA method you can use BasePart, which is just any part. But is there something for GUIs? I need to filter out anything that isn't a gui. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 10:39 AM |
The IsA method is just short for saying ClassName. So yes, you can.
if script.Parent:IsA("ScreenGui") then --code end
|
|
|
| Report Abuse |
|
|
hyrumcoop
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 618 |
|
|
| 03 Mar 2012 10:41 AM |
| But that won't catch Frames, or TextLabels. Will it? |
|
|
| Report Abuse |
|
|
hyrumcoop
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 618 |
|
|
| 03 Mar 2012 10:43 AM |
| Nevermind. I'll just list all the classnames in the if statement. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 03 Mar 2012 10:43 AM |
| You could make your own class check function.. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 03 Mar 2012 10:44 AM |
... Okay.
Hyrum. The IsA() function CHECKS if the CLASSNAME is the argument. It returns true if that is so...
SO. For frames you do
:IsA("Frame")
For Textlabels?
:IsA("TextLabel")
For Messages?
:IsA("Message")
For TextButtons?
:IsA("TextButton")
Done. Got it? |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 10:47 AM |
| I showed you what it does... Just say what classname you want. |
|
|
| Report Abuse |
|
|
1Ra
|
  |
| Joined: 02 May 2010 |
| Total Posts: 2400 |
|
|
| 03 Mar 2012 10:48 AM |
| i think he means like, you could say :IsA("BasePart") instead of saying :IsA("Part") or :IsA("CylinderPart") |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 11:26 AM |
| No that's not what he meant..I'm pretty sure. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Mar 2012 11:29 AM |
if script.Parent:IsA("GuiBase") then
Checks if the item is a GUi Item. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 11:31 AM |
@UFAil2
We explained that... |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 11:31 AM |
Uhh, it's either GuiMain or GuiObject.
You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss- |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Mar 2012 11:32 AM |
| Nobody posted the code I posted though. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Mar 2012 11:33 AM |
| I was the only one that answered his question. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 03 Mar 2012 11:36 AM |
Alright, I tested it. GuiObject works for Frames, TextLabels, TextButtons, ImageLabels, ImageButtons, and TextBoxes, but NOT ScreenGuis or BillboardGuis. GuiBase works for all of them.
You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss- |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 11:37 AM |
@electricblaze
That helped a lot :D |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 03 Mar 2012 11:37 AM |
@ElectricBlaze.. It's same thing as BasePart wont affect on models... :P |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 11:37 AM |
You're welcome. :3
You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss- |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 12:03 PM |
I take that back because of what su said :P
(If that's true.) |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 12:07 PM |
@miz - What do you mean? I think su was just saying that that the fact that BasePart doesn't include models is similar to GuiObject not including ScreenGuis and BillboardGuis. Everything I said is true. :P
You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Mar 2012 12:16 PM |
| Oh, well I give my unthank you and take it back. Thanks for that fact. |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 12:17 PM |
Uhh, no problem.
You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss- |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 12:19 PM |
Use ROBLOX Wiki page for this stuff. It sorts things by their base classes and such.
GUI items are subclasses of GuiObject.
http://wiki.roblox.com/index.php/GuiObject |
|
|
| Report Abuse |
|
|