Forum

> > CS2D > Scripts > Lua kill command.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua kill command.

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Lua kill command.

Black Wolf
User Off Offline

Zitieren
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….

alt Re: Lua kill command.

Alistaire
User Off Offline

Zitieren
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

alt Re: Lua kill command.

Jynxxx
User Off Offline

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

To late but either one works.

alt Re: Lua kill command.

Black Wolf
User Off Offline

Zitieren
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

alt Re: Lua kill command.

MikuAuahDark
User Off Offline

Zitieren
user Black Wolf hat geschrieben
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
1× editiert, zuletzt 06.08.12 14:29:05

alt Re: Lua kill command.

Black Wolf
User Off Offline

Zitieren
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 '¬'

alt Re: Lua kill command.

Yates
Reviewer Off Offline

Zitieren
@user Black Wolf:
1
parse('hudtxt2 '..killer..' 1 "©000255000Your U.S.G.N. ID is: '..player(killer,"usgn")..'" 5 280')
lrn2hudtxt.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht