Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. local knockedOut = false
  2. local wait = 10
  3. local count = 60
  4.  
  5. Citizen.CreateThread(function()
  6. while true do
  7. Wait(1)
  8. local myPed = GetPlayerPed(-1)
  9. if IsPedInMeleeCombat(myPed) then
  10. if GetEntityHealth(myPed) < 150 then
  11. SetPedToRagdoll(myPed, 1000, 1000, 0, 0, 0, 0)
  12. ShowNotification("~r~Vous avez été mis KO!")
  13. wait = 15
  14. knockedOut = true
  15. SetEntityHealth(myPed, 116)
  16. end
  17. end
  18. if knockedOut == true then
  19. DisablePlayerFiring(PlayerId(), true)
  20. SetPedToRagdoll(myPed, 1000, 1000, 0, 0, 0, 0)
  21. ResetPedRagdollTimer(myPed)
  22.  
  23. if wait >= 0 then
  24. count = count - 1
  25. if count == 0 then
  26. count = 60
  27. wait = wait - 1
  28. SetEntityHealth(myPed, GetEntityHealth(myPed)+4)
  29. end
  30. else
  31. knockedOut = false
  32. end
  33. end
  34. end
  35. end)
  36.  
  37. function ShowNotification(text)
  38. SetNotificationTextEntry("STRING")
  39. AddTextComponentString(text)
  40. DrawNotification(false, false)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement