Car Dealer to DarkRP

Hello. I made a car dealer npc. It works fine, but when I buy a car it spawns, but I don’t own it. It’s unowned. Is there any way that I can make it ownable by the person that bought the car, as it is in DarkRP?

Here is the Car script for Golf:
function SpawnCarGolf()
local golf = ents.Create(“prop_vehicle_jeep_old”)
golf:SetKeyValue(“vehiclescript”, “scripts/vehicles/golf.txt”)
concommand.Add(“buy_golf”, SpawnCarGolf)

Perhaps this is what you’re looking for, I’m not sure though

Maybe, but the problem is that it is DarkRP, which set’s it to ownable I think.

Well you could have a look at the entities which come with DarkRP and see what sets it there.

Yeah, could try.

Please post if you find it, I’m interested.

Haven’t found it yet. I could try pm’ing FPtje about it.

It takes two seconds to read through any of the DarkRP entities.

car:SetNWEntity("owning_ent", ply)



Well, the NPC dealer is in darkrp/entities/npc_car_dealer/ So when I did ply:AddMoney(-300) it didn’t take those money from me. So I don’t think that car:SetNWEntity(“owning_ent”, ply) will work there

If you use the .onUse function then you do get a player entity returned.