Forum

> > CS2D > Scripts > Script request.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script request.

4 replies
To the start Previous 1 Next To the start

old Script request.

4Vendetta
User Off Offline

Quote
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

old Re: Script request.

Apache uwu
User Off Offline

Quote
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

old Re: Script request.

Chex
User Off Offline

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

old Re: Script request.

Apache uwu
User Off Offline

Quote
I realize I could have made it more efficient however lua is a learning language. That's why I didn't optimize it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview