Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/10/20 in Posts

  1. 2 points
  2. Isn't the handle returned by `raycast.entity` alone? No `.handle` property?
    1 point
  3. Hi guys, so im trying to get back into scripting, trying to figure out everything by my own wont work. I used to script but somehow im really rust. I have this script where i just want the player to be able to do the /armyduty command when he is in a colshape&Marker and not when he is outside. I found some usefull information on the wiki but i keep on getting "Nope" as an answer. const Armymarker = mp.markers.new(1, new mp.Vector3(-2126.56128, 3285.96265, 37.7325134), 3, { color: [255, 165, 0, 50], visible: true, }); let ArmyColShape = mp.colshapes.newSphere(-2126.56128, 3285.96265, 37.7325134, 5); mp.events.addCommand('armyduty', (player, shape) => { if(shape == ArmyColShape) { player.outputChatBox(`${player.name} duty Army`); } else { player.outputChatBox(`${player.name} Nope`); } }); Thats the script, but i cant figure out what im doing wrong that i cant execute the command in the colshape. Im grateful for every tips and tricks. Cheers, R1Z
    1 point
  4. Thanks for your reply. Thats the first helpful step though. Going to try that thankyou
    1 point
  5. If I'm guessing correctly, you're just typing /armyduty and that's it? That won't do anything as you haven't written anything for 'shape', it can't just grab 'shape' out of nowhere, you need to tell it what 'shape' is. Thinking off the top of my head, what if you used the playerEnterColShape and playerExitColShape events, and assign the player a variable called something like currentCol with the value of the shape that you get from the event. Then when they exit, just assign that variable the value of 'null'? I've never actually played with colshapes where it checks if you're inside one, I've always just executed functions as soon as they enter it so this is just me thinking up one way.
    1 point
×
×
  • Create New...