Vercetti1010 Posted May 11, 2008 Share Posted May 11, 2008 hello everyone. i have a problem with one of my scripts that doesnt seem to make any sense. i am trying to make the script recognize a player joining and a player leaving. so, basically to be concise, here is what ive done mop = getPlayerFromNick ( "MasterOfPuppets" ) function spawnInHouse ( thePlayer ) bla bla bla end addEventHandler ( "onPlayerJoin", mop, spawnInHouse ) however, nothing happens. what is the problem is anbody knows? and how do i fix it. your help is appreciated. Link to comment
Vercetti1010 Posted May 11, 2008 Author Share Posted May 11, 2008 hello everyone. i have a problem with one of my scripts that doesnt seem to make any sense. i am trying to make the script recognize a player joining and a player leaving. so, basically to be concise, here is what ive done mop = getPlayerFromNick ( "MasterOfPuppets" )function spawnInHouse ( thePlayer )bla bla blaendaddEventHandler ( "onPlayerJoin", mop, spawnInHouse ) however, nothing happens. what is the problem is anbody knows? and how do i fix it. your help is appreciated. Link to comment
norby89 Posted May 11, 2008 Share Posted May 11, 2008 in your script getPlayerFromNick is called when the resource is loaded not when the player joins, try something like: function spawnInHouse ( thePlayer ) if getPlayerName ( source ) = "MasterOfPuppets" then bla bla bla end addEventHandler ( "onPlayerJoin", getRootElement(), spawnInHouse ) Link to comment
norby89 Posted May 11, 2008 Share Posted May 11, 2008 in your script getPlayerFromNick is called when the resource is loaded not when the player joins, try something like: function spawnInHouse ( thePlayer )if getPlayerName ( source ) = "MasterOfPuppets" thenbla bla blaendaddEventHandler ( "onPlayerJoin", getRootElement(), spawnInHouse ) 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