Gallagher Posted May 9, 2014 Share Posted May 9, 2014 Hi guys. I have this script to create an image on the screen, but wish he begins guiSetVisible false. But when I start the resource in the image appear without me typing "t" /head How to make the image appear only after typing /head? local screenWidth,screenHeight = guiGetScreenSize() gRoot = getRootElement() gResRoot = getResourceRootElement( getThisResource() ) addEventHandler("onClientResourceStart", gResRoot, function () imag = guiCreateStaticImage ( 0.505, 0.378, 0.05, 0.05, "head.png", true ) end ) function changeVisibility ( ) if guiGetVisible ( imag ) then guiSetVisible ( imag, false ) else guiSetVisible ( imag, true ) end end addCommandHandler("head", changeVisibility) Link to comment
Castillo Posted May 9, 2014 Share Posted May 9, 2014 Hide the image after you create it. addEventHandler ( "onClientResourceStart", gResRoot, function ( ) imag = guiCreateStaticImage ( 0.505, 0.378, 0.05, 0.05, "head.png", true ) guiSetVisible ( imag, false ) end ) 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