Om. Posted March 31, 2016 Share Posted March 31, 2016 somethings wrong with triggerServerEvent. Code: -- Client Side -- Logs into account addEventHandler ( 'onClientGUIClick', root, function () if (source == clickOnlogin) then if username ~= nil or username ~= "" or password ~= nil or password ~= "" then triggerServerEvent("loginPlayer", localPlayer, username, password) else outputChatBox("Please enter username & password") end end end ) -- Server Side function loginPlayer(thePlayer, username, password) local account = getAccount(username, password) if (account ~= false) then logIn(thePlayer, account, password) else outputChatBox("Invalid username & password!", thePlayer, 255, 0, 0) end end addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), loginPlayer) Link to comment
Tox Posted March 31, 2016 Share Posted March 31, 2016 remove "thePlayer" argument and replace it with client function loginPlayer(username, password) local account = getAccount(username, password) if (account ~= false) then logIn(client, account, password) else outputChatBox("Invalid username & password!", client, 255, 0, 0) end end addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), loginPlayer) Link to comment
#|_oskar_|# Posted March 31, 2016 Share Posted March 31, 2016 try this , If you do not add guiGetText addEventHandler ( 'onClientGUIClick', root,function () if (source == clickOnlogin) then if guiGetText (user) ~= "" and guiGetText (pass) ~= "" then triggerServerEvent("loginPlayer", localPlayer,guiGetText (user),guiGetText (pass)) else outputChatBox("Please enter username & password") end end end) 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