hello guys, really strange stuff happening here (at least for me), i’m trying to make a coma state and i can’t understand why sometimes it works fine, sometimes it doesnt. for example, when i fall down and go into the coma state, the healme command revives me but if someone shoots me, i go into the coma state, i use healme, it heals me for a fraction of a seccond and then it turns back to coma state, i’ve been trying to figure out what’s going on since the morning and i can’t
setTick(() => {
SetPlayerHealthRechargeMultiplier(PlayerId(), 0.0)
if (GetEntityHealth(PlayerPedId()) <= 105) {
SetEntityHealth(PlayerPedId(), 110)
SetEntityInvincible(GetPlayerPed(-1), true)
StartScreenEffect("DeathFailOut", 0, 1)
}
if (GetEntityHealth(PlayerPedId()) == 110) {
if (IsPedInAnyVehicle(PlayerPedId(), true) == true) {
TaskLeaveAnyVehicle(PlayerPedId(), true, true)
}
SetPedToRagdoll(PlayerPedId(), 300000, 1000, 0, true, true, false)
StartScreenEffect("DeathFailOut", 0, 1)
}
})
RegisterCommand('healme', function () {
SetEntityHealth(PlayerPedId(), 200)
thirst = 200;
hunger = 200;
SetEntityInvincible(PlayerPedId(), false)
SetPedToRagdoll(PlayerPedId(), 1, 1, 0, true, true, false)
StartScreenEffect("DeathFailOut", 1, 0)
SendNuiMessage(JSON.stringify({
type: "htc",
sendhunger: hunger,
sendthirst: thirst
}))
})