Jump to content

[HELP] source isn't working!


Imposter

Recommended Posts

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 :/

Link to comment
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 ?

Link to comment

You can't use onLogin as function name - sorry for the weird function name i have, i couldn't think of anything! :D

function eatmyshit() 
local thePlayer = getPlayerFromName(getPlayerName(source)) 
outputChatBox("Hello!", thePlayer) 
end 
addEventHandler("onPlayerLogin", getRootElement(), eatmyshit) 

Link to comment
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 ... :?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...