Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ZG.VAR.KnockbackPlayerArchi(pUnit)
- local plr = pUnit:GetRandomPlayer(0)
- if not plr then
- return;
- end
- local x2 = pUnit:GetX()
- local y2 = pUnit:GetY()
- local x1 = plr:GetX()
- local y1 = plr:GetY()
- local x = x2 - x1
- local y = y2 - y1
- local angle = math.pi + math.atan2(-y, -x)
- -- 30 = distance
- local x = x1 - (30 * math.cos(angle))
- local y = y1 - (30 * math.sin(angle))
- local z = pUnit:GetLandHeight(x, u)
- if z > 200 or z < 20 then
- z = plr:GetZ()
- end
- plr:MoveKnockback(x, y, z, 2, 9)
- end
Advertisement
Add Comment
Please, Sign In to add comment