Forum

> > CS2D > Scripts > NPC Random Drops (REQUEST)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch NPC Random Drops (REQUEST)

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt NPC Random Drops (REQUEST)

JohnLOL
User Off Offline

Zitieren
Hello people, I'm making a Single Player Mod inspired in Counter Strike Deleted Scenes, however,the game became very easy if I just let weapons and ammunition on the map.
Because I could run to the checkpoints without make one shot at the NPC, so I would like someone make a script that makes the NPCs drop item (Ammunition, weapons, Armors) to encourage the player to kill NPCs and make the mod more challenging.

In short:
  ∗ -Please Create a script that makes the NPC drop various items (or items established by id)

  ∗ -Establish A frequency of drop (not always the NPCs drop items)

-The Item appears where the NPC was killed

From already, thanks for read this post or not,you guys are cool !!!

* Sorry my bad English

alt Re: NPC Random Drops (REQUEST)

omg
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
math.randomseed(os.time())
math.random()

droptable={61,62,64,58}
droprate={i61=15,i62=15,i64=5,i58=5}

addhook("objectkill","badidea")
function badidea(obj,id)
	if id>0 and id<33 then
		if object(obj,"type")==30 then
			for _,item in pairs(droptable) do
				local getitem="i"..item
				if math.random(100)<=droprate[getitem] then
					parse("spawnitem "..item.." "..object(obj,"tilex").." "..object(obj,"tiley"))
				end
			end
		end
	end
end
looking for anything more specific?
4× editiert, zuletzt 24.08.15 23:52:44
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht