

Custom build script by Rian2 

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
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
-- Custom build script by Rian2_idih is idle print("initializing Build Script") function Array(size,value) 	local array={} 	for i = 1, size do 		array[i]=value 	end 	return array end mmoney = {300,500,1000,2000,3000,1500,5000,5000,5000,nil,10000,15000,3000,3000,16000} print('Set all building limit to 10000!') parse('mp_building_limit "Teleporter Entrance" 10000') print('Set Teleporter Entrance limit to 10000 complete!') parse('mp_building_limit "Teleporter Exit" 10000') print('Set Teleporter Exit limit to 10000 complete!') parse('mp_building_limit Barricade 10000') print('Set Barricade limit to 10000 complete!') parse('mp_building_limit Turret 10000') print('Set Turret limit to 10000 complete!') parse('mp_building_limit "Wall I" 10000') print('Set Wall I limit to 10000 complete!') parse('mp_building_limit "Wall II" 10000') print('Set Wall II limit to 10000 complete!') parse('mp_building_limit "Wall III" 10000') print('Set Wall III limit to 10000 complete!') parse('mp_building_limit Dispenser 10000') print('Set Dispenser limit to 10000 complete!') parse('mp_building_limit "Gate Field" 10000') print('Set Gate Field limit to 10000 complete!') parse('mp_building_limit "Barbed Wire" 10000') print('Set Barbed Wire limit to 10000 complete!') parse('mp_building_limit Supply 10000') print('Set Supply limit to 10000 complete!') print('set all building limit to 10000 complete!') function nomoney(id) 	msg2(id,"©255000000You have insufficient funds@C") end function nobuild(id) 	msg2(id,"©255000000You can't build here@C") end function playertooclose(id) 	msg2(id,"©255000000You can't build here - other players are too close@C") end -- Menu function function objectid8(id) 	menu(id,"Turret,Turret|"..mmoney[8].." $,Dual Turret|"..mmoney[11].." $,Triple Turret|"..mmoney[12].." $") end function objectid9(id) 	menu(id,"Supply,Supply|"..mmoney[9].." $,Super Supply|"..mmoney[15].." $") end xpos=Array(32,0) ypos=Array(32,0) 	 addhook("build","data") function data(id,type,x,y,mode,objectid) 	if type==8 then 		xpos[id] = x 		ypos[id] = y 		objectid8(id) 		return 1 	elseif type==9 then 		xpos[id] = x 		ypos[id] = y 		objectid9(id) 		return 1 	else 		if player(id,"money")>=mmoney[type] then 			parse("spawnobject "..type.." "..x.." "..y.." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 			parse("setmoney "..id.." "..player(id,"money")-mmoney[type]) 			return 1 		end 	end 	return 0 end addhook("buildattempt","fordispenser") function fordispenser(id,type,x,y) 	Tx = player(id,"tilex") 	Ty = player(id,"tiley") 	if type==7 then 		xpos[id]=x 		ypos[id]=y 		if player(id,"money")>=mmoney[7] then 			if Tx==xpos[id]+1 or Tx==xpos[id]-1 or Tx==xpos[id]+1 and Ty==ypos[id]+1 or Tx==xpos[id]+1 and Ty==ypos[id]-1 or Tx==xpos[id]-1 and Ty==ypos[id]+1 or Tx==xpos[id]-1 and Ty==ypos[id]-1 or Ty==ypos[id]+1 or Ty==ypos[id]-1 then 				parse("spawnobject 7 "..x.." "..y.." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 				parse("setmoney "..id.." "..player(id,"money")-mmoney[7]) 			else 				nobuild(id) 			end 		else 			nomoney(id) 		end 	end 	return 1 end addhook("menu","menusys") function menusys(id,men,sel) 	local Tx = player(id,"tilex") 	local Ty = player(id,"tiley") 	if men == "Turret" then 		if sel == 1 then 			if player(id,"money")>=mmoney[8] then 				if Tx==xpos[id]+1 or Tx==xpos[id]-1 or Tx==xpos[id]+1 and Ty==ypos[id]+1 or Tx==xpos[id]+1 and Ty==ypos[id]-1 or Tx==xpos[id]-1 and Ty==ypos[id]+1 or Tx==xpos[id]-1 and Ty==ypos[id]-1 or Ty==ypos[id]+1 or Ty==ypos[id]-1 then 					parse("spawnobject 8 "..xpos[id].." "..ypos[id].." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 					parse("setmoney "..id.." "..player(id,"money")-mmoney[8]) 				else 					nobuild(id) 				end 			else 				nomoney(id) 			end 		end 		if sel == 2 then 			if player(id,"money")>=mmoney[11] then 				if Tx==xpos[id]+1 or Tx==xpos[id]-1 or Tx==xpos[id]+1 and Ty==ypos[id]+1 or Tx==xpos[id]+1 and Ty==ypos[id]-1 or Tx==xpos[id]-1 and Ty==ypos[id]+1 or Tx==xpos[id]-1 and Ty==ypos[id]-1 or Ty==ypos[id]+1 or Ty==ypos[id]-1 then 					parse("spawnobject 11 "..xpos[id].." "..ypos[id].." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 					parse("setmoney "..id.." "..player(id,"money")-mmoney[11]) 				else 					nobuild(id) 				end 			else 				nomoney(id) 			end 		end 		if sel == 3 then 			if player(id,"money")>=mmoney[12] then 				if Tx==xpos[id]+1 or Tx==xpos[id]-1 or Tx==xpos[id]+1 and Ty==ypos[id]+1 or Tx==xpos[id]+1 and Ty==ypos[id]-1 or Tx==xpos[id]-1 and Ty==ypos[id]+1 or Tx==xpos[id]-1 and Ty==ypos[id]-1 or Ty==ypos[id]+1 or Ty==ypos[id]-1 then 					parse("spawnobject 12 "..xpos[id].." "..ypos[id].." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 					parse("setmoney "..id.." "..player(id,"money")-mmoney[12]) 				else 					nobuild(id) 				end 			else 				nomoney(id) 			end 		end 	end 	if men == "Supply" then 		if sel == 1 then 			if player(id,"money")>=mmoney[9] then 				if Tx==xpos[id]+1 or Tx==xpos[id]-1 or Tx==xpos[id]+1 and Ty==ypos[id]+1 or Tx==xpos[id]+1 and Ty==ypos[id]-1 or Tx==xpos[id]-1 and Ty==ypos[id]+1 or Tx==xpos[id]-1 and Ty==ypos[id]-1 or Ty==ypos[id]+1 or Ty==ypos[id]-1 then 					parse("spawnobject 9 "..xpos[id].." "..ypos[id].." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 					parse("setmoney "..id.." "..player(id,"money")-mmoney[9]) 				else 					nobuild(id) 				end 			else 				nomoney(id) 			end 		end 		if sel == 2 then 			if player(id,"money")>=mmoney[15] then 				if Tx==xpos[id]+1 or Tx==xpos[id]-1 or Tx==xpos[id]+1 and Ty==ypos[id]+1 or Tx==xpos[id]+1 and Ty==ypos[id]-1 or Tx==xpos[id]-1 and Ty==ypos[id]+1 or Tx==xpos[id]-1 and Ty==ypos[id]-1 or Ty==ypos[id]+1 or Ty==ypos[id]-1 then 					parse("spawnobject 15 "..xpos[id].." "..ypos[id].." "..player(id,"rot").." 0 "..player(id,"team").." "..id) 					parse("setmoney "..id.." "..player(id,"money")-mmoney[15]) 				else 					nobuild(id) 				end 			else 				nomoney(id) 			end 		end 	end end print("initializing Build Script comleted!")
there no error report when the script is start and when the turret or supply selection clicked