deltamta Posted December 8, 2012 Share Posted December 8, 2012 Heyo, I have a quick query because I'm trying to make a race function... I want to make a function that when your vehicle's health reaches to a critical moment so basically just before it starts burning, I want it to slowly start replenishing it's health to 30% in 30 seconds. ( I also want it to wait 10 seconds before the replenishment proccess starts ) Now I don't want it to pass 30% because then the script would not be fair for other players ... Here is my research till now : --[[ Repair Script By *Delta^# ]] function setHealth ( loss ) vehicle = source setTimer ( function () local health = getElementHealth ( vehicle ) outputChatBox ( health ) if ( health <= 120 ) then setElementHealth( vehicle, health + 30.0) end end, 1000, 0 ) end addEventHandler( "onVehicleDamage", getRootElement(), setHealth ) Thank you. Link to comment
Castillo Posted December 8, 2012 Share Posted December 8, 2012 If I understand you correctly, before the vehicle starts burning, it has to set a timer of 10 seconds to set a timer of 1 second to increase vehicle health? Link to comment
deltamta Posted December 8, 2012 Author Share Posted December 8, 2012 It has to set a timer of 10 seconds to increase +30 hp every second till it has reached @ about 333 hp 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