papam77 Posted July 19, 2013 Share Posted July 19, 2013 function login () showCursor ( true ) bg = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true) window = guiCreateStaticImage(0.30, 0.32, 0.40, 0.34, "img/login_window.png", true, bg) login = guiCreateStaticImage(0.70, 0.44, 0.21, 0.13, "img/login.png", true, window) guest = guiCreateStaticImage(0.70, 0.59, 0.21, 0.13, "img/guest.png", true, window) ------------------------- -- Mouse Events --------- ------------------------- addEventHandler( "onClientMouseEnter", root, function(aX, aY) if (login) then guiCreateStaticImage(70, 0.44, 0.21, 0.13, "img/login2.png", true, window) end end ) end addCommandHandler ("script", login ) Why it doesn't work when i hit login ? Link to comment
MIKI785 Posted July 19, 2013 Share Posted July 19, 2013 Are you trying to change the picture? This way is just stupid. Use guiStaticImageLoadImage instead. Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 try this: function loginFunc () showCursor ( true ) bg = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true) window = guiCreateStaticImage(0.30, 0.32, 0.40, 0.34, "img/login_window.png", true, bg) login = guiCreateStaticImage(0.70, 0.44, 0.21, 0.13, "img/login.png", true, window) guest = guiCreateStaticImage(0.70, 0.59, 0.21, 0.13, "img/guest.png", true, window) ------------------------- -- Mouse Events --------- ------------------------- addEventHandler( "onClientMouseEnter", root,function(aX, aY) if source==login then --check if the source they went over is the login guiCreateStaticImage(70, 0.44, 0.21, 0.13, "img/login2.png", true, window) end end) end addCommandHandler (loginFunc) And please try not to put function names and variable names the same name! 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