[RELEASE] [ESX] [Colorfull HeadLights] by MilutuS

Change this:

Citizen.CreateThread(function()	

	while true do
		Citizen.Wait(10000)
		local veh = GetVehiclePedIsIn(PlayerPedId(), false)
		_,lightson,highbeams = GetVehicleLightsState(veh)
		local color =GetVehicleHeadlightsColour(veh)
		local plate = GetVehicleNumberPlateText(veh)
		if plate == nil then

		else

			ESX.TriggerServerCallback("esx_swiatla:pobierz_swiatla", function(isPurchasable)
				if isPurchasable == color then

				else
					if MenuGUI == false then
						ToggleVehicleMod(veh, 22, true)
						SetVehicleHeadlightsColour(veh, isPurchasable)
					end
				end
			end, plate)
		end
	end
end)

To


	while true do
		Citizen.Wait(1000)
		local veh = GetVehiclePedIsIn(PlayerPedId(), false)
		_,lightson,highbeams = GetVehicleLightsState(veh)
		local color =GetVehicleHeadlightsColour(veh)
		local plate = GetVehicleNumberPlateText(veh)
		if plate == nil then

		else

			ESX.TriggerServerCallback("esx_swiatla:pobierz_swiatla", function(isPurchasable)
				if isPurchasable == color then

				else
					if MenuGUI == false then
						ToggleVehicleMod(veh, 22, true)
						SetVehicleHeadlightsColour(veh, isPurchasable)
					end
				end
			end, plate)
		end
	end
end)

Why is this doesnt work for license plates with less then 8 letters ?

This script what your are sending cant work bro because you downt have a Citizens Funktion ?! Fix your script because that script is ussles

1 Like

Okay wtf… I sat here for like 40 min trying to figure out what the hell is the problem lmao, For some odd ass reason nothing is changing it sets it to xeon lights but thats it. No color change nothing.

it only works on cars with 8 letters on the license plate. my server use 6 letters. how i can change it ?

Works great ! Solved all the issues. Thank you again for the script MilutuS

dosent work.

EDIT : i have set it on : Citizen.CreateThread(function()

while true do
Citizen.Wait(10000000)


So i get this error after picking the colour of the headlights then the headlight colour just go’s back to normal white.

2 Likes

i have the same Problem

Change your plate number format to 8 and it will work.

1 Like

Hello,

So nobody have found why its not working with 6 plate number?

I got the same error, like the color is working some second and after it will be by default.

For my DB, its ok.
image

Yep, It’s not working with 6. I changed my plate format to 8 instead of 6 and everything works.
I suggest to change the plate format and you will be more happy instead of fixing it to work with 6.
Also don’t just change the plate number from ‘‘menu’’ It needs to check the plate you get from the garage or shop.

Cheers !

@ProtonHorse @Twikii @Hope_Volv @Kalbino @ChrisTV84 @LePlay
It’s fix with this.

2 Likes

Nice, nice, but now i really enjoy my plates with 8 format. :smiley:

Thanks i will try it ! :slight_smile:

Thanks! i will try it :slight_smile:

I am having an issue where I set the color of the lights, but then I cannot interact with the game anymore. I see my mouse cursor after Saving the light color and I have to Alt+F4 my game.

I put a little modification on it…
Use a control key … no problem with cursor.

did you every figure out why the color would only change it to xenon?

I have a problem The lights work but I can only see them. How do I see them on the client side? What I mean is that others don’t see my lights :frowning: