zocken212 Posted July 29, 2013 Posted July 29, 2013 Hey, I want to detect a created element if it's hit a marker. The element which should hit the marker is moving with moveObject, but when the element hits the marker nothing happends. -- Creates the marker local container1marker = createMarker(2835.4645996094,-2385.0695800781,15.442111968994,"cylinder",1,0,255,0) -- The function for the event function onElementMarkerHit(hitElement,_) if source == container1marker then if getElementType(hitElement) == "object" then outputChatBox("test") end end end addEventHandler("onMarkerHit",getRootElement(),onElementMarkerHit) What's wrong there? (Debugscript says nothing before you ask)
Castillo Posted July 29, 2013 Posted July 29, 2013 I once read that there was a bug, and the object never hit the marker.
zocken212 Posted July 29, 2013 Author Posted July 29, 2013 and the object never hit the marker. It does. I'm controlling the object with W,A,S,D, pgup and pgdown.
Castillo Posted July 29, 2013 Posted July 29, 2013 I mean, the event is never triggered, like is not hitting the marker.
zocken212 Posted July 29, 2013 Author Posted July 29, 2013 I don't get it even after 5 times of reading. Could someone make an example? Would be helpful.
Castillo Posted July 29, 2013 Posted July 29, 2013 What I'm saying is that there's a bug on MTA that causes the object not to trigger the event "onMarkerHit" when being moved by moveObject.
zocken212 Posted July 29, 2013 Author Posted July 29, 2013 Ah ok, thanks. Is there another way to detect an element if it hits an element?
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