Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local knockedOut = false
- local wait = 10
- local count = 60
- Citizen.CreateThread(function()
- while true do
- Wait(1)
- local myPed = GetPlayerPed(-1)
- if IsPedInMeleeCombat(myPed) then
- if GetEntityHealth(myPed) < 150 then
- SetPedToRagdoll(myPed, 1000, 1000, 0, 0, 0, 0)
- ShowNotification("~r~Vous avez été mis KO!")
- wait = 15
- knockedOut = true
- SetEntityHealth(myPed, 116)
- end
- end
- if knockedOut == true then
- DisablePlayerFiring(PlayerId(), true)
- SetPedToRagdoll(myPed, 1000, 1000, 0, 0, 0, 0)
- ResetPedRagdollTimer(myPed)
- if wait >= 0 then
- count = count - 1
- if count == 0 then
- count = 60
- wait = wait - 1
- SetEntityHealth(myPed, GetEntityHealth(myPed)+4)
- end
- else
- knockedOut = false
- end
- end
- end
- end)
- function ShowNotification(text)
- SetNotificationTextEntry("STRING")
- AddTextComponentString(text)
- DrawNotification(false, false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement