scaryface87 Posted July 29, 2014 Share Posted July 29, 2014 Hello , Is there any function event or something to know if there are objects on DFT? for example if an object is in this col I tought something like this but it doesnt work [lua] object1 = createObject(1000,394.33875,2442.71362,16.50000) function incol () if getElementsWithinColShape(col,object1) then outputChatBox("An object is on the colshape!") end end addEventHandler("onResourceStart",getRootElement(),incol) Link to comment
RenanPG Posted July 29, 2014 Share Posted July 29, 2014 This events: addEventHandler ( "onColShapeHit", Col, function ) addEventHandler ( "onColShapeLeave", Col, function ) https://wiki.multitheftauto.com/wiki/OnColShapeHit https://wiki.multitheftauto.com/wiki/OnColShapeLeave Link to comment
scaryface87 Posted July 29, 2014 Author Share Posted July 29, 2014 It doesnt do rlly what i wanted ; I want it so it outputs in chatAn object is on the colshape i created a colrectangle on the object (so its in it) but it isnt shouting the message or is the problem that the object is already in the colshape? object1 = createObject(1000,394.33875,2442.71362,16.50000) col1 = createColRectangle(377.94525,2432.49194, 53.5, 45 ) function lol () if getElementsWithinColShape(col1,object1) then outputChatBox("An object is on the colshape!") end end addEventHandler ( "onColShapeHit", col1, lol ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now