Imposter Posted August 21, 2012 Posted August 21, 2012 What am i doing wrong? function onLogin() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) I don't know why, but when i simply just write source, it doesnt work
xPiwel Posted August 21, 2012 Posted August 21, 2012 What am i doing wrong? function onLogin() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) When you start the resource, or when a player Login, do you have any error in the consol about this script ?
sockz Posted August 21, 2012 Posted August 21, 2012 function onLogin(source) outputChatBox("Hello!", source) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
Xeno Posted August 21, 2012 Posted August 21, 2012 You can't use onLogin as function name - sorry for the weird function name i have, i couldn't think of anything! function eatmyshit() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), eatmyshit)
Imposter Posted August 21, 2012 Author Posted August 21, 2012 What am i doing wrong? function onLogin() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) When you start the resource, or when a player Login, do you have any error in the consol about this script ? LOL seems to work now ...
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