Jump to content

error line 5: '(' expected near local'


xArgonx

Recommended Posts

Posted

Hello,

i'm scripting MTA server and try to make the garages open, but every time i get this error:

error line 5: '(' expected near local'

here is the script code:

GARAGE_ID = 12 
  
  
function start 
        local garageCube = createColCube(1337, 194, 28, 6, 10, 4) 
        addEventHandler("onColShapeHit", garageCube, onGarageCubeHit) 
        addEventHandler("onColShapeLeave", garageCube, onGarageCubeLeave) 
end 
  
  
  
function onGarageCubeHit(hitElement, matchingDimension) 
        if (getElementType(hitElement) == "player") then 
  
                if (not isGarageOpen(GARAGE_ID)) then 
  
                        setGarageOpen(GARAGE_ID, true) 
                end 
        end 
end 
  
  

i hope someone can help me...

Posted

Errm.. the error message tells you exactly what is wrong. You're missing parentheses () at the end of your function name. You should probably read some more Lua basics before you start scripting.

Posted

thank you, i maked a few resource but this error i do not did before xD

now i get a error message because createColCube attempts a nil value...

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