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
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
-- Projectiles Stuff Example -- -- Lua Scripting Tutorial Example obj = {x = {}, y = {}, rot = {}, img = {}, id = {}} -- Making a table for objects list -- Object Tables: -- x & y - possition -- rot - direction of flying -- img - table for images -- id - Owner (player) of object -- Adding hooks, simple as always! addhook("always","obj_update") -- Can be used in "ms100" hook addhook("attack","obj_add") function obj_remove(id) -- Remove Object Function 	local k, v -- Locals 	if obj.img[id] then freeimage(obj.img[id]) end -- Remove image if it's exists in table 	for k, v in pairs(obj) do table.remove(obj[k], id) end -- Remove all elements of those tables index 	-- k - key 	-- v - index end function obj_add(p) -- Add Object Into Map On Attacking 	local x , y, rot , id = player(p,"x"), player(p,"y"), player(p,"rot") -- Locals declaring 	id = image("gfx/sprites/flare2.bmp",x,y,1) -- Loading Image 	imageblend(id, 1) -- Light mode for image 	table.insert(obj.img, id) -- adding obj.imloaded image ID into table 	table.insert(obj.x, x) 	table.insert(obj.y, y) 	table.insert(obj.id, p) 	table.insert(obj.rot, rot) -- dirrection = player rotation end function obj_update() 	local del, id, n = {} 	for id, n in pairs(obj.img) do 		obj.x[id] = obj.x[id] + math.cos(math.rad(obj.rot[id] - 90)) * 10 -- updating obj x according direction 		obj.y[id] = obj.y[id] + math.sin(math.rad(obj.rot[id] - 90)) * 10 -- updating obj y according direction 		imagepos(n, obj.x[id], obj.y[id], obj.rot[id]) -- seting new image possition 		if tile( math.ceil(obj.x[id] / 32) - 1, math.ceil(obj.y[id] / 32) - 1, "wall") then -- check for wall colliding 			parse("explosion "..obj.x[id].." "..obj.y[id].." 50 250 "..obj.id[id]) -- explosion 			table.insert(del, id) -- adding object to delete list 		end 	end 	for id, n in ipairs(del) do obj_remove(n) end -- Removing objects from delete list end