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
-----------------------
-- RANDOM CRIT --
-----------------------
addhook("hit","RandomCrit")
function RandomCrit(i,s,wp,hpdmg,apdmg)
critdmg = hpdmg * 2
random = math.random(1,100)
if wp == 34 or 35 then
	if random < 21 then
		if smode == 0 then
			hpdmg = critdmg
			if player(i,"health") < hpdmg or player(i,"health") == hpdmg then
				parse('customkill '..s..' "'..itemtype(wp,'name')..'" '..i)
				parse("sv_sound \"DK/headshot.wav\"")
				heads=heads+1
				msg(player(s,"name").." made a Headshot!@C")
			else
				parse("sethealth "..i.." "..player(i,"health")-hpdmg)
			end
			return 1
		end
	end
	if random < 31 then
		if smode == 2 then
			hpdmg = critdmg
			if player(i,"health") < hpdmg or player(i,"health") == hpdmg then
				parse('customkill '..s..' "'..itemtype(wp,'name')..'" '..i)
				parse("sv_sound \"DK/headshot.wav\"")
				heads=heads+1
				msg(player(s,"name").." made a Headshot!@C")
			else
				parse("sethealth "..i.." "..player(i,"health")-hpdmg)
			end
			return 1
		end
	end
	if random < 41 then
		if smode == 3 then
			hpdmg = critdmg
			if player(i,"health") < hpdmg or player(i,"health") == hpdmg then
				parse('customkill '..s..' "'..itemtype(wp,'name')..'" '..i)
				parse("sv_sound \"DK/headshot.wav\"")
				heads=heads+1
				msg(player(s,"name").." made a Headshot!@C")
			else
				parse("sethealth "..i.." "..player(i,"health")-hpdmg)
			end
			return 1
		end
	end
else
	if random < 6 then
		hpdmg = critdmg
		if player(i,"health") < hpdmg or player(i,"health") == hpdmg then
			parse('customkill '..s..' "'..itemtype(wp,'name')..'" '..i)
			parse("sv_sound \"DK/headshot.wav\"")
			heads=heads+1
			msg(player(s,"name").." made a Headshot!@C")
		else
			parse("sethealth "..i.." "..player(i,"health")-hpdmg)
			return 1
		end
	end
end
return 0
end
addhook("select","RandomCritMode")
function RandomCritMode(i,itemtype,mode)
if itemtype == 34 or itemtype == 35 then
smode = mode
end
end