Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Latest commit

 

History

History
33 lines (22 loc) · 861 Bytes

objects.md

File metadata and controls

33 lines (22 loc) · 861 Bytes
description
Work with objects

Objects

Create object

With rcore you can simply create a model without the need of requesting model or anything else, rcore will request model and will set model as no longed needed when its work is done. You can create networked object which all players will see.

You can use for name as well string name of object like 'prop_car_door_01' or hash.

Example

We will create simple command /spawnobj which will spawn one networked object.

{% code title="your_clientside.lua" %}

rcore = exports.rcore

local obj = 'prop_car_door_01' 

RegisterCommand('spawnobj',function() 
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    
    rcore:createObject(obj,coords,function(objId) 
        print('Yes we created object and we got it ID '..objId)
    end)
end)

{% endcode %}