Matevsz Posted June 8, 2016 Share Posted June 8, 2016 'm writing a script on the lights for the car under the "lshift." When he squeezed it appears gui and light but let 'lshift "is the lights go out. Is is well positioned triggerServerEvent? Client: function LightsCar() local car = getPedOccupiedVehicle(localPlayer) triggerServerEvent("lights", localPlayer) if car then if getVehicleOverrideLights(car) ~= 2 then guiSetVisible(Lights, true) guiSetVisible(LightsOff, true) guiSetVisible(menu, false) else guiSetVisible(Lights, false) guiSetVisible(LightsOff], false) guiSetVisible(menu, true) guiSetVisible(button, false) end end end bindKey("lshift", "both", LightsCar) Server: addEvent("lights", true) addEventHandler("lights", root, function() local car = getPedOccupiedVehicle(source) if car then if getVehicleOverrideLights(car) ~= 2 then setVehicleOverrideLights(car, 2) else setVehicleOverrideLights(car, 1) end end end) 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