Kapricioza Posted March 6, 2019 Share Posted March 6, 2019 Hi, I created an object and i want trigger event when player is clicking at this entity. Here is my code: Server side: wheelObject = mp.objects.new(mp.joaat('prop_spraygun_01'), wheelPosition, { rotation: 283.08, alpha: 255, dimension: player.dimension }); ClientSIde: mp.events.add('click', (x, y, upOrDown, leftOrRight, relativeX, relativeY, worldPosition, hitEntity) => { mp.gui.cursor.show(false, true); const cursorPosition = new mp.Vector3(x, y, 0); const objectPosition = new mp.Vector3(766.928, -844.155, 0); //position of wheelObject const result = mp.raycasting.testCapsule(cursorPosition, objectPosition, 10, localPlayer, 16); if(result != undefined) mp.gui.chat.push("Entity:" + result.entity); }); result.entity return number, but it is not the same value like have the hash of 'wheelObject'. What function should I use to get hash of entity clicked by player? Link to comment Share on other sites More sharing options...
Freamee Posted October 29, 2019 Share Posted October 29, 2019 id be interested as well Link to comment Share on other sites More sharing options...
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