Forum

> > CS2D > Scripts > N>somebody to make lua i want
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch N>somebody to make lua i want

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt N>somebody to make lua i want

dustin5
User Off Offline

Zitieren
hi all i need some help to make a lua when every times we kill NPC we get EXP and the NPC can drop random items when *DEAD* (just normal items not crazy items) + each level can make us get +5 max HP
PM me for the lua ok guys
thx for anybody wanna make the lua for me
a little bad in english sry T_T

alt Re: N>somebody to make lua i want

Alistaire
User Off Offline

Zitieren
That's pretty easy.

You'll need an objectkill hook with npctype 30 and a math.random(_table(itemsuwannaspawn)) for what items they can drop.

Also you'll need a table with player id's and experience, and probably a function for levelling up.

alt Re: N>somebody to make lua i want

Infinite Rain
Reviewer Off Offline

Zitieren
SO firstly you need make a weapons table that you want to be dropped.

after this on objectkill make randomization

1
2
3
4
5
6
7
8
9
weapons = {12, 15, 16} --weapon IDs

addhook('objectkill', 'npcdead')
function npcdead(id, player)
	if not object(id, 'type') == 30 then return end
	math.randomseed(os.time)
	local d = weapons[math.random(1, #weapons)]
	parse('spawn blanblabla
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht