GrubaS Posted July 24, 2018 Share Posted July 24, 2018 (edited) 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 July 24, 2018 by GrubaS Link to comment
DiGiTal Posted July 24, 2018 Share Posted July 24, 2018 @GrubaS can u explaine more ? after 5s it output somthing ? Link to comment
GrubaS Posted July 24, 2018 Author Share Posted July 24, 2018 33 minutes ago, DiGiTal said: @GrubaS can u explaine more ? after 5s it output somthing ? Link to comment
DiGiTal Posted July 24, 2018 Share Posted July 24, 2018 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
GrubaS Posted July 24, 2018 Author Share Posted July 24, 2018 it's now spamming 5 4 3 2 1 0 when my car has fire look ss, https://imgur.com/a/pJqVpMM @DiGiTal Link to comment
DiGiTal Posted July 24, 2018 Share Posted July 24, 2018 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
GrubaS Posted July 24, 2018 Author Share Posted July 24, 2018 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
DiGiTal Posted July 24, 2018 Share Posted July 24, 2018 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
GrubaS Posted July 25, 2018 Author Share Posted July 25, 2018 i want see time when car will be boom. example. Car started firing then on chat says "5 4 3 2 1 " and on 0 car will boom without spam (car fire is ~6 secounds) 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