Object::Object
Creates new object in to the world.
Syntax
mp.objects.new(model, Vector3 position, Vector3 rotation);
Required Arguments:
- model hash:
mp.joaat('<model_name>')or object id - position: Vector3
- rotation: Vector3
Example
let pos = player.position; // Returns Vector3 object
pos.y += 1
pos.z -= 1
let object = mp.objects.new(mp.joaat('p_stinger_03'), pos, [0, 0, 0]); // Creates a stinger beside the player
let object = mp.objects.new(795100068, pos, [0, 0, 0]); // Alternative, mp.joaat(...) resolves the model name into this object id