GTX Posted January 4, 2012 Posted January 4, 2012 Hello! I'll explain: When a player with the serial where the serial variable is written joins then the logIn function log in the player automatically. I can't explain better but here is the script: local serial = "serial" local account = "gtx" local password = "password" -- I will not show all the details here function connect() if getPlayerSerial(source) == serial then logIn(source, account, password) else outputChatBox("WELCOME!") end end addEventHandler("onPlayerJoin", getRootElement(), connect)
GTX Posted January 4, 2012 Author Posted January 4, 2012 Ah, I forgot to write debug here. Bad argument @ 'logIn' [Expected account at argument 2, got string 'gtx'] - Line 8
Kenix Posted January 4, 2012 Posted January 4, 2012 Try local serial = "serial" local account = "gtx" local password = "password" -- I will not show all the details here function connect() if getPlayerSerial(source) == serial then local acc = getAccount( account,password ) if acc then logIn(source, acc, password) else outputChatBox( "can't get account" ) end else outputChatBox("WELCOME!") end end addEventHandler("onPlayerJoin", root, connect )
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