Forum

> > CS2D > Scripts > killing one NPCs get scores...
Forums overviewCS2D overview Scripts overviewLog in to reply

English killing one NPCs get scores...

6 replies
To the start Previous 1 Next To the start

old killing one NPCs get scores...

Neoflasher11
User Off Offline

Quote
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?
edited 1×, last 25.04.13 06:32:06 pm

old Re: killing one NPCs get scores...

Neoflasher11
User Off Offline

Quote
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.

old Re: killing one NPCs get scores...

EP
User Off Offline

Quote
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.

old Re: killing one NPCs get scores...

Neoflasher11
User Off Offline

Quote
user EP has written
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

old Re: killing one NPCs get scores...

omg
User Off Offline

Quote
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

old Re: killing one NPCs get scores...

Neoflasher11
User Off Offline

Quote
user omg has written
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview