Xeno Posted January 10, 2010 Share Posted January 10, 2010 hey im new 2 scripting and iv run into some trouble... im trying to make a stunt menu so i want a bind key 2 make it pop up and on here is my script so far function INFO() outputChatBox("#FF0000*INFO: #Press F3 to open up the stunt screen", getRootElement(), 0,0,0, true) end addEventHandler( "onResourceStart", getRootElement(), INFO ) function CreateLoginWindow() wdwLogin = guiCreateWindow(0.375,0.350,0.300,0.250,"stunts",true) guiWindowSetSizable(wdwLogin,false) guiWindowSetMovable(wdwLogin,true) guiCreateLabel(0.080,0.200,0.250,0.250,"Freefall",true,wdwLogin) edtUser = guiCreateEdit(0.380,0.190,0.500,0.150,localPlayerName,true,wdwLogin) guiEditSetReadOnly(edtUser,true) edtPass = guiCreateEdit(0.380,0.440,0.500,0.150,"",true,wdwLogin) guiEditSetMaxLength(edtPass,20) guiEditSetMasked(edtPass,true) btnLogin = guiCreateButton(0.630,0.650,0.250,0.150,"Log In",true,wdwLogin) btnRegister = guiCreateButton (0.630,0.600,0.250,0.150,"Register",true,wdwLogin) guiSetVisible(wdwLogin,false) end addEventHandler( "onResourceStart", getRootElement(), CreateLoginWindow ) please help. i no that you dont like just doing a script for me but i have no clue lol Link to comment
Xeno Posted January 10, 2010 Author Share Posted January 10, 2010 hey im new 2 scripting and iv run into some trouble... im trying to make a stunt menu so i want a bind key 2 make it pop up and on here is my script so far function INFO() outputChatBox("#FF0000*INFO: #Press F3 to open up the stunt screen", getRootElement(), 0,0,0, true) end addEventHandler( "onResourceStart", getRootElement(), INFO ) function CreateLoginWindow() wdwLogin = guiCreateWindow(0.375,0.350,0.300,0.250,"stunts",true) guiWindowSetSizable(wdwLogin,false) guiWindowSetMovable(wdwLogin,true) guiCreateLabel(0.080,0.200,0.250,0.250,"Freefall",true,wdwLogin) edtUser = guiCreateEdit(0.380,0.190,0.500,0.150,localPlayerName,true,wdwLogin) guiEditSetReadOnly(edtUser,true) edtPass = guiCreateEdit(0.380,0.440,0.500,0.150,"",true,wdwLogin) guiEditSetMaxLength(edtPass,20) guiEditSetMasked(edtPass,true) btnLogin = guiCreateButton(0.630,0.650,0.250,0.150,"Log In",true,wdwLogin) btnRegister = guiCreateButton (0.630,0.600,0.250,0.150,"Register",true,wdwLogin) guiSetVisible(wdwLogin,false) end addEventHandler( "onResourceStart", getRootElement(), CreateLoginWindow ) please help. i no that you dont like just doing a script for me but i have no clue lol Link to comment
Remp Posted January 10, 2010 Share Posted January 10, 2010 When you post code on the forums, please use [lua] [/lua] tags, it makes it much easier to read the function you are after is bindKey Put it in your 'INFO' function and set it to trigger a function that calls guiSetVisible on your window Link to comment
Remp Posted January 10, 2010 Share Posted January 10, 2010 When you post code on the forums, please use [lua] [/lua] tags, it makes it much easier to read the function you are after is bindKey Put it in your 'INFO' function and set it to trigger a function that calls guiSetVisible on your window Link to comment
50p Posted January 10, 2010 Share Posted January 10, 2010 hey im new 2 scripting and iv run into some trouble... im trying to make a stunt menu so i want a bind key 2 make it pop up and on here is my script so farfunction INFO() outputChatBox("#FF0000*INFO: #Press F3 to open up the stunt screen", getRootElement(), 0,0,0, true) end addEventHandler( "onResourceStart", getRootElement(), INFO ) function CreateLoginWindow() wdwLogin = guiCreateWindow(0.375,0.350,0.300,0.250,"stunts",true) guiWindowSetSizable(wdwLogin,false) guiWindowSetMovable(wdwLogin,true) guiCreateLabel(0.080,0.200,0.250,0.250,"Freefall",true,wdwLogin) edtUser = guiCreateEdit(0.380,0.190,0.500,0.150,localPlayerName,true,wdwLogin) guiEditSetReadOnly(edtUser,true) edtPass = guiCreateEdit(0.380,0.440,0.500,0.150,"",true,wdwLogin) guiEditSetMaxLength(edtPass,20) guiEditSetMasked(edtPass,true) btnLogin = guiCreateButton(0.630,0.650,0.250,0.150,"Log In",true,wdwLogin) btnRegister = guiCreateButton (0.630,0.600,0.250,0.150,"Register",true,wdwLogin) guiSetVisible(wdwLogin,false) end addEventHandler( "onResourceStart", getRootElement(), CreateLoginWindow ) please help. i no that you dont like just doing a script for me but i have no clue lol You need it to be client-side event and it has to be in client-side script. Link to comment
50p Posted January 10, 2010 Share Posted January 10, 2010 hey im new 2 scripting and iv run into some trouble... im trying to make a stunt menu so i want a bind key 2 make it pop up and on here is my script so farfunction INFO() outputChatBox("#FF0000*INFO: #Press F3 to open up the stunt screen", getRootElement(), 0,0,0, true) end addEventHandler( "onResourceStart", getRootElement(), INFO ) function CreateLoginWindow() wdwLogin = guiCreateWindow(0.375,0.350,0.300,0.250,"stunts",true) guiWindowSetSizable(wdwLogin,false) guiWindowSetMovable(wdwLogin,true) guiCreateLabel(0.080,0.200,0.250,0.250,"Freefall",true,wdwLogin) edtUser = guiCreateEdit(0.380,0.190,0.500,0.150,localPlayerName,true,wdwLogin) guiEditSetReadOnly(edtUser,true) edtPass = guiCreateEdit(0.380,0.440,0.500,0.150,"",true,wdwLogin) guiEditSetMaxLength(edtPass,20) guiEditSetMasked(edtPass,true) btnLogin = guiCreateButton(0.630,0.650,0.250,0.150,"Log In",true,wdwLogin) btnRegister = guiCreateButton (0.630,0.600,0.250,0.150,"Register",true,wdwLogin) guiSetVisible(wdwLogin,false) end addEventHandler( "onResourceStart", getRootElement(), CreateLoginWindow ) please help. i no that you dont like just doing a script for me but i have no clue lol You need it to be client-side event and it has to be in client-side script. 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