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
Player = {}
addhook("join","_join")
function _join(id)
	Player[id] = {level = 1, exp = 0, expneeded = 100}
end
addhook("kill","_kill")
function _kill(killer,victim,weapon,x,y)
	Player[killer].exp = Player[killer].exp + 5
	if Player[killer].exp >= Player[id].expneeded then
		Player[killer].level = Player[killer].level + 1
	end
end
addhook("ms100","_ms100")
function _ms100()
	for _,id in ipairs(player(0,"tableliving")) do
		parse('hudtxt2 '..id..' 1 "©255255255Exp: '..Player[id].exp..'/'..Player[id].expneeded..'" 350 350')
		parse('hudtxt2 '..id..' 2 "©255255255Level: '..Player[id].level..'" 350 370')
	end
end
addhook("serveraction","_action")
function _action(id,action)
	if action == 1 then
		menu(id,"Turrets,Level 1,Level 2,Level 3,Level 4,Level 5,Level 6,Level 7,Level 8,Next")
	end
end
addhook("menu","_menu")
function _menu(id,title,button)
	if title == "Turrets" then
		if button == 1 then
			parse("spawnobject 8 "..(player(id,"tilex")-3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
		elseif button == 2 then
			if Player[id].level >= 2 then
				parse("spawnobject 8 "..(player(id,"tilex")-3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
				parse("spawnobject 8 "..(player(id,"tilex")+3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
			end
		elseif button == 3 then
			if Player[id].level >= 3 then
				parse("spawnobject 8 "..(player(id,"tilex")-3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
				parse("spawnobject 8 "..(player(id,"tilex")+3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
				parse("spawnobject 8 "..(player(id,"tilex")+3).." "..(player(id,"tiley")+3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
			end
		elseif button == 4 then
			if Player[id].level >= 4 then
				parse("spawnobject 8 "..(player(id,"tilex")-3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
				parse("spawnobject 8 "..(player(id,"tilex")+3).." "..(player(id,"tiley")-3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
				parse("spawnobject 8 "..(player(id,"tilex")+3).." "..(player(id,"tiley")+3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
				parse("spawnobject 8 "..(player(id,"tilex")-3).." "..(player(id,"tiley")+3).." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
			end
		end
	end
end