Jump to content

setTimer again....


Recommended Posts

function loginPanel() 
setTimer(guiSetVisible, 10000, 1, GUIEditor_Window[1], true) 
guiSetInputEnabled( true ) 
end 
addEventHandler("onClientPlayerJoin", getRootElement(), loginPanel) 

i see no error or wrong in this code

but for good reason i use

guiSetVisible( GUIEditor_Window[1], false )

after i make the window

like that

guiCreateWindow(.....) 
-- and the other stuff 

guiSetVisible( GUIEditor_Window[1], false )

so what's a problem ?

Link to comment

You want to show the GUI 10sec after player joins the game?

Try replacing this:

addEventHandler("onClientPlayerJoin", getRootElement(), loginPanel) 

with this:

addEventHandler("onClientResourceStart", getResourceRoot(getThisResource()), loginPanel) 

Link to comment
Guest Guest4401
onClientPlayerJoin sometimes doesn't work.

Sometimes? It always won't work for the play himself who joined the server.

This event is triggered when a player joins a server. It is triggered for all players except the local player, as the local player joins the server before their client-side resources are started. It would also be possible for two players to join within a few seconds of each other and for the two players' scripts may not receive onClientPlayerJoin events as their scripts wouldn't have started yet.
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...