Hello fellow facepunchers! I could really use some help with spawning a vehicle in a gamemode I've been working on, any help/hints would be greatly appreciated!
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ents/Create]ents.Create[/url]?
[editline]15th March 2016[/editline]
E.g. how you could spawn a jeep:
[CODE]
local jeep = ents.Create( "prop_vehicle_jeep" )
jeep:SetModel( "models/buggy.mdl" )
jeep:SetPos( Vector( 0, 0, 0 ) )
jeep:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt") -- you need to do this for the jeep specifically since it needs this to drive and stuff
jeep:Spawn()
[/CODE]
[QUOTE=MPan1;49935000][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ents/Create]ents.Create[/url]?
[editline]15th March 2016[/editline]
E.g. how you could spawn a jeep:
[CODE]
local jeep = ents.Create( "prop_vehicle_jeep" )
jeep:SetModel( "models/buggy.mdl" )
jeep:SetPos( Vector( 0, 0, 0 ) )
jeep:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt") -- you need to do this for the jeep specifically since it needs this to drive and stuff
jeep:Spawn()
[/CODE][/QUOTE]
Thank you so much, I figured it had something to do with ents.Create but I was missing the SetKeyValue in the code that I had, thank you for the help!
Sorry, you need to Log In to post a reply to this thread.