Skip to main content

Object::ObjectWeak

Not available on SYNC MP yet

This member is part of the RAGE:MP API but SYNC MP does not implement it yet (Client-side JavaScript). Calling it does nothing or throws.

Client-side function

JavaScript​

Converts a static game object into RAGEMP's objects api.

Required Params​

  • handle: number

Return Value​

  • ObjectMp

Syntax​

mp.objects.newWeak(handle);

Example​

Client-Side

let convertedObject = null;
const {x, y, z} = mp.players.local.position;
const gameobjectHandle = mp.game.object.getClosestObjectOfType(x, y, z, 10.0, mp.game.joaat("apa_heist_apart2_door"), false, false, false);

if (gameobjectHandle) {
convertedObject = mp.objects.newWeak(gameobjectHandle);
//now you can use RAGEMP's object api methods to control the newly converted object.
}