Genesis_ Posted August 15, 2021 Share Posted August 15, 2021 (edited) hi, i was making a system when the player have less than 20 health it shows a dxGui, but, it just show if i restart the resource. what i have to do? function deadAnimation() setPedAnimation(source, "CRACK", "crckidle2", true, false, false, false) end addEvent("dA", true) addEventHandler("dA", root, deadAnimation) function healthChanged(thePlayer) if getElementHealth(thePlayer) < 21 then setElementHealth( thePlayer, 20 ) triggerClientEvent ("rS", root) triggerEvent( "dA", root) elseif getElementHealth(thePlayer) > 21 then removeEventHandler ("rS", root) removeEventHandler ( "dA", root) end end addEventHandler("onPlayerDamage", getRootElement(), healthChanged) Edited August 15, 2021 by Genesis_ 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