Jump to content

Ajuda em um script de bater veiculo


Recommended Posts

function vehiclefailures()
    failede = true
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if ( vehicle and (getVehicleType(vehicle) == "Automobile")) then
		if getElementHealth(vehicle) < 550 then
		triggerServerEvent("Caroff", getRootElement(), vehicle)
		setTimer ( function()
		triggerServerEvent("Caron", getRootElement(), vehicle)
		end, 3000, 1 )
		end
	  end
    end

addEventHandler("onClientVehicleDamage", root, vehiclefailures)
addEventHandler("onClientVehicleEnter", root, vehiclefailures)

function enginefailures()
local vehicle = getPedOccupiedVehicle(localPlayer)
if ( vehicle and (getVehicleType(vehicle) == "Automobile")) then
if getElementHealth(vehicle) < 550 then
if not failede then return end
setTimer( function()
        if not failede then return end
        triggerServerEvent("failurex", getRootElement(), vehicle)
		triggerServerEvent("Caroff", getRootElement(), vehicle)
		local sound = playSound("failure.wav")
		setTimer ( function()
		triggerServerEvent("Caron", getRootElement(), vehicle)
		end, 3000, 1 )
		failede = false
		setTimer( function()
		failede = true
		end, 25000, 1 )
		end, 10, 1 )
end
end
end
addEventHandler ( "onClientPreRender", root, enginefailures )

function enginesoundf()
if not sounding then
sound=playSound("failure.wav")
setSoundVolume(sound, 0.5)
setTimer ( function()
sounding = true
end, 5000, 1 )
end
end
addEvent ( "failureclient", true )
addEventHandler ( "failureclient", getRootElement ( ), enginesoundf )

Gostaria de ajuda pra colocar quando o veiculo chegar em 350% de vida ela não ligar mas não consigo ja tentei 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...