MenTos Posted October 4, 2018 Share Posted October 4, 2018 Привет всем! Не знаю как правильно написать скрипт Нужно сделать так, чтобы делалось 100 хп, если хп меньше 10. Буду рад помощи Link to comment
VenomOG Posted October 4, 2018 Share Posted October 4, 2018 local playerHealth = getElementHealth ( localPlayer ) function health ( root ) if (playerHealth = 10 ) then setElementHealth(root,100) end end -- set a timer so the function is called after 1 second setTimer ( health, 1000, 1) Didnt test. Link to comment
MrKAREEM Posted October 5, 2018 Share Posted October 5, 2018 local playerHealth = getElementHealth ( localPlayer ) function health ( root ) if (playerHealth == 10 ) then setElementHealth(root,100) end end -- set a timer so the function is called after 1 second setTimer ( health, 1000, 1) as the upper comment u forget == in third code 1 Link to comment
SaNoR Posted October 10, 2018 Share Posted October 10, 2018 addEventHandler("onPlayerDamage", root, function() if getElementHealth(source) < 10 then setElementHealth(source, 100) end end) 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