Forum

> > CS2D > Scripts > Lua kill command.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua kill command.

7 replies
To the start Previous 1 Next To the start

old Lua kill command.

Black Wolf
User Off Offline

Quote
Is possible make lua like when you kill some one then the command from activates.

addhook("kill… then after when i kill someone in game then this activates parse("equip….

old Re: Lua kill command.

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
addhook('kill', 'AA_kill')

function AA_kill(id)
	timer(3000, 'AA_function', id)
end

AA_function(id)
	parse('equip '..id..' 32')
end

old Re: Lua kill command.

Jynxxx
User Off Offline

Quote
1
2
3
4
addhook("kill","_kill")
function _kill(killer,victim)
	parse("equip "..killer.." 1")
end

To late but either one works.

old Re: Lua kill command.

Black Wolf
User Off Offline

Quote
What wrong with this…
1
2
3
4
addhook("kill","_kill")
function _kill(killer,victim)
     parse("hudtxt2 "..id.." 1 "©000255000Your Usgn Id is: "..killer(id,"usgn").." " 5 280")
end
addhook("kill","_kill")
function _kill(killer,victim)
parse("hudtxt2 "..id.." 1 "©000255000Your Usgn Id is: "..killer(id,"usgn").." " 5 280")
end

old Re: Lua kill command.

MikuAuahDark
User Off Offline

Quote
user Black Wolf has written
What wrong with this…
1
2
3
4
addhook("kill","_kill")
function _kill(killer,victim)
     parse("hudtxt2 "..id.." 1 "©000255000Your Usgn Id is: "..killer(id,"usgn").." " 5 280")
end

it should
1
LUA ERROR: attempt to blabla 'id'(a nil value)
fixed code
1
2
3
4
addhook("kill","_kill")
function _kill(killer,victim)
     parse("hudtxt2 "..killer.." 1 \"©000255000Your Usgn Id is: "..player(killer,"usgn").."\" 5 280")
end
EDIT: Fixed
edited 1×, last 06.08.12 02:29:05 pm

old Re: Lua kill command.

Black Wolf
User Off Offline

Quote
it says
1
LUA ERROR: sys/lua/server.lua:3: unexpected symbol near '\'

I tested again and removed "/"

the it says
1
LUA ERROR: sys/lua/server.lua:3: ')' expected near '¬'

old Re: Lua kill command.

Yates
Reviewer Off Offline

Quote
@user Black Wolf:
1
parse('hudtxt2 '..killer..' 1 "©000255000Your U.S.G.N. ID is: '..player(killer,"usgn")..'" 5 280')
lrn2hudtxt.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview