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 x1 = pUnit:GetX()
- local y1 = pUnit:GetY()
- local x2 = plr:GetX()
- local y2 = plr:GetY()
- local x = x1 < x2 and x2 - x1 or x1 - x2
- local y = y1 < y2 and y2 - y1 or y1 - y2
- local angle = 180 + (math.atan2(-x, -y) * (180 / math.pi))
- angle = angle * (math.pi / 180)
- -- 25 = amount of yards past point
- local x3 = x + (2 * math.cos(angle))
- local y3 = y + (2 * math.sin(angle))
- local z3 = pUnit:GetLandHeight(x3, y3)
- plr:MoveKnockback(x3, y3, z3, 4, 6)
- pUnit:SendChatMessage(14,0,"FLYYYY!!!")
- end
Advertisement
Add Comment
Please, Sign In to add comment