Jump to content

Function is not being called.


Michael_Sund

Recommended Posts

Posted

This doesn't seem to be calling my function "showLoginWindow()". It's client-side and the script is included in meta.xml as client type script.

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showLoginWindow) 

Posted
function showLoginWindow() 
    createLoginWindow() 
    outputChatBox("DEBUG 1 PASSED") 
    if(wdwLogin ~= nil) then 
        guiSetVisible(wdwLogin, true) 
        showCursor(true) 
        guiSetInputEnabled(true) 
    else 
        outputChatBox("An unexpected error has occured and the login GUI could not be created.") 
    end 
end 
  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showLoginWindow) 

Posted
function showLoginWindow() 
    createLoginWindow() 
    outputChatBox("DEBUG 1 PASSED") 
    if (guiGetVisible(wdwLogin) == false) then 
        guiSetVisible(wdwLogin, true) 
        showCursor(true) 
        guiSetInputEnabled(true) 
    else 
        outputChatBox("An unexpected error has occured and the login GUI could not be created.") 
    end 
end 
  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showLoginWindow) 

Posted

use /debugscript 3

it is possible it stops on createLoginWindow() function. or does not run at all, depends on debug output.

Posted

Found the problems. I thought LUA operators were NOT like C++ and most other languages... I put the assignment operator instead of logical equals operator. Haha, fixing it right now. Thank you!

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