new link for you:
https://wiki.multitheftauto.com/wiki/Debugging
and example of debugging:
-- open the door when someone enters the garage's collision shape
function onGarageCubeHit(hitElement, matchingDimension)
outputDebugString("something hit the sphere")
if (getElementType(hitElement) == "player") then
outputDebugString("it was player")
-- check to make sure the door is closed
outputDebugString("garage status:" ..tostring(isGarageOpen(GARAGE_ID)))
if (not isGarageOpen(GARAGE_ID)) then
outputDebugString("garage was closed")
-- open the door
local status = setGarageOpen(GARAGE_ID, true)
outputDebugString("status of openning garage:"..tostring(status))
end
end
end
if you dont get even first debug message - the something wrong is with event handler or sphere.
also you need to define even handler function BEFORE adding the handler - not sure how it will behave in way you have it (adding handler on resource start, with functions below) - it's better to move onGarageCubeHit and onGarageCubeLeave BEFORE onResourceStart handler - more info on addEventHandler wiki page (search pls)