Alright, I got a problem with gui. it won't create properly. I am using tab panel with 3 tabs and stuff in there, but it only creates the tab panel + first tab and then it won't do anything after those lines. I am posting my client script. It is all in one file at the moment as I have started scripting about 53 minutes ago. ANyways, here it is:
Question
Izanagi
Alright, I got a problem with gui. it won't create properly. I am using tab panel with 3 tabs and stuff in there, but it only creates the tab panel + first tab and then it won't do anything after those lines. I am posting my client script. It is all in one file at the moment as I have started scripting about 53 minutes ago. ANyways, here it is:
client:
local root = getRootElement() local loc = getLocalPlayer() function createAuthWindow() tpAuth = {} GUIEditor_Edit = {} tpAuth[1] = guiCreateTabPanel(583,317,187,159,false) authTab[1] = guiCreateTab("Register",tpAuth[1]) regLabel[1] = guiCreateLabel(0.05,0.1,0.4,0.1,"Username* :",true,authTab[1]) guiLabelSetColor(regLabel[1],255,255,255) guiLabelSetVerticalAlign(regLabel[1],"center") guiLabelSetHorizontalAlign(regLabel[1],"right",false) regLabel[2] = guiCreateLabel(0.05,0.3,0.4,0.1,"Password* :",true,authTab[1]) guiLabelSetColor(regLabel[2],255,255,255) guiLabelSetVerticalAlign(regLabel[2],"center") guiLabelSetHorizontalAlign(regLabel[2],"right",false) regLabel[3] = guiCreateLabel(0.05,0.5,0.4,0.1,"Repeat* :",true,authTab[1]) guiLabelSetColor(regLabel[3],255,255,255) guiLabelSetVerticalAlign(regLabel[3],"center") guiLabelSetHorizontalAlign(regLabel[3],"right",false) regEdit[1] = guiCreateEdit(0.5,0.1,0.4,0.15,"",true,authTab[1]) guiEditSetMaxLength(regEdit[1],24) regEdit[2] = guiCreateEdit(0.5,0.3,0.4,0.15,"",true,authTab[1]) guiEditSetMasked(regEdit[2],true) guiEditSetMaxLength(regEdit[2],16) regEdit[3] = guiCreateEdit(0.5,0.5,0.4,0.15,"",true,authTab[1]) guiEditSetMasked(regEdit[3],true) guiEditSetMaxLength(regEdit[3],16) regButton[1] = guiCreateButton(0.3,0.75,0.4,0.2,"Register",true,authTab[1]) authTab[2] = guiCreateTab("Login",tpAuth[1]) logLabel[1] = guiCreateLabel(0.05,0.1,0.4,0.1,"Username :",true,authTab[2]) guiLabelSetColor(logLabel[1],255,255,255) guiLabelSetVerticalAlign(logLabel[1],"center") guiLabelSetHorizontalAlign(logLabel[1],"right",false) logLabel[2] = guiCreateLabel(0.05,0.3,0.4,0.1,"Password :",true,authTab[2]) guiLabelSetColor(logLabel[2],255,255,255) guiLabelSetVerticalAlign(logLabel[2],"center") guiLabelSetHorizontalAlign(logLabel[2],"right",false) logEdit[1] = guiCreateEdit(0.5,0.1,0.4,0.15,"",true,authTab[2]) guiEditSetMaxLength(logEdit[1],24) logEdit[2] = guiCreateEdit(0.5,0.3,0.4,0.15,"",true,authTab[2]) guiEditSetMasked(logEdit[2],true) guiEditSetMaxLength(logEdit[2],16) logCheckbox[1] = guiCreateCheckBox(0.1,0.55,0.8,0.1,"Remember me",false,true,authTab[2]) logCheckbox[2] = guiCreateCheckBox(0.1,0.65,0.8,0.1,"Auto login",false,true,authTab[2]) logButton[1] = guiCreateButton(0.3,0.85,0.4,0.1,"Login",true,authTab[2]) authTab[3] = guiCreateTab("Recovery",tpAuth[1]) --GUIEditor_Edit[1] = guiCreateEdit(0.4545,1.1136,0,0,"",true,authTab[3]) recLabel[1] = guiCreateLabel(0.1,0.1,0.8,0.1,"Unique User ID",true,authTab[3]) guiLabelSetColor(recLabel[1],255,255,255) guiLabelSetVerticalAlign(recLabel[1],"center") guiLabelSetHorizontalAlign(recLabel[1],"center",false) recLabel[2] = guiCreateLabel(0.1,0.4,0.8,0.1,"New Password",true,authTab[3]) guiLabelSetColor(recLabel[2],255,255,255) guiLabelSetVerticalAlign(recLabel[2],"center") guiLabelSetHorizontalAlign(recLabel[2],"center",false) recEdit[1] = guiCreateEdit(0.2,0.25,0.6,0.15,"",true,authTab[3]) recEdit[2] = guiCreateEdit(0.2,0.55,0.6,0.15,"",true,authTab[3]) guiEditSetMaxLength(recEdit[2],16) recButton[1] = guiCreateButton(0.2,0.8,0.6,0.15,"Set Password",true,authTab[3]) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createAuthWindow() guiSetVisible(tpAuth, true) outputChatBox("test after show") showCursor(true) guiSetInputEnabled(true) end ) function clientSubmitLogin(button) if button == "left" then triggerServerEvent("SubmitLogin", root, guiGetText(logEdit[1]), guiGetText(logEdit[2])) guiSetInputEnabled(false) guiSetVisible(tpAuth[1], false) showCursor(false) end end addEventHandler("onClientGUIClick", regButton[1], clientSubmitRegister, false) addEventHandler("onClientGUIClick", logButton[1], clientSubmitLogin, false) addEventHandler("onClientGUIClick", recButton[1], clientSubmitRecovery, false)what is wrong with the code, tell me!
I used the Gui Edit to generate gui code..
Link to comment
7 answers to this question
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