Jump to content

How to know if objects are in col? / on car


Recommended Posts

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

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

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