-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathunarmed_knockout.lua
More file actions
84 lines (76 loc) · 3.2 KB
/
unarmed_knockout.lua
File metadata and controls
84 lines (76 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--┌≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈┐
--│ │
--│ # Knocked Out │
--│ │
--│ │
--│ Knockout With effect {When knocked out, │
--│ While knocked out} │
--│ │
--│ │
--│ │
--│ │
--│ │
--│ @ Modification upon need by Rango!(zaki) │
--│ │
--│ Contact (discord) : Zaki#1196 │
--│ │
--└≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈┘
local knockedOut = false
local wait = 15
local count = 60
Citizen.CreateThread(function()
while true do
Wait(1)
local myPed = GetPlayerPed(-1)
-- With melee weapon or unarmed only
if IsPedInMeleeCombat(myPed) then
-- Without any kind of weapon {UNARMED ONLY}
if (HasPedBeenDamagedByWeapon(myPed, GetHashKey("WEAPON_UNARMED"), 0) )then
-- Health to be knocked out
if GetEntityHealth(myPed) < 145 then
SetPlayerInvincible(PlayerId(), false)
-- Position taken by your Ped
SetPedToRagdoll(myPed, 1000, 1000, 0, 0, 0, 0)
-- Effect
ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 2.5)
-- Time to wait
wait = 15
--** Add progress Bar here if you want **--
knockedOut = true
-- Health after knockout preferably dont make it more than 150 (50 %) because people will abuse with it {No need to go to hospital or so}
SetEntityHealth(myPed, 140)
end
end
end
if knockedOut == true then
--Your ped is able to die
SetPlayerInvincible(PlayerId(), false)
DisablePlayerFiring(PlayerId(), true)
SetPedToRagdoll(myPed, 1000, 1000, 0, 0, 0, 0)
ResetPedRagdollTimer(myPed)
-- Red Cam
SetTimecycleModifier("REDMIST")
-- Cam vibration
ShakeGameplayCam("VIBRATE_SHAKE", 1.0)
if wait >= 0 then
count = count - 1
if count == 0 then
count = 60
wait = wait - 1
--- in case bark
if GetEntityHealth(myPed) <= 50 then
-- Ped healing
SetEntityHealth(myPed, GetEntityHealth(myPed)+2)
end
end
else
-- Remove red cam
SetTimecycleModifier("")
SetTransitionTimecycleModifier("")
-- Ped Able to die again
SetPlayerInvincible(PlayerId(), false)
knockedOut = false
end
end
end
end)