i have this Code for Knockback
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
when i shot zombie , zombie's stuck in wall
can some one help me in unstuck script ?
thx Something like this:
1
2
3
4
5
6
7
8
9
10
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
if tile(px, py, "walkable") then
parse('setpos '..p1..' '..pX..' '..pY)
end
end
Pagyra
1
2
3
4
5
6
7
8
9
10
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
if tile((pX + (math.cos(Angle) >= 0 and 10 or -10)) * 32 , (pY + (math.sin(Angle) >= 0 and 10 or -10)) * 32, "walkable") then
parse('setpos '..p1..' '..pX..' '..pY)
end
end
May or may not work Thx all .
i want to make zombie plague mod like SQ
he's lua don't work for me i want to make make If you cannot properly install SQ's Zombie Plague, then you will not be able to "make make" your own script. I mean seriously, how is it that hard to install a simple script? Admin/mod comment
Please avoid such comments unless you have CONSTRUCTIVE ideas for improvements /DC