Klesh Posted January 4, 2012 Share Posted January 4, 2012 Im using the gui to make a window, but the trouble is this, when player join the window appear so i was thinking in bind that winndow for the player, here come the real trouble: This is an example of lua code, the first code i try. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () genWindow() showCursor(true,true) end ) But later i was thinking in bind that window, so i try to do this: function onresourceStart() bindKey("F1", "down", showgenWindow) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showgenWindow() genWindow() showCursor(true,true) end I was make the code, when i test it the window not shows when player join, but the bind works fine. I tryed to make with onPlayerJoin, or onPlayerLogin with root but the windows being not show when players join or login, or bind no work. What other way i can make the window show's when player join, with the bind working. Link to comment
myonlake Posted January 4, 2012 Share Posted January 4, 2012 Add this to the function where the GUI is created. guiSetVisible(WINDOWNAME, true) And use "onClientResourceStart" as an event. Link to comment
Kenix Posted January 5, 2012 Share Posted January 5, 2012 You can use bind and this outside a event "onClientResourceStart". Link to comment
Klesh Posted January 5, 2012 Author Share Posted January 5, 2012 You can use bind and this outside a event "onClientResourceStart". Yes i know that, but what i mean is is i add that event the window not will show at playerjoin, so i need to know how i can call 2 functions, one to bind and th other one to show it at serverjoin. 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