How can I use LUA to spawn a vehicle in front of a player, a jeep inpaticular.
Any ideas, I’ve tried using lots of code and I’m getting nowhere. :S
How can I use LUA to spawn a vehicle in front of a player, a jeep inpaticular.
Any ideas, I’ve tried using lots of code and I’m getting nowhere. :S
local vehicle = ents.Create(“prop_vehicle_jeep”)
vehicle:SetPos(ply:GetPos())
vehicle:Spawn()
This very well might not be drivable though… looking through the http://wiki.garrysmod.com/?title=List_of_Entities, this one was the only jeep.
Edit: This will also spawn on top of the player… you’ll need to offset the vector to get it in front.
Since I’m lazy I’ll link you to an old post :
http://www.facepunch.com/showpost.php?p=14370652&postcount=10
@JTG2003
I think that code would crash the game because the vehicle has no set vehiclescript.