Jump to content

[HELP]Welcome Message GUI


Shazzimal

Recommended Posts

Hey,

I was just trying to make my first script. Wat I was making is: When someone joins my server, there will come up a GUI window, on that window are comming some rules commands etc. i maked this script and meta:

server.lua

addEventHandler("onPlayerJoin",getRootElement(), 
function createWelcomeMessage() 
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
     
    X = 0.0825 
    Y = 0.2 
     
    Width = 0.25 
    Height = 0.25 
     
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc...") 
     
    guiSetVisible(wdwWelcome, false) 
end 

meta.xml

<meta> 
    <info author="Shazzimal" name="welcomeMessage" version="1.0" disc="Will create a welcome message at join."/> 
    <script src="server.lua"/> 
</meta> 

I tried to run it on my server but my server, doesn't recognized it, why?

Thanks

Link to comment
wdwWelcome = { 
} 
  
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) 
  
  

Link to comment
wdwWelcome = { 
} 
  
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) 
  
  

There is no need for declaring a table variable with the name 'wdwWelcome'.

Link to comment
wdwWelcome = { 
} 
  
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) 
  
  

There is no need for declaring a table variable with the name 'wdwWelcome'.

Thanks .

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