Skip to content

Commit

Permalink
Update setdownedstate.lua | Phone Disabling While Dead
Browse files Browse the repository at this point in the history
Added NPWD exports to disable the phone and check if the phone is visible before death, then hiding it after the player is in the isDead state.
  • Loading branch information
zlexif authored Dec 12, 2024
1 parent 8b517ea commit d8fd6ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/setdownedstate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,24 @@ local function handleLastStand()
end
end

---Set dead and last stand states.
CreateThread(function()
while true do
local isDead = exports.qbx_medical:IsDead()
local inLaststand = exports.qbx_medical:IsLaststand()
if isDead or inLaststand then
if isDead then
exports.npwd:setPhoneVisible(false)
exports.npwd:setPhoneDisabled(true)
handleDead(cache.ped)
elseif inLaststand then
exports.npwd:setPhoneVisible(false)
exports.npwd:setPhoneDisabled(true)
handleLastStand()
end
Wait(0)
else
Wait(1000)
exports.npwd:setPhoneDisabled(false)
end
end
end)
Expand Down

0 comments on commit d8fd6ff

Please sign in to comment.