Spoiler
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
-------------------------------------------------- -- Call of Duty 2d Script by Bobb1118 -- -- Edited GunGame Script by UnrealSoftware -- -------------------------------------------------- if sample==nil then sample={} end sample.lvl={} sample.ads={} sample.classes={} sample.sayfuncs={} ----------------------- -- Initial Setup -- ----------------------- function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end ----------------------- -- InitArrays -- ----------------------- -- Classes sample.classes.class=initArray(32) -- Experience sample.lvl.kills=initArray(32) -- Level sample.lvl.level=initArray(32) ----------------------- -- Game Settings -- ----------------------- parse("sv_gamemode 1")		-- Deathmatch parse("mp_randomspawn 1")	-- Random Spawning -------------------------------------- -- Welcome Message -- -------------------------------------- addhook("join","sample.ads.join") function sample.ads.join(p) 	msg2(p,"Welcome to COD2d, "..player(p,"name").."!") end ----------------------- -- Class Menu -- ----------------------- function sample.classes.classmenu(id) 	menu(id,"Select your Class,Grenadier|Famas,First Recon|UMP45,Overwatch|M249,Scout Sniper|Scout,Riot Control|Tactical Shield")	 end ----------------------- -- Team -> Class -- ----------------------- addhook("team","sample.classes.team") function sample.classes.team(id,team) 	if (team>0) then 		sample.classes.classmenu(id) 	end end ----------------------- -- Server Action -- ----------------------- addhook("serveraction","sample.classes.serveraction") function sample.classes.serveraction(id) 	sample.classes.classmenu(id) end ----------------------- -- Class Selection -- ----------------------- addhook("menu","sample.classes.menu") function sample.classes.menu(id,menu,sel) 	if (menu=="Select your Class") then 		if (sel>=0 and sel<=5) then 			sample.classes.class[id]=sel 			if (player(id,"health")>0) then 				parse("killplayer "..id) 			end 		end 	end end ----------------------- -- Spawn -- ----------------------- addhook("spawn","sample.classes.spawn") function sample.classes.spawn(id) 	-- Grenadier 	if (sample.classes.class[id]<=1) then 	 parse ("setarmor "..id.." 100") 		return "5,51,53,39"; 	end 	-- First Recon 	if (sample.classes.class[id]==2) then 	 parse ("setarmor "..id.." 100") 		return "5,51,53,24"; 	end 	-- Overwatch 	if (sample.classes.class[id]==3) then 	 parse ("setarmor "..id.." 100") 		return "45,51,53,40"; 	end 	-- Scout Sniper 	if (sample.classes.class[id]==4) then 		parse ("setarmor "..id.." 100") 		return "5,51,53,34"; 	end 	-- Riot Control 	if (sample.classes.class[id]==5) then 	 parse ("setarmor "..id.." 100") 		return "6,51,53,41"; 	end end ----------------------- -- No Buying -- ----------------------- addhook("buy","sample.classes.buy") function sample.classes.buy() 	return 1 end -------------------------------------- -- Say Functions -- -------------------------------------- addhook("say","sample.sayfuncs.say") function sample.sayfuncs.say(p,txt) 	-- Time 	if (txt=="time!") then msg(os.date("Time: %I:%M %p")); end 	 	-- Level Check (THIS DOES NOT WORK YET) 	if (txt=="level!") then 	parse('hudtxt 2 "Level: "sample.lvl.level[id]" 320 260 1') 	parse('hudtxtalphafade 0 2 5000 0.0') 	end 	 end --------------------------------------------------- -- Experience and Leveling -- --------------------------------------------------- addhook("kill","sample.lvl.kill") function sample.lvl.kill(id) 	-- Add Experience for Kill 	sample.lvl.kills[id]=sample.lvl.kills[id]+1 	-- Text Callout (+100 xp) 	parse('hudtxt 2 "Kill +100 exp" 320 260 1') 	parse('hudtxtalphafade 0 2 2000 0.0') 	-- Next Level (every 5 kills) 	if (sample.lvl.kills[id]>=5) then 		-- Increase Level 		sample.lvl.level[id]=sample.lvl.level[id]+1 		-- Reset Experience 		sample.lvl.kills[id]=0 		-- Text Callout (level+1) 		parse('hudtxt 2 "Level up!" 320 260 1') 		parse('hudtxtalphafade 0 2 5000 0.0') 	end 	-- If this level is higher then 80 	if sample.lvl.level[id]>80 then 	 -- Then reset the level to 80 sample.lvl.level[id]=80 	end end -------------------------------------- -- Level / Kills Bar -- -------------------------------------- addhook("second","sample.ads.second") function sample.ads.second() 	msg2(id,"Level: "..sample.lvl.level[id].." Kills: "..sample.lvl.kills[id]) end