Client.lua not ever running?

The script is supposed to check if the vehicle is police4, if it is, then set its colour to white and its engine power multiplier to 10, but for some reason on the client, I never see the print ‘script is running’ indicating to me that it isn’t. If anyone knows how to help please do :slight_smile:. Here’s the files:

client.lua:

Citizen.CreateThread(function()
    while true do
        Wait(0)
		local veh = GetVehiclePedIsIn(GetPlayerPed(-1), false)
		print ('script is running')
		if IsVehicleModel(veh, 0x8A63C7B9) then
			print('veh is police4')
			SetVehicleColours(veh, 111, 111)
			SetVehicleEnginePowerMultiplier(10.00)
		end
	end
end)

__resource.lua (client.lua is in the folder client):

resource_manifest_version '44feaabe-d386-4d18-afbe-5e627f4af937'

client_scripts 'client/client.lua'

client_script* (I think)

oh ok, i think that was a typo, ill change to see if it works with that, thanks! :smiley:

nope, still not working with client_script

you do have a folder in said resource called client, right?

@sadboilogan

Seems so

yes i do, also ive now changed the code slightly too:

Citizen.CreateThread( function()
    while true do
        Citizan.Wait(0)
		local veh = GetVehiclePedIsIn(GetPlayerPed(-1), false)
		print ('script is running')
		if IsVehicleModel(veh, 0x8A63C7B9) then
			print('veh is police4')
			SetVehicleColours(veh, 111, 111)
			SetVehicleEnginePowerMultiplier(veh, 10.00)
		end
	end
end)

Oops, me and my damn not reading

2 Likes

You get no errors, right?

not that i see in console or the server cmd no

Random guess, try change Wait into Citizen.Wait(0)

One problem I see, rn

‘Citizan’

1 Like

ok will do, also just noticed that it says ‘Citizan’

So, I checked it and the code part is fine, if it is not constantly printing script is running in the InGame Console, there has to be a problem with your __resource.lua or you didn’t start the resource ^^

1 Like

Hmm, Ok, as far as i can tell (I don’t know much) it should start? I do have ‘start fasterpolice4’ in my server.cfg but nothing still.

Im still changing Citizan btw :wink:

ok its working now, the Citizan was the issue, sorry about that :smiley:

1 Like