function loginHandler(username,password)
-- check that the username and password are correct
if username == "user" and password == "apple" then
-- the player has successfully logged in, so spawn them
if (client) then
spawnPlayer(client, 1959.55, -1714.46, 10)
fadeCamera(client, true)
setCameraTarget(client, client)
outputChatBox("Welcome to My Server.", client)
end
else
-- if the username or password are not correct, output a message to the player
outputChatBox("Invalid username and password. Please re-connect and try again.",client)
end
end
addEvent("submitLogin",true)
addEventHandler("submitLogin",root,loginHandler)
this will only login you if your username is user and password apple...
function loginHandler(username,password)
-- check that the username and password are correct
if username and password then
-- the player has successfully logged in, so spawn them
if (client) then
spawnPlayer(client, 1959.55, -1714.46, 10)
fadeCamera(client, true)
setCameraTarget(client, client)
outputChatBox("Welcome to My Server.", client)
end
else
-- if the username or password are not correct, output a message to the player
outputChatBox("Invalid username and password. Please re-connect and try again.",client)
end
end
addEvent("submitLogin",true)
addEventHandler("submitLogin",root,loginHandler)
and add event handler to onClientResourceStart to open window
EDIT: There are many more wrong things...