function main()
repeat wait(0) until isSampAvailable()
while true do wait(0)
local res,ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if res then
local ress,id = sampGetPlayerIdByCharHandle(ped)
if ress then
local health = sampGetPlayerHealth(id)
print(health)
end
end
end
end