Forum

> > CS2D > Scripts > npc drop money
Forums overviewCS2D overview Scripts overviewLog in to reply

English npc drop money

2 replies
To the start Previous 1 Next To the start

old npc drop money

pbeloto
User Off Offline

Quote
someone could create a npc drop money ? equal to c - 4 server

example :

when you kill an npc drop money he spread the floor

and also be able to make the npcs nation every 2 minutes in the form of random .

example :

random position of the map .

really appreciate if someone could do that to min : D

sorry my english bad

old Re: npc drop money

Dynamite07
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
CoinsDrop={-2,3}

addhook("objectkill","objectkillHook")
function objectkillHook(id)
     if object(id,"type") == 30 then
         local z = math.random(CoinsDrop[1],CoinsDrop[2])
         for i = 1, z do
               parse("spawnitem 66 "..object(id,"tilex")+(math.random(-1,1)).." "..object(id,"tiley")+(math.random(-1,1)))			   			   
         end
     end
end
end

Should work. I dont me remember.

"and also be able to make the npcs nation every 2 minutes in the form of random ." what? spawn a random npc each 2 minutes?

old Re: npc drop money

pbeloto
User Off Offline

Quote
user Dynamite07 has written
1
2
3
4
5
6
7
8
9
10
11
12
CoinsDrop={-2,3}

addhook("objectkill","objectkillHook")
function objectkillHook(id)
     if object(id,"type") == 30 then
         local z = math.random(CoinsDrop[1],CoinsDrop[2])
         for i = 1, z do
               parse("spawnitem 66 "..object(id,"tilex")+(math.random(-1,1)).." "..object(id,"tiley")+(math.random(-1,1)))			   			   
         end
     end
end
end

Should work. I dont me remember.

"and also be able to make the npcs nation every 2 minutes in the form of random ." what? spawn a random npc each 2 minutes?



yes it works


yes it works , you know create npc spawn with random position ?

#Edit

you know put hp in the npc script ?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview