Jump to content

[HELP] countdown + fire car


GrubaS

Recommended Posts

Hello, i want to make a script which if car fire it will say when it will boom it's 5-6 secounds so i did that script but it's spamming *x*times i tried smth with cancelEvent() but it's doesn't works :/ can u help me please ;x also idk which event use :/

 

addEventHandler( "onClientVehicleCollision", root, 
function ()

	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
  local health = getElementHealth( playerVehicle )/10
	if health < 25 then
	countdownRec(5) 
	cancelEvent()
	end
end)

function countdownRec(count) 
      if (count > 0) then 
          setTimer(countdownRec, 1000, 1, count-1) 
          outputChatBox(tostring(count)) 
      else 
          outputChatBox("Go Go Go!!!") 
      end 
end 

 

Edited by GrubaS
Link to comment
addEventHandler( "onClientVehicleCollision", root, 
function ()

	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
  local health = getElementHealth( playerVehicle )/10
	if health < 25 then
	countdownRec(5) 
	end
end)

function countdownRec(count) 
while count>=0 do
    outputChatBox(count)
      count = count - 1
	end
    end
    

@GrubaS

Link to comment
addEventHandler( "onClientVehicleCollision", root, 
function ()

	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
  local health = getElementHealth( playerVehicle )/10
	if health < 25 then
	countdownRec(5) 
	end
end)

function countdownRec(count) 
while count>=0 do
    outputChatBox(count)
      count = count - 1
if (count==0) then break end
	end
    end
	

@GrubaS

Link to comment
3 minutes ago, DiGiTal said:

addEventHandler( "onClientVehicleCollision", root, 
function ()

	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
  local health = getElementHealth( playerVehicle )/10
	if health < 25 then
	countdownRec(5) 
	end
end)

function countdownRec(count) 
while count>=0 do
    outputChatBox(count)
      count = count - 1
if (count==0) then break end
	end
    end
	

@GrubaS

it's same like up just now from 5 to 1 without 0 ;/

Link to comment

you wanna the car blow or just show 5~0 without spam ?

addEventHandler( "onClientVehicleCollision", root, 
function ()

	 playerVehicle = getPedOccupiedVehicle ( localPlayer )
  local health = getElementHealth( playerVehicle )/10
	if health < 25 then
	countdownRec(5) 
	end
end)

function countdownRec(count) 
while count>=0 do
    outputChatBox(count)
      count = count - 1
if (count==0) then blowVehicle(playerVehicle) break end
	end
    end
	

 

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...