The Fun Zombie Mode script gives you random weapons and perks every round, to make the game interesting .
Every perk is listed on perks={"x","y","k"} at the beginning of the script and every perk "power" is listed at the middle of the script with a if
if perks[perk]=="x" then
(perk effects)
When i try to make a custom perk, it works very well with speedmods and setmaxhealth, but when i do parse("equip "..id.." (itemid)"), every perk AFTER my custom script don't work...
Original Script:
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
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
--Fun Zombie Mode Gamemode Script --For CS2D --by Bolt_PL --Enjoy & edit, but don't say it's yours - add me in credits ;-) parse("sv_friendlyfire 0") parse("sv_gamemode 5")		--Zombies! gamemode parse("mp_infammo 1") 		--infinite ammo enabled parse("mp_killinfo 0")		--there would be to many messages parse("mp_autoteambalance 1")	--fair game parse("mp_deathdrop 4")		--no death dropping --survivors weapons={11,20,22,24,30,33,32,33,36,38,40,46,47,91} items={69,72,73,76,85,87,89,77} regular_items={3,50,51,74,82}					--write 50 for knife! --zombies zombies_regular_items={78,86}				--write 78 for claw! zombies_items={69,75,80} --other perks={"hp+","sp+","hp-","sp-","nv","no","no"} addhook("spawn","equip") function equip(id) 	parse("setmaxhealth "..id.." 100") 	parse("speedmod "..id.." 0") 	parse("strip "..id.." 0") 	if player(id,"team")==1 then 		for i=1,#zombies_regular_items do 			if zombies_regular_items[i]<=91 and zombies_regular_items[i]~=nil then 				parse("equip "..id.." "..zombies_regular_items[i].."") 			end 		end 		local zm_item=math.random(1,#zombies_items) 		if zombies_items[zm_item]<=91 and zombies_items[zm_item]~=nil then 			parse("equip "..id.." "..zombies_items[zm_item].."") 		end 		 	elseif player(id,"team")==2 then 		for i=1,#regular_items do 			if regular_items[i]<=91 and regular_items[i]~=nil then 				parse("equip "..id.." "..regular_items[i].."") 			end 		end 		local weapon=math.random(1,#weapons) 		if weapons[weapon]<=91 and weapons[weapon]~=nil then 			parse("equip "..id.." "..weapons[weapon].."") 		end 		local item=math.random(1,#items) 		if items[item]<=91 and items[item]~=nil then 			parse("equip "..id.." "..items[item].."") 		end 	end 	local perk=math.random(1,#perks) 	if perks[perk]=="hp+" then 		msg2(id,"©255000255 #Perk: Health+") 		parse("setmaxhealth "..id.." 125") 	elseif perks[perk]=="sp+" then 		msg2(id,"©255000255 #Perk: Speed+")		 		parse("speedmod "..id.." 5") 	elseif perks[perk]=="hp-" then 		msg2(id,"©255000255 #Perk: Health-")		 		parse("setmaxhealth "..id.." 75") 	elseif perks[perk]=="sp-" then 		msg2(id,"©255000255 #Perk: Speed-")		 		parse("speedmod "..id.." -5") 	elseif perks[perk]=="nv" then 		msg2(id,"©255000255 #Perk: Nightvision")		 		return "59" 	elseif perks[perk]=="no" then 		msg2(id,"©255000255 #Perk: No Perk") 	elseif perks[perk]==nil then 		print("©255000000 [FZM]: PERK ERROR") 	end end addhook("buy","buying") function buying(id) 	return 1 end addhook("buildattempt","build") function build(id,type,x,y) 	if type~=8 then 		if player(id,"weapontype")==74 then 			parse("spawnobject "..type.." "..x.." "..y.." 0 1 "..player(id,"team").." "..id.."") 			return 1 		end 	else 		return 0 	end end
What i want to do in perk area (equip player)
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
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
if perks[perk]=="hp+" then 		msg2(id,"©255000255 #Perk: Health+") 		parse("setmaxhealth "..id.." 125") 	elseif perks[perk]=="sp+" then 		msg2(id,"©255000255 #Perk: Speed+")		 		parse("speedmod "..id.." 5") 	elseif perks[perk]=="hp-" then 		msg2(id,"©255000255 #Perk: Health-")		 		parse("setmaxhealth "..id.." 75") elseif perks[perk]=="nemesis" and if player(id,"team")==1 then 	msg2(id,"©15300	 # You are Nemesis") 	msg("©15300	>>>"..player(id,"name").." is Nemesis! Beware!") parse("setmaxhealth "..id.." 250") parse("speedmod "..id.." -9") 			 parse("equip "..id.." 82") 			 parse("equip "..id.." 72") parse("equip "..id.." 47") parse("setweapon "..id.." 47") elseif perks[perk]=="nemesis" and player(id,"team")==2 then msg2(id,"©000FF6633 # You're the Legendary Survivor! No one can beat you!") msg("©000FF6633	>>>"..player(id,"name").." is the Legendary Survivor") parse("setmaxhealth "..id.." 125") parse("speedmod "..id.." 5") parse("equip "..id.." 90") parse("equip "..id.." 82") parse("equip "..id.." 91") parse("equip "..id.." 48") parse("equip "..id.." 40") parse("equip "..id.." 46") parse("equip "..id.." 36") 	end end 	elseif perks[perk]=="sp-" then 		msg2(id,"©255000255 #Perk: Speed-")		 		parse("speedmod "..id.." -5") 	elseif perks[perk]=="nv" then 		msg2(id,"©255000255 #Perk: Nightvision")		 		return "59" 	elseif perks[perk]=="no" then 		msg2(id,"©255000255 #Perk: No Perk") 	elseif perks[perk]==nil then 		print("©255000000 [FZM]: PERK ERROR")
As a very newbie lua scripter, i'm sure i did something wrong... Can you guys help me ?
2× editiert, zuletzt 09.08.12 05:06:38