ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!
ESX = nil
local IsDead = false
local IsAnimated = false
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
AddEventHandler('esx_basicneeds:resetStatus', function()
TriggerEvent('esx_status:set', 'hunger', 500000)
TriggerEvent('esx_status:set', 'thirst', 500000)
TriggerEvent('esx_status:set', 'stress', 100000)
end)
RegisterNetEvent('esx_basicneeds:healPlayer')
AddEventHandler('esx_basicneeds:healPlayer', function()
-- restore hunger & thirst
TriggerEvent('esx_status:set', 'hunger', 1000000)
TriggerEvent('esx_status:set', 'thirst', 1000000)
TriggerEvent('esx_status:set', 'stress', 200000)
-- restore hp
local playerPed = PlayerPedId()
SetEntityHealth(playerPed, GetEntityMaxHealth(playerPed))
end)
AddEventHandler('esx:onPlayerDeath', function()
IsDead = true
end)
AddEventHandler('playerSpawned', function(spawn)
if IsDead then
TriggerEvent('esx_basicneeds:resetStatus')
end
IsDead = false
end)
AddEventHandler('esx_status:loaded', function(status)
TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
return true
end, function(status)
status.remove(100)
end)
TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
return true
end, function(status)
status.remove(75)
end)
TriggerEvent('esx_status:registerStatus', 'stress', 100000, '#cadfff', function(status)
return false
end, function(status)
status.add(20)
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
local playerPed = PlayerPedId()
local prevHealth = GetEntityHealth(playerPed)
local health = prevHealth
local stressVal = 0
TriggerEvent('esx_status:getStatus', 'hunger', function(status)
if status.val == 0 then
if prevHealth <= 150 then
health = health - 5
else
health = health - 1
end
end
end)
TriggerEvent('esx_status:getStatus', 'thirst', function(status)
if status.val == 0 then
if prevHealth <= 150 then
health = health - 5
else
health = health - 1
end
end
end)
TriggerEvent('esx_status:getStatus', 'stress', function(status)
stressVal = status.val
end)
if health ~= prevHealth then
SetEntityHealth(playerPed, health)
end
if stressVal >= 750000 then
Citizen.Wait(3000)
ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.35)
elseif stressVal >= 700000 then
Citizen.Wait(4000)
ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.27)
elseif stressVal >= 600000 then
Citizen.Wait(5000)
ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.20)
elseif stressVal >= 350000 then
Citizen.Wait(6000)
ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.07)
end
end
end)
end)
