I see, the problem is, that getAccount returns true no matter whatever it is.
FINAL SOLUTION
client
function login()
--if an element was clicked on screen
username = guiGetText(GUIEditor.edit[1])
password2 = guiGetText(GUIEditor.edit[2])
account = triggerServerEvent ( "Account", getRootElement(),username)
if (account == true) then
local tf = triggerServerEvent ( "logInn", getRootElement(),localPlayer,username,password2)
if (tf == true) then
outputConsole("success")
isLoggedIn = true
showCursor(false)
else
outputConsole("wrn")
end
else
outputConsole("lel2")
end
end
server
addEvent ( "Account", true )
function getAcc(username)
local account = isGuestAccount(username)
if (account == true) then
return false
else
return true
end
end
addEventHandler ( "Account", getRootElement(), getAcc )
addEvent ( "logInn", true )
function logInn(thePlayer,username,password2)
local noole = logIn(thePlayer,getAccount(username),password2)
return noole
end
addEventHandler ( "logInn", getRootElement(), logInn )