I ask this because I'm creating a RPG_tibia, and I want to add a new monster and the document is saved in another file type.
I hope I help
Spoiler
and the monster is this
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
Monster = {name = 'Monster', health = 100, image = 'gfx/weiwen/circle.png', scalex = 1, scaley = 1, atk = 1, def = 1, spd = 5, x = 0, y = 0, ang = 0, imgang = 0, exp = 5, money = 50, type = 'monster', loot = {}} MONSTERS = {} local t = 0 CONFIG.MONSTERS = { 	{ 		name = 'Zombie Robot', health = 260, image = 'gfx/weiwen/pokemon/zm.png', scalex = 2, scaley = 2, 		atk = 1.2, def = 1.2, spd = 10, atkspd = 7, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 50, runat = 20, spawn1 = {0, 0}, spawn2 = {110, 125}, 		exp = 20, money = 150, loot = {}, 		spc = {500, function(self) 			radiusmsg("Zombie Giant uses sand attack!", self.x, self.y) 			parse('flashposition ' .. self.x .. ' ' .. self.y .. ' 100') 		end}, 	}, 	{ 		name = 'Mummy', health = 100, image = 'gfx/weiwen/pokemon/216.png', scalex = 1, scaley = 1, 		atk = 1.0, def = 1.0, spd = 9, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 100, runat = 20, spawn1 = {0, 0}, spawn2 = {110, 125}, 		exp = 7, money = 50, loot = {}, 	}, 	{ 		name = 'Dongo', health = 200, image = 'gfx/weiwen/pokemon/500.png', scalex = 1, scaley = 1, 		atk = 1.4, def = 1.0, spd = 10, atkspd = 7, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 50, runat = 20, spawn1 = {0, 0}, spawn2 = {110, 125}, 		exp = 20, money =120, loot = {}, 		spc = {2500, function(self, id, dist) 			if not self.agility then 				radiusmsg("Dongo uses dark!", self.x, self.y) 				parse("effect \"colorsmoke\" " .. self.x .. " " .. self.y .. " 5 5 000 000 000") 				radiussound("weapons/g_flash.wav", self.x, self.y) 				self.spd = 10 				self.agility = true 				imagecolor(self.image, 155, 255, 155) 				addtimer(5000, function(self) 					self.spd = 10 					imagecolor(self.image, 255, 255, 255) 					self.agility = nil 				end, self) 			elseif dist <= 32 then 				self:hit(id, 10) 			end 		end}, 	}, 	{ 		name = 'Djin', health = 100, image = 'gfx/weiwen/pokemon/e3.png', scalex = 2, scaley = 2, 		atk = 2.2, def = 1.8, spd = 7, atkspd = 8, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 25, runat = 0, spawn1 = {2, 85}, spawn2 = {25, 105}, 		exp = 10, money = 100, loot = {}, 		spc = {500, function(self, id, dist) 			radiusmsg("Djin uses flamethrower!", self.x, self.y) 			local x1, y1 = self.x, self.y 			local rot = math.atan2(player(id, 'y')-y1, player(id, 'x')-x1) + math.pi/2 			local x2, y2 = math.sin(rot), -math.cos(rot) 			local fire = image("gfx/sprites/spot.bmp", 0, 0, 1) 			imagepos(fire, x1+x2*64, y1+y2*64, math.deg(rot)+180) 			imagescale(fire, 1.5, 2) 			imagecolor(fire, 255, 64, 0) 			imageblend(fire, 1) 			addtimer(500, freeimage, fire) 			parse('explosion ' .. x1+x2*100 .. ' ' .. y1+y2*100 .. ' 48 40') 			parse('explosion ' .. x1+x2*50 .. ' ' .. y1+y2*50 .. ' 32 40') 		end}, 	}, 	{ 		name = 'Drakon', health = 100, image = 'gfx/weiwen/pokemon/e2.png', scalex = 2, scaley = 2, 		atk = 2.5, def = 1.8, spd = 10, atkspd = 6, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 20, runat = 0, range = 48, spawn1 = {132, 2}, spawn2 = {197, 67}, 		exp = 100, money = 240, loot = {}, 		spc = {1000, function(self, id, dist) 			if not self.rage then 				radiusmsg("Drakon uses rage!", self.x, self.y) 				parse("effect \"colorsmoke\" " .. self.x .. " " .. self.y .. " 5 5 255 155 155") 				radiussound("weapons/g_flash.wav", self.x, self.y) 				self.def = 3.3 				self.rage = true 				imagecolor(self.image, 255, 155, 155) 				addtimer(5000, function(self) 					self.atk = 2.2 					imagecolor(self.image, 255, 255, 255) 					self.rage = nil 				end, self) 			elseif dist <= 96 then 				radiusmsg("Mankey uses karate chop!", self.x, self.y) 				self:hit(id, 20) 			end 		end}, 	}, 	{ 		name = 'Robot', health = 125, image = 'gfx/weiwen/pokemon/e20.png', scalex = 1, scaley = 1, r = 64, g = 128, b = 0, 		atk = 1.8, def = 5.0, spd = 3, atkspd = 10, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 15, runat = 0, range = 64, spawn1 = {36, 5}, spawn2 = {58, 18}, 		exp = 200, money = 1000, loot = {{chance = 1500, id = 310},{chance = 1500, id = 311},{chance = 1500, id = 312},{chance = 1500, id = 313},{chance = 1500, id = 314},{chance = 1500, id = 315},{chance = 1500, id = 316}}, 		spc = {1000, function(self) 			if not self.harden then 				radiusmsg("Vetronos uses harden!", self.x, self.y) 				parse("effect \"colorsmoke\" " .. self.x .. " " .. self.y .. " 5 5 192 192 192") 				radiussound("weapons/g_flash.wav", self.x, self.y) 				self.def = 7.5 				self.harden = true 				imagecolor(self.image, 155, 155, 255) 				addtimer(5000, function(self) 					self.def = 5 					imagecolor(self.image, 255, 255, 255) 					self.harden = nil 				end, self) 			end 		end}, 	}, 	{ 		name = 'Demon', health = 200, image = 'gfx/weiwen/pokemon/e16.png', scalex = 3, scaley = 3, r = 128, g = 0, b = 0, 		atk = 3.6, def = 2.0, spd = 5, atkspd = 15, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 15, runat = 0, range = 80, spawn1 = {163, 3}, spawn2 = {187, 21}, 		exp = 240, money = 1200, loot = {{chance = 1000, id = 327},{chance = 1000, id = 328},{chance = 1000, id = 329},{chance = 1000, id = 330},{chance = 250, id = 331},{chance = 250, id = 332},{chance = 250, id = 333},{chance = 250, id = 334},{chance = 250, id = 335}}, 		spc = {60, function(self, id, dist) 			radiusmsg("Demon uses flamethrower!", self.x, self.y) 			local x1, y1 = self.x, self.y 			local rot = math.atan2(player(id, 'y')-y1, player(id, 'x')-x1) + math.pi/2 			local x2, y2 = math.sin(rot), -math.cos(rot) 			local fire = image("gfx/sprites/spot.bmp", 0, 0, 1) 			imagepos(fire, x1+x2*64, y1+y2*64, math.deg(rot)+180) 			imagescale(fire, 1.5, 2) 			imagecolor(fire, 255, 64, 0) 			imageblend(fire, 1) 			addtimer(500, freeimage, fire) 			parse('explosion ' .. x1+x2*100 .. ' ' .. y1+y2*100 .. ' 120 40') 			parse('explosion ' .. x1+x2*50 .. ' ' .. y1+y2*50 .. ' 100 40') 		end}, 	}, 	{ 		name = 'Derevo', health = 300, image = 'gfx/weiwen/pokemon/e17.png', scalex = 2, scaley = 2, 		atk = 8, def = 3.0, spd = 12, atkspd = 15, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 15, runat = 0, range = 48, spawn1 = {84, 6}, spawn2 = {90, 13}, 		exp = 150, money = 1500, loot = {{chance=1000,id=336},{chance=1000,id=337},{chance=1000,id=338},{chance=1000,id=339}}, 		spc = {500, function(self, id, dist) 			parse('explosion ' .. self.x .. ' ' .. self.y .. ' 10 -40') 			parse("effect \"colorsmoke\" " .. self.x .. " " .. self.y .. " 5 5 0 255 255") 			radiusmsg("Berserker heal himself!", self.x, self.y) 			radiussound("muhaha.wav", self.x, self.y) 		end}, 	}, 	{ 		name = 'Boss Giant Ork', health = 6000, image = 'gfx/weiwen/pokemon/e4.png', scalex = 3, scaley = 3, 		atk = 6, def = 3.2, spd = 9, atkspd = 13, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 0, range = 48, spawn1 = {17, 177}, spawn2 = {26, 187}, 		exp = 10000, money = 23000, loot = {{chance = 1000, id = 1}}, 		spc = {500, function(self, id, dist) 			local range,dmg,erange,rept,gr,xx,yy = 300,15,128,math.random(10,20),0,self.x,self.y 			radiusmsg("Ork giant monster casts a dark storm.", self.x, self.y) 			radiussound("materials/glass3.wav", self.x, self.y) 			repeat 				xx,yy=self.x,self.y 				xx=xx+math.random(1,range)-math.random(1,range) 				yy=yy+math.random(1,range)-math.random(1,range) 				parse('explosion ' .. xx .. ' ' .. yy .. ' ' .. erange .. ' ' .. dmg .. ' 0') 				parse("effect \"colorsmoke\" "..xx.." "..yy.." 100 96 0 0 0") 				radiussound("cs2d_tibia/blizz.ogg", self.x, self.y) 				gr = gr + 1 			until gr >= rept 		end}, 	}, 	{ 		name = 'Monster of Water', health = 15000, image = 'gfx/weiwen/pokemon/e15.png', scalex = 3, scaley = 3, 		atk = 3.0, def = 3.0, spd = 20, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 20, spawn1 = {56, 181}, spawn2 = {63, 185}, 		exp = 25000, money = 70000, loot = {{ chance = 1500 , id = 458},{ chance = 1500 , id = 459},{ chance = 1500 , id = 460},{ chance = 1500 , id = 461}}, 	}, 	{ 		name = 'Ice Dragon', health = 24555, image = 'gfx/H4LOW33N/monster ice/5.png', scalex = 3, scaley = 3, 		atk = 3.0, def = 3.0, spd = 20, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 20, spawn1 = {5, 205}, spawn2 = {10, 210}, 		exp = 34555, money = 78200, loot = {{ chance = 1500 , id = 458},{ chance = 1500 , id = 459},{ chance = 1500 , id = 460},{ chance = 1500 , id = 461}}, 	}, 	{ 		name = 'Faire Boss', health = 10000, image = 'gfx/weiwen/pokemon/e21.png', scalex = 3, scaley = 3, 		atk = 3.0, def = 3.0, spd = 20, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 20, spawn1 = {100, 109}, spawn2 = {110, 111}, 		exp = 20000, money = 60000, loot = {{chance = 1500, id = 453},{ chance = 1500 , id = 451},{ chance = 1500 , id = 457},{ chance = 1500 , id = 452},{ chance = 1500 , id = 455}}, }, 	{ name = 'Mini Faire Boss', health = 9000, image = 'gfx/weiwen/pokemon/e21.png', scalex = 1, scaley = 1, 		atk = 3.0, def = 3.0, spd = 20, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 20, spawn1 = {100, 109}, spawn2 = {110, 111}, 		exp = 18000, money = 50000, loot = {{chance = 1500, id = 453},{ chance = 1500 , id = 451},{ chance = 1500 , id = 457},{ chance = 1500 , id = 452},{ chance = 1500 , id = 455}}, }, { name = 'Omega boss', health = 500000, image = 'gfx/weiwen/pokemon/163.png', scalex = 5, scaley = 5, 		atk = 3.0, def = 3.0, spd = 20, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 20, spawn1 = {28, 136}, spawn2 = {35, 143}, 		exp = 2000000, money = 10000000, loot = {}, 	}, } addhook("attack", "MONSTERattack") function MONSTERattack(id) 	if gettile(PLAYERS[id].x, PLAYERS[id].y).SAFE then 		return 	end 	if inarray({400, 401, 402, 403, 404, 335}, PLAYERS[id].Equipment[7]) then 		message(id, "You may not attack on a horse.") 		return 	end 	local weapon, closest = player(id, 'weapontype') 	for _, m in ipairs(MONSTERS) do 		local x, y = player(id, 'x'), player(id, 'y') 		local dist = math.sqrt((m.x-x)^2+(m.y-y)^2) 		if dist <= (closest and closest[2] or (CONFIG.WEAPONRANGE[weapon] or CONFIG.WEAPONRANGE[50])) then 			local rot = player(id, 'rot') 			if math.abs(math.rad(rot) - math.atan2(y-m.y, x-m.x) + math.pi/2)%(2*math.pi) <= (CONFIG.WEAPONWIDTH[weapon] or CONFIG.WEAPONRANGE[50]) then 				closest = {m, dist} 			end 		end 	end 	if closest then 		closest[1]:damage(id, math.ceil(20*((PLAYERS[id].Level+50)*PLAYERS[id].tmp.atk/closest[1].def)/math.random(60, 140)), weapon) 	end end addhook("ms100", "MONSTERms100") function MONSTERms100() 	t = t + 1 	if t % 100 == 0 then 		while #MONSTERS < CONFIG.MAXMONSTERS do 			local rand 			repeat 				rand = math.random(#CONFIG.MONSTERS) 			until math.random(0, 100) < CONFIG.MONSTERS[rand].spawnchance 			local m = deepcopy(CONFIG.MONSTERS[rand]) 			local x, y, tilex, tiley 			repeat 				if m.spawn1 then 					tilex, tiley = math.random(m.spawn1[1], m.spawn2[1]), math.random(m.spawn1[2], m.spawn2[2]) 				else 					tilex, tiley = math.random(map'xsize'), math.random(map'ysize') 				end 			until not gettile(tilex, tiley).SAFE and not gettile(tilex, tiley).PVP and tile(tilex, tiley, "walkable") and tile(tilex, tiley, "frame") ~= 34 			m.x, m.y = math.floor(tilex*32+16), math.floor(tiley*32+16) 			Monster:new(m) 		end 	end 	for _, m in ipairs(MONSTERS) do 		if t % m.atkspd == 0 then 			m.target = nil 			local closest 			for _, p in ipairs(table.shuffle(player(0, 'table'))) do 				if player(p, 'health') > 0 and not gettile(PLAYERS[p].x, PLAYERS[p].y).SAFE then 					local dist = math.sqrt((player(p, 'x')-m.x)^2 + (player(p, 'y')-m.y)^2) 					if dist < 400 then 						if not closest or dist < closest[2] then 							closest = {p, dist} 						end 					end 				end 			end 			if closest then 				local dist = closest[2] 				if dist < 400 then 					m.target = closest[1] 					if m.spc and math.random(10000) <= m.spc[1] then 						m.spc[2](m, m.target, dist) 					elseif dist <= (m.range or 32) then 						m:hit(m.target, 10) 					end 				end 			end 		end 		m.imgang = math.sin(t/2.5*math.pi) * 15 		if m.target and player(m.target, 'exists') and player(m.target, 'health') > 0 and not gettile(PLAYERS[m.target].x, PLAYERS[m.target].y).SAFE then 			xdist, ydist = player(m.target, 'x') - m.x, player(m.target, 'y') - m.y 			local dist = math.sqrt(xdist^2 + ydist^2) 			if dist < 400 then 				m.ang = math.atan2(ydist, xdist)-math.pi/2+math.random(-1, 1)/2 			else 				m.target = nil 			end 		end 		if not m.target then 			m:rot(math.random(-1, 1)/2) 		end 		if not m:move(m:rot(), m.health > m.runat and 1 or -1) then 			repeat until m:move(math.rad(math.random(360)), 1) 		end 	end end function Monster:new(m) 	if not (m.x or m.y) then return false end 	m.image = image(m.image, m.x, m.y, 0) 	imagescale(m.image, m.scalex, m.scaley) 	setmetatable(m, self) 	self.__index = self 	table.insert(MONSTERS, m) 	m.id = #MONSTERS 	return m end function Monster:pos(x, y) 	if not x and not y then 		return self.x, self.y 	else 		self.x, self.y = x or self.x, y or self.y 		imagepos(self.image, self.x, self.y, self.imgang) 	end 	return true end function Monster:move(dir, amt) 	local x, y = -math.sin(dir)*amt*self.spd, math.cos(dir)*amt*self.spd 	local x, y = self.x+x, self.y+y 	local tilex, tiley = math.floor(x/32), math.floor(y/32) 	if tile(tilex, tiley, 'walkable') and tile(tilex, tiley, 'frame') ~= 34 and not gettile(tilex, tiley).SAFE then 		self:pos(x, y) 		return true 	else 		self:rot(math.random(-1, 1)*math.pi/2) 		return false 	end end function Monster:damage(id, dmg, wpntype) 	if not PLAYERS[id].Tutorial.damagem then 		message(id, "You have attacked a monster! Good job! Keep on attacking it until it dies.", "255128000") 		PLAYERS[id].Tutorial.damagem = true 	end 	local wpnName 	if weapon == 251 then 		wpnName = 'rune' 	elseif weapon == 46 then 		wpnName = 'firewave' 		dmg = dmg/5 	else 		wpnName = PLAYERS[id].Equipment[3] and ITEMS[PLAYERS[id].Equipment[3]].name or 'dagger' 	end 	self.health = self.health - dmg 	--print(player(id, 'name') .. ' deals ' .. dmg .. ' damage to ' .. self.name .. ' usng a ' .. wpnName .. '.') 	if self.health <= 0 then 		if not PLAYERS[id].Tutorial.killm then 			message(id, "Congratulation! You have killed your first monster. You can proceed to pick up the loot by using the drop weapon button (default G)", "255128000") 			PLAYERS[id].Tutorial.killm = true 		end 		addexp(id, math.floor(self.exp*CONFIG.EXPRATE)) 		self:die() 	else 		parse('effect "colorsmoke" ' .. self.x .. ' ' .. self.y .. ' 0 ' .. self.scaley .. ' ' .. (self.r and (self.r .. ' ' .. self.g .. ' ' .. self.b) or '192 0 0')) 	end 	radiussound("weapons/machete_hit.wav", self.x, self.y) 	return true end function Monster:hit(id, dmg) 	if not PLAYERS[id].Tutorial.hitm then 		message(id, "A monster is attacking you! You can fight back by swinging your weapon at it.", "255128000") 		PLAYERS[id].Tutorial.hitm = true 	end 	if player(id, 'weapontype') == 41 and (math.abs(math.rad(player(id, 'rot')) - math.atan2(player(id, 'y')-self.y, player(id, 'x')-self.x) + math.pi/2)%(2*math.pi) <= math.pi*2/3) then 		EXPhit(id, self, -1, dmg/4) 		radiussound("weapons/ricmetal" .. math.random(1,2) .. ".wav", self.x, self.y) 	else 		EXPhit(id, self, -1, dmg) 		radiussound("weapons/knife_hit.wav", self.x, self.y) 	end 	return true end function Monster:die(id) 	local size = self.scalex+self.scaley 	parse('effect "colorsmoke" ' .. self.x .. ' ' .. self.y .. ' ' .. size .. ' 64 ' .. (self.r and (self.r .. ' ' .. self.g .. ' ' .. self.b) or '192 0 0')) 	local tilex, tiley = math.floor(self.x/32), math.floor(self.y/32) 	spawnitem(1337, tilex, tiley, math.floor(self.money*math.random(50, 150)/100)*CONFIG.MONEYRATE) 	for _, loot in ipairs(self.loot) do 		local chance = math.random(10000) 		if chance <= loot.chance then 			spawnitem(loot.id, tilex, tiley) 		end 	end 	radiussound("weapons/c4_explode.wav", self.x, self.y) 	self:destroy() end function Monster:destroy() 	freeimage(self.image) 	local found 	table.remove(MONSTERS, self.id) 	for i, m in ipairs(MONSTERS) do 		m.id = i 	end 	return true end function Monster:rot(rot) 	if not rot then 		return self.ang 	else 		self.ang = (self.ang+rot)%(math.pi*2) 	end 	return true end
and the monster is this
1
2
3
4
5
2
3
4
5
name = 'Ice Dragon', health = 24555, image = 'gfx/H4LOW33N/monster ice/5.png', scalex = 3, scaley = 3, 		atk = 3.0, def = 3.0, spd = 20, atkspd = 5, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 10, runat = 20, spawn1 = {5, 205}, spawn2 = {10, 210}, 		exp = 34555, money = 78200, loot = {{ chance = 1500 , id = 458},{ chance = 1500 , id = 459},{ chance = 1500 , id = 460},{ chance = 1500 , id = 461}}, 	}, 	{