Forum

> > CS2D > Scripts > Need Knockback script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need Knockback script

4 replies
To the start Previous 1 Next To the start

old Re: Need Knockback script

SQ
Moderator Off Offline

Quote
Something like that?
This one is with tile-stuck problem though.
1
2
3
4
5
6
7
8
addhook('hit','Knockback')
function Knockback(p1,p2,Weapon)
	local Damage, pX, pY = itemtype(Weapon,'dmg')
	local Angle = math.rad(math.abs(player(p2,'rot') - 90))
	pX = player(p1,'x') + math.cos(Angle) * Damage
	pY = player(p1,'y') + math.sin(Angle) * Damage
	parse('setpos '..p1..' '..pX..' '..pY)
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview