NoviceWithManyProblems Posted January 12, 2020 Share Posted January 12, 2020 (edited) I maked something like this: addEventHandler("onColShapeHit", bank_col, function(he, md) if he == player then outputChatBox("good") else cancelEvent() end end) but this doesn't work. I solved it myself Working code: addEventHandler("onColShapeHit", bank_col, function(he, md) if getElementType(he) == "ped" then cancelEvent() else outputChatBox("good") end end) Edited January 12, 2020 by NoviceWithManyProblems Link to comment
WorthlessCynomys Posted January 12, 2020 Share Posted January 12, 2020 You can use getElementType for that. It returns a string that you can compare in an if. if getElementType(element) == "player" then -- Do something end This does something when the element is a player. 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