Jump to content

Gui, can't show on player join


Recommended Posts

Hi there,

I'm trying to make a window that should popup whenever a player joins the server.

It works if I use the commandHandler but it just won't show using the EventHandler.

Would appreciate it if you could help me with this.

function infoGui () 
    local sWidth,sHeight = guiGetScreenSize() 
    infoGuiWindow = guiCreateWindow ( sWidth-600, sHeight-400, sWidth-400, sHeight-300, "Server Rules", false ) 
    guiCreateLabel(0.05, 0.1, 0.94, 0.2, "1:", true, infoGuiWindow) 
    closeButton = guiCreateButton(0.5, 0.5, 0.25, 0.1, "Close", true, infoGuiWindow) 
    showCursor ( true ) 
addEventHandler("onPlayerJoin", getRootElement(), infoGui) 
addCommandHandler("z", infoGui) 

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