Object Spawning

I spawned a few objects and attached them to my vehicle, however when I opened the truck people said they cant see them.
However if I spawn an object on the ground, they can see them.
What am I doing wrong? How to make other people see objects attached to my vehicle
(using F4 menu)

https://runtime.fivem.net/doc/natives/#_0x509D5878EB39E842
Set isNetworking to true.

Thanks for reply…but…how do I do that? Where do I find “isNetworking” to set it to true :sweat_smile:
Because as far as I know, you cant edit c++ files once they are compiled…

The function can be used in any langage compatible with FiveM (lua, c# and js). You just need to write it like CreateObject instead of CREATE_OBJECT. isNetwork is a param of the function (5th one).

Example:

--model is the object hash
while not HasModelLoaded(model) do
	RequestModel(model)
	Citizen.Wait(1)
end

--x, y, z are coords
CreateObject(model, x, y, z, true, false, false)

wait doesnt this mean that I will have to do this for every single model i spawn?

No it’s just a basic example :wink:

Ahh ok, I am still a bit confused how to do it, I will try I guess. At first I thought I had to change something in config xd

I Cant Spwan Items Using My Cmds AnyMore Any Fixes??

4 Year old topic, please watch the topic dates.