Search the Community
Showing results for tags 'click'.
-
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?