hello,
i want to try to use moving objects in maps, that works for me but i want to use it when the player is in a certain area.
there for i use: elementColShapeHit.
i'm currently using a test script i got from MTA wiki. when i use this in free roam resource it works. but when i'm using the script in my race resource(so i'm using cars) it stops working, but MTA wiki says it should work with both(player and cars)
this is the code i got from MTA wiki:
local gate_test = createColCircle ( 2482, -1701, 20 )
function elementColShapeHit( colShapeHit )
if colShapeHit == gate_test then -- if element entered the created colshape
outputChatBox( getElementType( source ) .. " entered the colCircle!" ) -- print the type of the element to chatbox
end
end
addEventHandler( "onElementColShapeHit", getRootElement(), elementColShapeHit ) -- add a handler function for the event