features:
Spoiler
multiple weapon system(missile,bomb,self destruct)
missile destination(click to define)
key system:
W = up
S = down
A = decrease/increase speed
D = increase/decrease speed
Space = Attack
weapon amount system
weapon:
missile
bomb
self destruct
weapon attack delay system
missile destination(click to define)
key system:
W = up
S = down
A = decrease/increase speed
D = increase/decrease speed
Space = Attack
weapon amount system
weapon:
missile
bomb
self destruct
weapon attack delay system
system:
the objective is fix/correct the script, create me the script, and complete the script. i don't have enough time because i need ti write Point System v0.4 and im not smart in CarnageContest lua system. ok, here the script:
Plane by Idlers
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
-- Plane by Idlers if cc==nil then cc={} end cc.plane={} cc.plane.object={} cc.plane.missile={} cc.plane.bomb={} cc.plane.missile.delay=627 -- Load & Prepare Ressources -- Missile, Bomb, Self Destruct cc.plane.ammo={40,20,1) cc.plane.weapon=loadgfx("weapons/f117.bmp") setmidhandle(cc.plane.weapon) cc.plane.homingmissile=loadgfx("weapons/homingmissile.bmp") setmidhandle(cc.plane.homingmissile) cc.plane.airbomb=loadgfx("weapons/fraggrenade.bmp") setmidhandle(cc.plane.airbomb) cc.plane.airbombcluster=loadgfx("weapons/cluster.bmp") setmidhandle(cc.plane.airbombcluster) cc.plane.sound=loadsfx("planerun.wav") -- Weapon: Plane cc.plane.id=addweapon("cc.plane","Plane",cc.plane.weapon,1,4)			-- 1 uses, used at round 4 function cc.plane.draw() 	hudtimer(1,1,3)		-- 1. Missile(click to define target) 2. bomb 3. Self destruct(end turn) 	hudmsgbox("Weapon: 1. Missile 2. bomb 3. Self destruct. Click to define plane height") 	if weapon_shots==0 then 		hudpositioning(pos_normal) 	end 	if weapon_position==1 then 		if getplayerdirection(0)==1 then 			hudinfo("Hit [Space] to launch Plane in the west end of the map!") 		else 			hudinfo("Hit [Space] to launch Plane in the east end of the map!") 		end 	end end function cc.plane.attack(attack) 	if weapon_shots==0 and attack==1 and weapon_position==1 then 		-- No more weapon switching! 		useweapons(0) 		-- Disable player control 		playercontrol(0) 		-- Only one time usable 		weapon_shots=weapon_shots+1 		-- Starting Plane sound 		playsound(cc.plane.sound,1) 		-- Creating Plane 		id=createprojectile(cc.plane.object.id) 		-- No weapon_position. delete this, will cause bug 		weapon_position=0 		plane[id]={} 		plane[id].sx=2 		plane[id].sy=0 		plane[id].player=playercurrent() 		plane[id].sound=3*50 	end end -- Projectile: Plane cc.plane.object.id=addobject("cc.plane.object",cc.plane.weapon) function cc.plane.object.draw(id,x,y) 	setblend(blend_alpha) 	setalpha(1) 	setcolor(255,255,255) 	drawimage(cc.plane.weapon,x,y) 	outofscreenarrow(x,y) end function cc.plane.object.update(id) 	hudinfo("Missile: "..cc.plane.ammo[1].." Bomb: "..cc.plane.ammo[2]) 	if plane[id].health<=0 then 		-- Cause damage 		arealdamage(x,y,250,100) 		-- Destroy terrain 		terrainexplosion(x,y,100,1) 		-- Crater 		grey=math.random(0,40) 		if math.random(0,1)==1 then 			terrainalphaimage(gfx_crater150,x,y,math.random(6,9)*0.1,grey,grey,grey) 		else 			terrainalphaimage(gfx_crater200,x,y,math.random(6,9)*0.1,grey,grey,grey) 		end 		stopchannel(1) 		removeobject(id) 	end 	-- Key system 	if keydown(key_up)==1 then 		plane[id].sy=-0.20 	elseif keydown(key_down)==1 then 		plane[id].sy=0.20 	elseif keydown(key_left)==1 then 		if getplayerdirection(0)==1 then 			plane[id].sx=plane[id].sx-1 			if plane[id].sx==1.2 then 				-- no decrease speed 				plane[id].sx=1.2 			end 		else 			plane[id].sx=plane[id].sx+0.50 			if plane[id].sx==12 then 				plane[id].sx=12 			end 		end 	elseif keydown(key_right)==1 then 		if getplayerdirection(0)==-1 then 			plane[id].sx=plane[id].sx+1 			if plane[id].sx==-1.2 then 				-- no decrease speed 				plane[id].sx=-1.2 			end 		end 	end 	if keydown(key_attack)==1 then 		if weapon_timer==1 then 			missiles=4 			delays=0 			-- Missile 			hudpositioning(pos_normal) 			if missiles>0 and cc.plane.ammo[1]>0 then 				mid=createprojectile(cc.plane.homingmissile.id) 				if weapon_positioning==1 then 					missile[mid]={} 					-- Set initial position of projectile 					missile[mid].x=plane[id].x+(6*getplayerdirection(0))+math.sin(math.rad(getplayerrotation(0)))*10.0 					missile[mid].y=plane[id].y+3-math.cos(math.rad(getplayerrotation(0)))*10.0 					-- Set Timer (time until homing, 1 sec) 					missile[mid].timer=1 					-- Initial movement 					missile[mid].sx=math.sin(math.rad(getplayerrotation(0)))*20 					missile[mid].sy=-math.cos(math.rad(getplayerrotation(0)))*20 					missile[mid].x=missile[mid].x-missile[mid].sx 					missile[mid].y=missile[mid].y-missile[mid].sy 					cc.homing.missile.move(id,0) 					-- Set speed of projectile 					missile[mid].sx=math.sin(math.rad(getplayerrotation(0)))*(100/100.0)*10.0 					missile[mid].sy=-math.cos(math.rad(getplayerrotation(0)))*(100/100.0)*10.0 					-- Effects 					recoil(2) 				elseif weapon_position==0 then 					missile[mid]={} 					-- Set initial position of projectile 					missile[mid].x=getplayerx(0)+(6*getplayerdirection(0))+math.sin(math.rad(getplayerrotation(0)))*10.0 					missile[mid].y=getplayery(0)+3-math.cos(math.rad(getplayerrotation(0)))*10.0 					-- Set Timer (time until homing, 1 sec) 					missile[mid].timer=0 					-- Initial movement 					missile[mid].sx=math.sin(math.rad(getplayerrotation(0)))*20 					missile[mid].sy=-math.cos(math.rad(getplayerrotation(0)))*20 					missile[mid].x=missile[mid].x-missile[mid].sx 					missile[mid].y=missile[mid].y-missile[mid].sy 					cc.homing.missile.move(id,0) 					-- Set speed of projectile 					missile[mid].sx=math.sin(math.rad(getplayerrotation(0)))*(100/100.0)*10.0 					missile[mid].sy=-math.cos(math.rad(getplayerrotation(0)))*(100/100.0)*10.0 					-- Effects 					recoil(2) 				end 				if delays>0 and missiles>0 then missiles=missiles-1 end 				if missiles==0 then delays=50 end 				delays=delays-1 			end 			if delays==0 then missiles=4 end 		elseif weapon_timer==2 then 			-- Bomb 			delays=0 			bombs=5 			if bombs>0 and cc.plane.ammo[2]>0 then 				bid=createprojectile(cc.plane.bomb.id) 				bomb[bid]={} 				-- Ignore collision with current player at beginning 				bomb[bid].ignore=playercurrent() 				-- Set initial position of projectile 				bomb[bid].x=getplayerx(0)+(4*getplayerdirection(0)) 				bomb[bid].y=getplayery(0)+3 				-- Initial collision check (avoid throwing into other objects) 				for i=0,10,1 do 					if collision(col5x5,bomb[id].x+math.sin(math.rad(getplayerrotation(0)))*i,bomb[bid].y-math.cos(math.rad(getplayerrotation(0)))*i)==1 then 						if terraincollision()==1 or objectcollision()>0 or playercollision()~=bomb[bid].ignore then 							if (i==0) then 								bomb[bid].x=getplayerx(0) 								bomb[bid].y=getplayery(0)+3 								break 							else 								bomb[bid].x=getplayerx(0)+(4*getplayerdirection(0))+math.sin(math.rad(getplayerrotation(0)))*(i-1) 								bomb[bid].y=getplayery(0)+3-math.cos(math.rad(getplayerrotation(0)))*(i-1) 								break 							end 						end 					end 				end 				-- Set speed of projectile 				bomb[bid].sx=math.sin(math.rad(getplayerrotation(0)))*(20/100.0)*10.0 				bomb[bid].sy=-math.cos(math.rad(getplayerrotation(0)))*(20/100.0)*10.0 				-- Set timer 				bomb[bid].timer=10 				-- Effects 				recoil(2) 				bombs=bombs-1 			end 			if bombs==0 then delays=50 end 			if delays>0 then delays=delays-1 			if delays==0 then bombs=5 end 		elseif weapon_timer==3 then 			-- Self destruct 			if cc.plane. end -- Projectile: Homing Misile cc.plane.homingmissile.id=addprojectile("cc.plane.homingmissile")				-- Add Projectile function cc.plane.homingmissile.draw() 	setcolor(255,255,255) 	setblend(blend_alpha) 	setalpha(1) 	setscale(plane[id].dir,1) 	 function cc.plane.homingmissile.update(id) 	cc.plane.homingmissile.exp={} 	cc.plane.homingmissile.exp[id]=250 	if cc.plane.homingmissile.exp[id]>0 then 		cc.plane.homingmissile.exp[id]=cc.plane.homingmissile.exp[id]-50 	else 		freeprojectile(id)