Why isn't this closing the GUI?
SERVER
function submitReg()
dbExec(server, "CREATE TABLE IF NOT EXISTS accounts (accountname TEXT, password TEXT)")
new = dbExec(server, "INSERT INTO accounts VALUES (accountname, password)", inputusernamereg, inputpasswordreg)
output = outputChatBox("You have successfully created an account!")
if new == true then
triggerClientEvent("closedok", getRootElement())
triggerClientEvent("onErrorok", getRootElement())
end
end
addEvent( "submitRegister", true )
addEventHandler( "submitRegister", root, submitReg )
CLIENT
function onErrorOk()
guiSetVisible (GUIEditor.window[2], false)
end
addEventHandler("onErrorok", true)
addEventHandler("onErrorok", getRootElement(), onErrorOk)
function closeSuccess()
guiSetVisible (GUIEditor.window[3], true )
end
addEventHandler("closedok", true)
addEventHandler("closedok", getRootElement(), closeSuccess)
Thanks