generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: IsA with GUIs

Previous Thread :: Next Thread 
hyrumcoop is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
03 Mar 2012 10:47 AM
[ Content Deleted ]
Report Abuse
miz656 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Mar 2012 11:31 AM
@UFAil2

We explained that...
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Mar 2012 11:32 AM
Nobody posted the code I posted though.
Report Abuse
UFAIL2 is not online. 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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Mar 2012 11:35 AM
Whatever....
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Mar 2012 11:37 AM
@electricblaze

That helped a lot :D
Report Abuse
su8 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image