Collision is a Lib that gives you the power to check for collision between 2 points and given values
Source: https://raw.githubus...n/Collision.lua
(put the Collision.lua into your Common folder)
API
put the following at the top of your Script if you want to use the Lib
require "Collision"
For every Spell you want to check collision for do the following just ONCE (you can do this right after the requiring)
local name_as_you_wish = Collision:SetSpell(range, speed, delay, width, hitBox)
Now there are 3 Types of functions you can use:
__GetCollision(from, to, mode, exclude) __GetHeroCollision(from, to, mode, exclude) __GetMinionCollision(from, to, mode, exclude)
- from: the starting point
- to: the ending point
- mode: number 1 - 6 or "ALL", "ALLY", "ENEMY", "JUNGLE", "ENEMYANDJUNGLE", "ALLYANDJUNGLE"
- exclude: a list of units or a unit
Example (Anivia Q):
require 'Collision' local QSpell = Collision:SetSpell(1100, 820, .3, 105, true) OnDraw = function() local block, list = QSpell:__GetCollision(myHero, mousePos, 5) if block then for i = 1, #list do Draw.Circle(list[i]) end end end
(Note: The Delay is there for future reasons, at the moment it has no effect)