josedisla Posted January 23, 2023 Share Posted January 23, 2023 Does anyone know of a script that can set a specific vehicle to light by one letter? Link to comment
Shady1 Posted January 23, 2023 Share Posted January 23, 2023 1 hour ago, josedisla said: Does anyone know of a script that can set a specific vehicle to light by one letter? hello welcome to forum,I did not understand what you want to do but I wanted to prepare a code... local vehicles = { ["vehicle_name"] = true --You can replace the "vehicle_name" with the name of the vehicle you want to use and you can add more vehicles to the list. } function onKey( button, pressOrRelease ) if pressOrRelease == true then if button == "x" then local vehicle = getPedOccupiedVehicle(localPlayer) if vehicles[getVehicleName(vehicle)] then -- turn on the headlights setVehicleOverrideLights(vehicle, 2) end end elseif pressOrRelease == false then if button == "x" then local vehicle = getPedOccupiedVehicle(localPlayer) if vehicles[getVehicleName(vehicle)] then -- turn off the headlights setVehicleOverrideLights(vehicle, 0) end end end end addEventHandler("onClientKey", root, onKey) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now