rcore.cz
  • rcore.cz
  • Installation
  • github wiki
  • ESX
    • ESX Instance
    • Jobs
    • esx_datastore
  • Natives
    • Markers
    • 3D Text
    • Common functions
    • Command system
    • Camera API
    • Objects
    • Blips
    • Discord sender
  • Our links
    • Discord
    • Github
    • Our service
Powered by GitBook
On this page

Was this helpful?

  1. Natives

Objects

Work with 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.

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)
PreviousCamera APINextBlips

Last updated 4 years ago

Was this helpful?