Forum

> > CS2D > Scripts > killing one NPCs get scores...
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch killing one NPCs get scores...

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt killing one NPCs get scores...

Neoflasher11
User Off Offline

Zitieren
Hi again

I'm with a maps project, creations coop (coop Sveen style and Half Life)
and wanted to know if there is any way to make NPCs give a point when they are murdered.
is it possible?
1× editiert, zuletzt 25.04.13 18:32:06

alt Re: killing one NPCs get scores...

Neoflasher11
User Off Offline

Zitieren
thanks alistaire but the code not working,the idea is when you kill an NPC (soldiers, vort, head, shark)you get a score.I have to convert the code in lua?I did ,but not works.
maybe i not understand how it is.

alt Re: killing one NPCs get scores...

EP
User Off Offline

Zitieren
1
2
3
4
5
6
7
addhook('objectkill', 'objectkillHook')

function objectkillHook(dynid, id)
     if object(dynid, 'type') == 30 then
		parse('setscore '..id..' '..(player(id,"score")+1))
     end
end
Trololol.

alt Re: killing one NPCs get scores...

Neoflasher11
User Off Offline

Zitieren
user EP hat geschrieben
1
2
3
4
5
6
7
addhook('objectkill', 'objectkillHook')

function objectkillHook(dynid, id)
     if object(dynid, 'type') == 30 then
		parse('setscore '..id..' '..(player(id,"score")+1))
     end
end
Trololol.


now it works! haha thanks EP, was the only thing I wanted.
thanks again

alt Re: killing one NPCs get scores...

omg
User Off Offline

Zitieren
really? ur working with big projects and u dont even know how to write 5 of the simplest lines of code ever? no wonder the job market is messed up

alt Re: killing one NPCs get scores...

Neoflasher11
User Off Offline

Zitieren
user omg hat geschrieben
really? ur working with big projects and u dont even know how to write 5 of the simplest lines of code ever? no wonder the job market is messed up


What's wrong?some may have good ideas, but not all are programmers,(I think the word is somewhat exaggerated "project" on this subject)
they had said he was with some creations of maps to play in coop.I had not said to make a game CS2D revolutionary.
Only it had asked for the game to have a little more encouragement.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht