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
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
gold = {}
Levels = {}
Exp = {}
MaxExp = {}
weaponP = {}
weaponS = {}
spawns = {}
usgn = initArray(32)
f18s = {}
supplydrop = {}
Pos = {}
for id = 1, 32 do
Levels[id] = 0
Exp[id] = 0
MaxExp[id] = 350
gold[id] = 10000
weaponP[id] = 34
weaponS[id] = 1
spawns[id] = 0
f18s[id] = 0
supplydrop[id] = 0
end
for none, hook in pairs({"kill", "always", "serveraction","say", "menu"}) do
addhook(hook, hook .. "hook")
end
function killhook(killer)
gold[killer] = gold[killer] + math.random(5,10)
if Exp[killer] < MaxExp[killer] then
Exp[killer] = Exp[killer] + math.random(20,35)
elseif Exp[killer] >= MaxExp[killer] then
Levels[killer] = Levels[killer] + 1
MaxExp[killer] = MaxExp[killer] * 2
msg2(id,"©000255000Congratulations you are now Level " ..Levels[id])
msg("©000255000"..player(id,"name").." is now Level "..Levels[id])
elseif Exp[killer] >= MaxExp[killer] and Levels[killer] > 30 then
Levels[killer] = Levels[killer] + 1
MaxExp[killer] = MaxExp[killer] * 3
msg2(id,"©000255000Congratulations you are now Level " ..Levels[id]) --50th line
msg("©000255000"..player(id,"name").." is now Level "..Levels[id])
end
end
function alwayshook()
for none, id in pairs(player(0, "tableliving")) do
parse("hudtxt2 " .. id .. " 48 \"\169255215000Level: " .. Levels[id] .. "\" 540 348")
parse("hudtxt2 " .. id .. " 49 \"\169255215000Exp: " .. Exp[id] .. "/" .. MaxExp[id] .. "\" 540 388")
parse("hudtxt2 " .. id .. " 47 \"\169255215000Gold: " .. gold[id] .. "\" 540 328")
end
end
function serveractionhook(id, key)
if key == 3 then
menu(id, "Items,Rifles,SMGS,Shotguns,Pistols,Heavies,Equipment,Armor,Special,Use Specials")
end
end
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
function sayhook(id,text)
if (text == "!help") then
msg2(id,"©000255000Press F3 for list of Guns and Items!")
end
end
--SAVING
addhook("minute","saveminute")
function saveminute(id)
if player(id,'usgn') > 0 then
local file = io.open("sys/lua/MoneyLevel Sys/Save/"..player(id,'usgn')..".txt","w")
local value1, value2, value3, value4 = gold[id], Levels[id], Exp[id], MaxExp[id]
file:write(value1.."\n "..value2.."\n "..value3.."\n"..value4)
file:close()
end
end
addhook("spawn","spawnload")
function spawnload(id)
if spawns[id] == 0 then
usgn[id]=player(id,"usgn")
if usgn[id] > 0 then
if file("sys/lua/MoneyLevel Sys/Save/"..player(id,'usgn')..".txt") then
for line in io.lines("sys/lua/MoneyLevel Sys/Save/"..usgn[id]..".txt") do
line = line:split()
local value1 = tonumber(line[1]) --100th line
local value2 = tonumber(line[2])
local value3 = tonumber(line[3])
local value4 = tonumber(line[4])
gold[id]=value1
Levels[id]=value2
Exp[id]=value3
MaxExp[id]=value4
msg2(id, "©000255000Succesfully Loaded!")
spawn[id] = 1
end
else
-- Set player values to 0, save file not found
gold[id] = 0
Levels[id] = 0
Exp[id] = 0
MaxExp[id] = 350
msg2(id, "©255000000Save File Not found!")
end
else
-- No USGN ID found, set player values to 0
gold[id] = 0
Levels[id] = 0
Exp[id] = 0
MaxExp[id] = 350
msg2(id, "©255000000No USGN found!")
end
end
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--MENU
function menuhook(id, title, button)
-- RIFLES,Snipers Page 1
if (title == "Items") then
if (button == 1) then
menu(id, "Rifles,Scout(Level 0),Galil(Level 5),Famas(Level 6),AWP(Level 11),Ak-47(Level 13),SG552(Level 15),,,Next")
--SMGs
elseif (button == 2) then
menu(id, "SMGS,TMP(Level 0),Mac 10(Level 2),MP5(Level 4),UMP45(Level 7),P90(Level 14)")
elseif button == 3 then
menu(id, "Shotguns,M3(Level 0),M4 Benelli(Level 14)")
-- Pistols
elseif (button == 4) then
menu(id, "Pistols,USP(Level 0),Glock(Level 3),Five-Seven(Level 5),P228(Level 7),Elite(Level 9),Deagle(Level 12)")
-- Heavy Weapons
elseif (button == 5) then
menu(id, "Heavies,M249(Level 14),Grenade Launcher(Level 20),M134(Level 23),Flamethrower(Level 25),Rocket Launcher(Level 29),RPG Launcher(Level 33),Laser(Level 75)")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--Equipment
elseif (button == 6) then
menu(id, "Equipment,HE Grenade - Cost 1 Gold,Smoke Grenade - Cost 1 Gold,Flashbang - Cost 2 Gold,Molotov - Cost 2 Gold(Level 5),Gas Grenade - Cost 3(Level 6) Gold,Satchel Charge - Cost 4 Gold(Level 10)")
-- Armor
elseif (button == 7) then
menu(id, "Armor,Kevlar(Level 0),Kevlar+Helm(Level 2),Light Armor(Level 6),Stealth Suit(Level 10),Armor(Level 14),Medic Armor(Level 18),Heavy Armor(Level 23),Super Armor(Level 60)")
-- Special Things
elseif (button == 8) then
menu(id, "Special,Supply Drop|Cost 75 Gold,Airstrike|Cost 180 Gold,F18s|Cost 220 Gold,Predator Drone|Cost 350 Gold,Apache Strike|Cost 450 Gold,Carpet Bombing|Cost 630 Gold,F-22 Rampage|Cost 1000 Gold,Nuke|Cost 3000 Gold")
elseif button == 9 then
menu(id,"Use Specials,Supply Drop|"..supplydrop[id]..",F18 Strike|"..f18s[id]..",Predator Drone")
if (title == "Primary weapons") then
if (button == 9) then
menu(id, "Rifles P:2,Aug(Level 17),SG550(Level 21),G3SG1(Level 23),M4A1(Level 25),FN F2000(Level 28)")
end
end
end
end
end
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
--Spawning with the selected items
addhook("spawn","spawner")
function spawner(id)
return (weaponP[id].." "..weaponS[id])
end
--Items
addhook("menu","Weapons")
function Weapons(id,title,button)
if (title == "Rifles") then
if (button == 1) and Levels[id] > 0 then
WeaponP[id] = 34
elseif (button == 2) and Levels[id] > 5 then
WeaponP[id] = 38
elseif (button == 3) and Levels[id] > 6 then
WeaponP[id] = 39
elseif (button == 4) and Levels[id] > 11 then
WeaponP[id] = 35
elseif (button == 5) and Levels[id] > 13 then
WeaponP[id] = 30
elseif (button == 6) and Levels[id] > 15 then
WeaponP[id] = 31
if (title == "Rifles P:2") then
if (button == 1) and Levels[id] > 17 then
WeaponP[id] = 33 -- 200th line
elseif (button == 2) and Levels[id] > 21 then
WeaponP[id] = 37
elseif (button == 3) and Levels[id] > 23 then
WeaponP[id] = 36
elseif (button == 4) and Levels[id] > 25 then
WeaponP[id] = 32
elseif (button == 5) and Levels[id] > 28 then
WeaponP[id] = 91
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
if title == "SMGS" then
if button == 1 then
WeaponP[id] = 21
elseif button == 2 and Levels[id] > 2 then
WeaponP[id] = 23
elseif button == 3 and Levels[id] > 4 then
WeaponP[id] = 20
elseif button == 4 and Levels[id] > 7 then
WeaponP[id] = 24
elseif button == 5 and Levels[id] > 14 then
WeaponP[id] = 22
if title == "Pistols" then
if button == 1 then
WeaponS[id] = 1
end
end
end
end
end
end
end
--Special Items Menu
addhook("menu","Special")
function Special(id,title,button)
if title == "Special" then
if button == 1 and gold[id] > 75 then
supplydrop[id] = supplydrop[id] + 1
gold[id] = gold[id] - 75
msg2(id,"©255000000You bought Supply Drop for 75 Gold!")
elseif button == 2 and gold[id] > 180 then
parse("equip "..id.." 76")
gold[id] = gold[id] - 180
msg2(id,"©255000000You bought Airstrike flare for 180 Gold!")
elseif button == 3 and gold[id] > 220 then
f18s[id] = f18s[id] + 1
gold[id] = gold[id] - 220
msg2(id,"©255000000You bought F18 Strike for 220 Gold!")
end
end
end
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
--Special Items
addhook("menu","itemstrike")
function itemstrike(id,title,button)
if title == "Use Specials" then
if button == 1 and supplydrop[id] > 0 then
timer(1000,"parse","spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley"))
timer(1500,"parse","spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley"))
timer(2000,"parse","spawnitem 65 "..player(id,"tilex").." "..player(id,"tiley"))
timer(3000,"parse","spawnitem 58 "..player(id,"tilex").." "..player(id,"tiley"))
supplydrop[id] = supplydrop[id] - 1
elseif button == 2 then
Pos = {{math.random(-5,5),math.random(-5,5)},{math.random(-5,5),math.random(-5,5)},{math.random(-5,5),math.random(-5,5)},{math.random(-5,5),math.random(-5,5)}}
for a = 1,#Pos do
local ExplX = player(id,"tilex") + Pos[a][1]
local ExplY = player(id,"tiley") + Pos[a][2]
timer(1000,"parse","explosion "..ExplX.." "..ExplY.." 112 100 "..id)
timer(2000,"parse","explosion "..ExplX.." "..ExplY.." 112 100 "..id)
timer(3000,"parse","explosion "..ExplX.." "..ExplY.." 112 100 "..id)
timer(3000,"parse","explosion "..ExplX.." "..ExplY.." 112 100 "..id)
f18s[id] = f18s[id] - 1
end
end
end
end
end
end