Forum

> > CS2D > Scripts > Error in the Lua?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Error in the Lua?

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Error in the Lua?

Axel340
User Off Offline

Zitieren
It seems to me that in this script error sound when killing the Soldier does not play.

1
2
3
4
5
6
addhook("objectkill","npckill") 
function npckill(id,ply)
 if object(id,"type") == 5 then 
  parse("sv_sound2 "..ply.." \"p-song/turret_disabled_1.wav\"")
 end
end

alt Re: Error in the Lua?

Kel9290
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
function convert(p)
	return math.floor(p/32)
end

addhook("objectkill","npckill")
function npckill(id,ply)
	if object(id,"type") == 30 then -- NPC?
		if entity(convert(object(id,"x")),convert(object(id,"y")),"int1") == 5 then
			parse("sv_sound2 "..ply.." /fun/thats_the_way.wav")
		end
	end
end
Tested.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht