karimsqualli96 Posted August 27, 2014 Share Posted August 27, 2014 hi, i need to use 2 windows for login/register when a player connect, i declared and initialized the 2 windows and their component in the file chunk as local variable, but when the player will login i don't need them anymore so how to destroy them?? Link to comment
xXMADEXx Posted August 27, 2014 Share Posted August 27, 2014 You can use destroyElement or guiSetVisible. Link to comment
karimsqualli96 Posted August 27, 2014 Author Share Posted August 27, 2014 guiSetVisible just hide the gui from the player but it still allocated on the client memory, i think destroyElement is the solution Link to comment
Anubhav Posted August 27, 2014 Share Posted August 27, 2014 guiSetVisible just hide the gui from the player but it still allocated on the client memory, i think destroyElement is the solution destroyElement is not the solution. If you destroy the GUI you'll need to create it again. It may give you some errors if you destroy it and u use the variable. Solution is guiSetVisible. You can hide and un-hide it whenever u want and no need to create it again. Link to comment
karimsqualli96 Posted August 27, 2014 Author Share Posted August 27, 2014 i know i've made a init_gui and destroy_gui function, normally when the player connect to the server i will show him the login gui, if he login succefully i will not need to show the logIn dialog anymore so i detroy it using destroyElement Link to comment
Anubhav Posted August 27, 2014 Share Posted August 27, 2014 i know i've made a init_gui and destroy_gui function, normally when the player connect to the server i will show him the login gui, if he login succefully i will not need to show the logIn dialog anymore so i detroy it using destroyElement If you are triggering server to client for gui remember to trigger for that player only or it may destroy for others who din't login. 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