SrKingFox Posted January 6, 2021 Share Posted January 6, 2021 (edited) basicamente, eu estou tentando, fazer com que quando acerta um headshot com qualquer arma ele seta 30 de vida no player para que funcione com o sistema do samu assim n matando o player e sim derrubando ele, mas não sei oq estou fzd de errado. addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then setElementHealth(source, attacker, weapon, bodypart, 30) end end end end ) Edited January 6, 2021 by SrKingFox Link to comment
ber Posted January 6, 2021 Share Posted January 6, 2021 function onDamage(_, _, bodypart) if bodypart == 9 then setElementHealth(source, 29) end end addEventHandler("onPlayerDamage", root, onDamage) 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