• Car Skining
    4 replies, posted
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 :)
[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.
@[URL="http://www.facepunch.com/members/351202-notRzilla"]notRzilla[/URL] 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 :)
Sorry, you need to Log In to post a reply to this thread.