Jump to content

onClientPlayerJoin not work??????


Recommended Posts

Hi, onClientPlayerJoin not work for me :( help pls:

  
function onResourceStarted() 
    buildStatsWindow() 
    outputChatBox("Press F6 to open the shop!", 255, 255, 0, true) 
end 
addEventHandler("onClientPlayerJoin", getRootElement(), onResourceStarted) 
  

Link to comment
OnClientPlayerJoin won't work until client script download is complete. Use onClientResourceStart instead.

shwaeki's example is ok, but you have to replace getRootElement() with resourceRoot.

If I add setTimer it's same?

And with this function it's work ? : onClientFileDownloadComplete

Link to comment

No, why would you put setTimer there? If you use root in onClientResourceStart, the function will get called on start of any resource. If you use resourceRoot it will get called just for your resource the code is in.

Why would you use onClientFileDownloadComplete? If you want it to get called on player's join use onClientResourceStart. And these are events, not functions.

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...