Update auto-heal.txt

fixed bug
This commit is contained in:
[MEF] мехроб 2024-11-26 07:15:55 +03:00 committed by GitHub
parent f2193cd920
commit 776c592e05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ hook.add("PlayerHurt","",function(ply)
end
end)
hook.add("think","",function()
if owner():isValid() and owner():isAlive() then
if prop.canSpawn() then
if canHeal == 1 and owner():getHealth() < 100 then
prop.createSent(owner():getPos(),Angle(0),"item_healthkit")
@ -24,5 +25,6 @@ hook.add("think","",function()
if canHeal == 1 and owner():getArmor() < 100 then
prop.createSent(owner():getPos(),Angle(0),"item_battery")
end
end
end
end)