require 'lib.moonloader'
local sampev = require 'lib.samp.events'
math.randomseed(os.time())
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("ah", active)
active = false
while true do
wait(0)
health = getCharHealth(PLAYER_PED)
if health < 40 and health > 5 and active then
wait(math.random(1000,5000))
sampSendChat("/healme")
wait(1000)
end
end
end
function active()
if active == true then
active = false
else
active = true
end
end