Jump to content

motd script need help.


Recommended Posts


My motd script doesn't work.

ERROR: Loading script failed: info-window\client.lua:7: ') expected (to close '(' at line 6) near '=' 


function drawText() 
    local sWidth,sHeight = guiGetScreenSize() 
        Texto = "Muista pitää hauskaa!" 
        if Texto == "Muista pitää hauskaa!" then 
        Texto = "Donaamalla Miikalle 10e psc, saat modet." 
        elseif Texto == "Donaamalla Miikalle 10e psc, saat modet." then 
        Texto = "Lisää infoa Miikalta." 
        elseif Texto == "Lisää infoa Miikalta." then 
        Texto = "Kutsu toki kaverisikin pelaamaan!" 
        elseif Texto == "Kutsu toki kaverisikin pelaamaan!" then 
        Texto = "Älähän kinua rankkia :3" 
        elseif Texto == "Älähän kinua rankkia :3" then 
        Texto = "Muista pitää hauskaa!" 
    10000, 0) 
function doText(command, ...) 
    if command == "motdon" then 
        text = table.concat({...}," ") 
        addEventHandler("onClientRender", getRootElement(), drawText) 
    elseif command == "motdoff" then 
        removeEventHandler("onClientRender", getRootElement(), drawText)    -- this time we use removeEventHandler 
addCommandHandler("motdon", doText) 
addCommandHandler("motdoff", doText) 

What is the problem?

Link to comment

You added a timer inside an onClientRender event with the wrong syntax. This is a valid way to define a timer:

    -- Code here 
end, 10000, 1) 

Move it outside the render event to hide the text after ~10 seconds (if that's what you're trying to do), as you do now it will attempt to hide the text 600'000 times after 10 seconds during 10 seconds, that's not a good idea.

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