• Get Vehicle Script
    4 replies, posted
Hello, I'm trying to make a spot on the map when you drive on it with your car the car will change color, i'm using TDM cars and also cars with skins, i got the skin thing working but now i need make it so that TDM Cars change color not skin. I'm wondering how to get the vehiclescript from a car. [LUA] if IsValid(client:GetVehicle()) and (client:GetVehicle():GetValue("vehiclescript") == "supra") then local v = client:GetVehicle() v:SetColor(0,0,0,255) end [/LUA] Thanks.
Why do you need vehicle script? ( .txt file in scripts folder ) You can just do client:GetVehicle():SetColor( clr )
Yes but some of the cars use skins, so if id make it set color it would make the skin cars colored. So im trying to get the vehicle script to identify a certain vehicle.
[QUOTE=RANDOMlagFTW;42945959]Yes but some of the cars use skins, so if id make it set color it would make the skin cars colored. So im trying to get the vehicle script to identify a certain vehicle.[/QUOTE] They probably use the SetSkin function, so you can try [URL="http://wiki.garrysmod.com/page/Entity/GetSkin"]GetSkin[/URL].
Just use Vehicle:Set/GetSkin, Vehicle:Set/GetColor and Vehicle:GetModel, that's all you need.
Sorry, you need to Log In to post a reply to this thread.