Car Skining

hey guys can someone help me change the skins of my car in the script?

here is the script:
[lua]
local Category = “Enzo’s Vehicles”

local V = {
// Required information
Name = “Golf-GTI”,
Class = “prop_vehicle_jeep”,
Category = Category,

			// Optional information
			Author = "Enzo",
			Information = "Golf GTI",
			Model = "models/golf/golf.mdl",

			
							
			KeyValues = {
							vehiclescript	=	"scripts/vehicles/golf.txt"
						}
		}

list.Set( “Vehicles”, “Golf-GTI”, V )
[/lua]

You need to make a lua script that detects the car you spawn then use the SetMaterial meta on it :slight_smile:

[lua]
hook.Add(“OnEntityCreated”, 0, function(ent)
if ent:IsVehicle and ent:GetModel() == “models/golf/golf.mdl” then
ent:SetMaterial(“vehicles/yourskin”)
end
end
[/lua]

Add that to the bottom of your script.

@notRzilla I think he means preexisting skins that comes with the model.

In that case, add “skin” to your keyvalues.[LUA]
local Category = “Enzo’s Vehicles”

local V = {
// Required information
Name = “Golf-GTI”,
Class = “prop_vehicle_jeep”,
Category = Category,

            // Optional information
            Author = "Enzo",
            Information = "Golf GTI",
            Model = "models/golf/golf.mdl",

             
                             
            KeyValues = {
                            vehiclescript   =   "scripts/vehicles/golf.txt",
                            Skin            =    0/1/2
                        }
        }

list.Set( “Vehicles”, “Golf-GTI”, V )[/LUA]

Thanks alot guys it works :slight_smile: