Forum

> > CS2D > General > knockback
Forums overviewCS2D overviewGeneral overviewLog in to reply

English knockback

No replies
To the start Previous 1 Next To the start

old closed knockback

Jake-rus
User Off Offline

Quote
I need a nostucking knockback like this type :
1
2
3
4
5
6
7
8
9
10
11
12
addhook("hit","knockback")
function knockback(id,source,weapontype)
if player(id,"team")==1 and player(id,"team")~=player(source,"team") then
          local DMG = (itemtype(weapontype,"dmg") / 2)
          local ROT = math.rad(player(source,"rot") - 90)
          local NX = player(id,"x") + (math.cos(ROT) * DMG)
          local NY = player(id,"y") + (math.sin(ROT) * DMG)
          if tile(NX / 32 - 1,NY / 32 - 1,"walkable") then
               parse(string.format("setpos %s %s %s",id,NX,NY))
          end
     end
end

Admin/mod comment

lua scripting questions
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview