-DIE Wolf- has written
Yeah ! Thank Dousea . It work ! Thank you so much
Last litter question : Can you add spawn limit for them ? Like it just spawn 10 NPC then stop. And if u kill some of them, it will spawn again until 10 NPC then stop.
Last litter question : Can you add spawn limit for them ? Like it just spawn 10 NPC then stop. And if u kill some of them, it will spawn again until 10 NPC then stop.
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
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
table = { 	time = 10000; 	pos = { {10, 20}; {20, 30}; }; 	count = 0; limit = 10; } function spawnTimer() 	timer(table.time, [[spawnNPC]]) end spawnTimer() function spawnNPC() 	if table.count ~= table.limit and table.count < table.limit then 		local x, y, rotation = math.random(table.pos[1][1], table.pos[1][2]), math.random(table.pos[2][1], table.pos[2][2]), math.random(0, 360) 		if tile(x, y, [[frame]]) == 6 then 			parse([[spawnnpc 1 ]]..x..[[ ]]..y..[[ ]]..rotation) 			table.count = table.count + 1 		end 	end 	spawnTimer() end addhook([[kill]], [[spawnKill]]) function spawnKill(killer, victim, weapon) 	if weapon >= 248 and weapon <= 249 then 		while table.count > 0 do 			table.count = table.count - 1 		end 	end end