Forum

> > CS2D > Scripts > Script request.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Script request.

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Script request.

4Vendetta
User Off Offline

Zitieren
So, if is possible, can someone make one script for me?
like this [psychedelic code]
1
2
If team id==1 than set scout damage = 50
If team id==2 than set scout damage = 180

alt Re: Script request.

Apache uwu
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("hit","_hit")

function _hit(id,source,weapon,hpdmg,apdmg)
	if weapon==34 then
		if player(source,"team")==1 then
			if player(id,"health")-50<=0 then
				parse("customkill "..source.." \"Scout\" "..id)
			else
				parse("sethealth "..id.." "..player(id,"health")-180)
			end
		else
			if player(id,"health")-180<=0 then
				parse("customkill "..source.." \"Scout\" "..id)
			else
				parse("sethealth "..id.." "..player(id,"health")-180)
			end	
		end
		return 1
	end
end

alt Re: Script request.

Chex
User Off Offline

Zitieren
Hmm, this is interesting. There's probably an easier way, but what Im thinking of is:

1
2
3
4
5
6
7
8
9
parse("sv_wpndmg[[z1 for zoom one or z2 for zoom 2]] scout 50")
addhook("hit","scoutModifier")
function scoutModifier(i,source,w,hp,armor,raw)
	if player(source,"team") == 2 then
		if w==34 then 
			parse("sethealth "..source.." "..i.." "..(player(i,"health"))-130)
		end
	end
end

Dunno if it will work, but it A) won't work vs. armor, and B) change the hook and do other shenanigans for it to work on npcs/buildings.

alt Re: Script request.

Apache uwu
User Off Offline

Zitieren
I realize I could have made it more efficient however lua is a learning language. That's why I didn't optimize it.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht