Captain Cody Posted July 13, 2016 Share Posted July 13, 2016 Any way to list a GUI elements children? I'm trying to make a script that automatically converts GUI into DX gui using presets I have made, but I cannot find how I would go about listing a GUI elements children as to automatically convert them all. Or even better, any way to list all the GUI from a certain resource? Link to comment
فاّرس Posted July 13, 2016 Share Posted July 13, 2016 Maybe like that? addCommandHandler( 'gui', function ( _, gui, res ) for k,v in ipairs ( getElementsByType ( 'gui-'..gui, getResourceRootElement(getResourceFromName ( res ) )) ) do outputChatBox ( guiGetText ( v ) ) end end ) > gui . Link to comment
Captain Cody Posted July 13, 2016 Author Share Posted July 13, 2016 (edited) - Edited July 13, 2016 by Guest Link to comment
Captain Cody Posted July 13, 2016 Author Share Posted July 13, 2016 How exactly would I use this? Can you give an example Link to comment
فاّرس Posted July 13, 2016 Share Posted July 13, 2016 You can't get all GUIs, except if make a table like that : GUIs = { 'window', 'button', 'edit' } -- etc. You can use it like this: getElementsByType ( 'gui-' ) -- gui-button, gui-window, etc. Link to comment
Captain Cody Posted July 13, 2016 Author Share Posted July 13, 2016 Oh wow I didn't know about that, thank you. Link to comment
Captain Cody Posted July 13, 2016 Author Share Posted July 13, 2016 ---- never mind, getElementParent works for GUI to. Link to comment
فاّرس Posted July 13, 2016 Share Posted July 13, 2016 If you want to get GUIs from certain resource you should be use getElementsByType. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now