Tails Posted June 9, 2016 Share Posted June 9, 2016 Hello, I've tried many different things (including processLineOfSight) but it does not detect the marker element. It's going right through it. There's no problem with objects, though. Is there any way to detect markers with a mouse click? function pickupItem(button,state,_,_,x,y,z,clickedElem) if button == "left" and state == "down" and getKeyState("e") then if isElement(clickedElem) then if getElementType(clickedElem) == "marker" then outputChatBox("hit marker") end end end end addEventHandler("onClientClick",root,pickupItem) Link to comment
Captain Cody Posted June 9, 2016 Share Posted June 9, 2016 It's because the marker has no collisions onClientClick and proccessLineOfSight both rely on collision with the object. Link to comment
Tails Posted June 9, 2016 Author Share Posted June 9, 2016 So, is there no other way then? Link to comment
Captain Cody Posted June 9, 2016 Share Posted June 9, 2016 hm.. You could connect an object to the marker maybe. And use getElementAttachedTo Link to comment
Anubhav Posted June 9, 2016 Share Posted June 9, 2016 hm.. You could connect an object to the marker maybe. And usegetElementAttachedTo Right! Make a invisible ped. Not really attach it, you could probably use setElementParent and then getElementParent? createPed setElementAlpha setElementParent getElementParent 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