Advertisement
16HeX16

Ultimate Lee Sin 2.0

Apr 9th, 2013
30,152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.17 KB | None | 0 0
  1. --[[ Ultimate Lee Sin 2.0 by HeX]]--
  2.  
  3. if myHero.charName ~= "LeeSin" then return end
  4.  
  5. --[[    Variables   ]]--
  6. --[[    Ranges  ]]--
  7. local qRange = 975
  8. local qWidth = 75 -- Increase if Q is hitting creep with collision ON.
  9. local wRange = 700
  10. local eRange = 425
  11. local eBuffer = 275
  12. local rRange = 375
  13. --[[    Draw    ]]--
  14. local waittxt = {}
  15. local floattext = {"Skills on cooldown.","Killable","Easy kill","Ultimate him!"}
  16. local killable = {}
  17. local calculationenemy = 1
  18. --[[    Ready   ]]--
  19. local ignite = nil
  20. local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = nil, nil, nil, nil, nil, nil, nil, nil
  21. local QREADY, WREADY, EREADY, RREADY, IREADY = false, false, false, false, false
  22. --[ [Q Prediction   ]]--
  23. local rCast = false
  24. local qp = TargetPrediction(qRange, 1.5, 250)
  25. --[[    Auto Attacks    ]]--
  26. local lastBasicAttack = 0
  27. local swingDelay = 0.25
  28. local swing = 0
  29. --[[    Q Dodge ]]--
  30. local qDelay = nil
  31. local qCast = false
  32. local dodgeMinion = nil
  33. local dodgeHero = nil
  34. local wDelay = 0
  35. local qMultiplier = 1.1 --Increase if Q-Shield combo is too fast
  36. --[[    Ward Jump   ]]--
  37. local WardTable = {}
  38. local SWard, VWard, SStone, RSStone, Wriggles = 2044, 2043, 2049, 2045, 3154
  39. local SWardSlot, VWardSlot, SStoneSlot, RSStoneSlot, WrigglesSlot = nil, nil, nil, nil, nil
  40. local jumpReady = false
  41. local jumpRange = 540
  42. local wardRange = 600
  43. local jumpDelay = 0
  44.  
  45. function OnLoad()
  46.     Menu()
  47. end
  48.  
  49. --[[======================================Tick/Combo======================================]]--
  50. function OnTick()
  51.     ts:update()
  52.     allyMinions:update()
  53.     enemyMinions:update()
  54.     Checks()
  55.    
  56. --[[    Ultimate Close  ]]--
  57.     if LeeSinConfig.rClose then
  58.         ClosestUlt()
  59.     end
  60.    
  61. --[[    Auto Ultimate   ]]--
  62.     if not myHero.dead and LeeSinConfig.autoult then
  63.         AutoUlt()
  64.     end
  65.    
  66. --[[    Q Dodge ]]--
  67.     if LeeSinConfig.qDodge and ts.target ~= nil then
  68.         DodgeBall()
  69.     end
  70.    
  71. --[[    Basic Combo ]]--
  72.     if LeeSinConfig.scriptActive and ts.target ~= nil then
  73.         UseItems(ts.target)
  74.         BasicCombo(ts.target)
  75.     end
  76.    
  77. --[[    Quick Jump  ]]--
  78. --  if LeeSinConfig.quickJump then
  79. --      QuickJump()
  80. --  end
  81.    
  82. --[[    Ignite  ]]--
  83.     if LeeSinConfig.autoignite then    
  84.         AutoIgnite()
  85.     end
  86.    
  87. --[[    Ward Jump   ]]--
  88.     if jumpReady == true then
  89.         JumpReady()
  90.     end
  91.     if LeeSinConfig.wardjump then
  92.         JumpCheck()
  93.     end
  94. end
  95.  
  96. function OnDraw()
  97.     Draw()
  98. end
  99.  
  100. --[ [DONT GO BELOW THIS LINE    ]]--
  101. function OnCreateObj(object)
  102.   if WardCheck(object) then table.insert(WardTable, object) end
  103. end
  104.  
  105. function OnProcessSpell(unit, spell)
  106.     if unit.isMe and (spell.name:find("Attack") ~= nil) then
  107.         swing = 1
  108.         lastBasicAttack = os.clock()
  109.     end
  110. end
  111.  
  112. function findClosestEnemy()
  113.     local closestEnemy = nil
  114.     local currentEnemy = nil
  115.     for i=1, heroManager.iCount do
  116.         currentEnemy = heroManager:GetHero(i)
  117.         if currentEnemy.team ~= myHero.team and not currentEnemy.dead and currentEnemy.visible then
  118.             if closestEnemy == nil then
  119.                 closestEnemy = currentEnemy
  120.                 elseif GetDistance(currentEnemy) < GetDistance(closestEnemy) then
  121.                     closestEnemy = currentEnemy
  122.             end
  123.         end
  124.     end
  125. return closestEnemy
  126. end
  127.  
  128. function findFurthestMinion()
  129.     local FurthestMinion = nil
  130.     local currentMinion = nil
  131.     for _, minion in pairs(allyMinions.objects) do
  132.         currentMinion = minion
  133.         if FurthestMinion == nil then
  134.             FurthestMinion = currentMinion
  135.         elseif GetDistance(currentMinion) > GetDistance(FurthestMinion) then
  136.             FurthestMinion = currentMinion
  137.         end
  138.     end
  139. return FurthestMinion
  140. end
  141.  
  142. --[[    Combo Functions ]]--
  143. function AutoUlt()
  144.     if RREADY then
  145.         local rDmg = 0    
  146.         for i = 1, heroManager.iCount, 1 do
  147.             local enemyhero = heroManager:getHero(i)
  148.             if ValidTarget(enemyhero, (rRange+50)) then
  149.                 rDmg = getDmg("R", enemyhero, myHero)
  150.                 if enemyhero.health <= rDmg then
  151.                     CastSpell(_R, enemyhero)
  152.                 end
  153.             end
  154.         end
  155.     end
  156. end
  157.  
  158. function ClosestUlt()
  159.     findClosestEnemy()
  160.     if RREADY and findClosestEnemy() ~= nil and GetDistance(findClosestEnemy()) <= (rRange) then
  161.         CastSpell(_R, findClosestEnemy())
  162.     end
  163. end
  164.  
  165. function BasicCombo(target)
  166.     if predic ~= nil and QREADY and GetDistance(predic) <= qRange and myHero:GetSpellData(_Q).name == "BlindMonkQOne" then
  167.         if not minionCollision(predic, qWidth, qRange) then
  168.             CastSpell(_Q, predic.x, predic.z)
  169.         end
  170.     end
  171.     if GetDistance(target) <= 1100 and QREADY and not rCast then
  172.         CastSpell(_Q)
  173.     elseif QREADY and GetDistance(target) <= 1100 and LeeSinConfig.useUlti and rCast then
  174.         CastSpell(_Q)
  175.     end
  176.     if swing == 0 and GetDistance(target) <= eRange then
  177.         myHero:Attack(target)
  178.         if EREADY and GetDistance(target) <= eBuffer and myHero:GetSpellData(_E).name == "blindmonketwo" then
  179.             CastSpell(_E)
  180.         end
  181.     elseif swing == 1 then
  182.         if EREADY and GetDistance(target) <= eBuffer and myHero:GetSpellData(_E).name == "BlindMonkEOne" then
  183.             CastSpell(_E)
  184.             myHero:Attack(target)
  185.         end
  186.     end
  187.     if EREADY and GetDistance(target) >= eRange and myHero:GetSpellData(_E).name == "blindmonketwo" then
  188.         CastSpell(_E)
  189.         myHero:Attack(target)
  190.     end
  191.     if RREADY and GetDistance(target) <= rRange and LeeSinConfig.useUlti and QREADY then
  192.         CastSpell(_R, target)
  193.         rCast = true
  194.     end
  195. end
  196.  
  197. function DodgeBall()
  198. --  Setting
  199.     for i=1, heroManager.iCount do
  200.         local allytarget = heroManager:GetHero(i)
  201.         if allytarget.team == myHero.team and not allytarget.dead and GetDistance(allytarget, targetPosition) < 750 and allytarget.charName ~= myHero.charName then
  202.             dodgeHero = allytarget
  203.         end
  204.     end
  205.  
  206.     dodgeMinion = findFurthestMinion()
  207. --  Cast
  208.     if predic ~= nil and QREADY and GetDistance(predic) <= qRange and myHero:GetSpellData(_Q).name == "BlindMonkQOne" then
  209.         if not minionCollision(predic, qWidth, qRange) then
  210.             CastSpell(_Q, predic.x, predic.z)
  211.         end
  212.     end
  213.     if (dodgeMinion ~= nil and dodgeMinion ~= dead) or (dodgeHero ~= nil and dodgeHero ~= dead) then
  214.         if GetDistance(ts.target) <= 1100 and myHero:GetSpellData(_Q).name == "blindmonkqtwo" and WREADY then
  215.             CastSpell(_Q)
  216.             qCast = true
  217.             qDelay = os.clock()
  218.             wDelay = ((GetDistance(predic)/1600) * qMultiplier)
  219.         end
  220.        
  221.         if qCast == true and not QREADY and dodgeMinion ~= nil and GetDistance(dodgeMinion, ts.target) < 750 then
  222.             if os.clock() - qDelay > wDelay then
  223.                 CastSpell(_W, dodgeMinion)
  224.                 qCast = false
  225.             end
  226.         elseif qCast == true and not QREADY and dodgeHero ~= nil then
  227.             if os.clock() - qDelay > wDelay then
  228.                 CastSpell(_W, dodgeHero)
  229.                 qCast = false
  230.             end
  231.         end
  232.     end
  233. end
  234.  
  235. --[[    Ward Jump   ]]--
  236. function WardCheck(object)
  237.     return object and object.valid and (string.find(object.name, "Ward") ~= nil or string.find(object.name, "Wriggle") ~= nil)
  238. end
  239.  
  240. function JumpReady()
  241.     if jumpReady == true then
  242.         for i,object in ipairs(WardTable) do
  243.             if object ~= nil and object.valid and math.sqrt((object.x-mousePos.x)^2+(object.z-mousePos.z)^2) < 150 then
  244.                 CastSpell(_W, object)
  245.                 jumpReady = false
  246.             end
  247.    end
  248.     end
  249. end
  250.  
  251. function JumpCheck()
  252.     local x = mousePos.x
  253.     local z = mousePos.z
  254.     local dx = x - player.x
  255.     local dz = z - player.z
  256.     local rad1 = math.atan2(dz, dx)
  257.    
  258.     SWardSlot = GetInventorySlotItem(SWard)
  259.     VWardSlot = GetInventorySlotItem(VWard)
  260.     SStoneSlot = GetInventorySlotItem(SStone)
  261.     RSStoneSlot = GetInventorySlotItem(RSStone)
  262.     WrigglesSlot = GetInventorySlotItem(Wriggles)
  263.  
  264.     if RSStoneSlot ~= nil and CanUseSpell(RSStoneSlot) == READY then
  265.         wardSlot = RSStoneSlot
  266.     elseif SStoneSlot ~= nil and CanUseSpell(SStoneSlot) == READY then
  267.         wardSlot = SStoneSlot
  268.     elseif SWardSlot ~= nil then
  269.         wardSlot = SWardSlot
  270.     elseif VWardSlot ~= nil then
  271.         wardSlot = VWardSlot
  272.     elseif WrigglesSlot ~= nil then
  273.         wardSlot = WrigglesSlot
  274.     else wardSlot = nil
  275.     end
  276.  
  277.     if wardSlot ~= nil then
  278.         local dx1 = jumpRange*math.cos(rad1)
  279.         local dz1 = jumpRange*math.sin(rad1)
  280.         local x1 = x - dx1
  281.         local z1 = z - dz1
  282.         if WREADY and math.sqrt(dx*dx + dz*dz) <= 600 then
  283.             CastSpell( wardSlot, x, z )
  284.             jumpReady = true
  285.         elseif WREADY then player:MoveTo(x1, z1)
  286.             else myHero:StopPosition()
  287.         end
  288.     end
  289. end
  290.  
  291. --[[    Auto Ignite ]]--
  292. function AutoIgnite()
  293.     if IREADY then
  294.         local ignitedmg = 0    
  295.         for i = 1, heroManager.iCount, 1 do
  296.             local enemyhero = heroManager:getHero(i)
  297.             if ValidTarget(enemyhero, 600) then
  298.                 ignitedmg = 50 + 20 * myHero.level
  299.                 if enemyhero.health <= ignitedmg then
  300.                     CastSpell(ignite, enemyhero)
  301.                 end
  302.             end
  303.         end
  304.     end
  305. end
  306.  
  307. --[[    Ready and Items ]]--
  308. function Checks()
  309.     BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074),  GetInventorySlotItem(3143), GetInventorySlotItem(3142)
  310.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  311.     WREADY = (myHero:CanUseSpell(_W) == READY)
  312.     EREADY = (myHero:CanUseSpell(_E) == READY)
  313.     RREADY = (myHero:CanUseSpell(_R) == READY)
  314.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  315.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  316.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  317.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  318.     TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
  319.     RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
  320.     RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  321.     YGBREADY = (YGBSlot ~= nil and myHero:CanUseSpell(YGBSlot) == READY)
  322.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  323.    
  324.     if tick == nil or GetTickCount()-tick>=200 then
  325.         tick = GetTickCount()
  326.         SCDmgCalculation()
  327.     end
  328.     if swing == 1 and os.clock() > lastBasicAttack + 0.4 then
  329.         swing = 0
  330.     end
  331.     if ts.target ~= nil then
  332.         predic = qp:GetPrediction(ts.target)
  333.     end
  334. end
  335.    
  336. function UseItems(target)
  337.     if GetDistance(target) < 550 then
  338.         if DFGREADY then CastSpell(DFGSlot, target) end
  339.         if HXGREADY then CastSpell(HXGSlot, target) end
  340.         if BWCREADY then CastSpell(BWCSlot, target) end
  341.         if BRKREADY then CastSpell(BRKSlot, target) end
  342.         if YGBREADY then CastSpell(YGBSlot, target) end
  343.         if TMTREADY and GetDistance(target) < 275 then CastSpell(TMTSlot) end
  344.         if RAHREADY and GetDistance(target) < 275 then CastSpell(RAHSlot) end
  345.         if RNDREADY and GetDistance(target) < 275 then CastSpell(RNDSlot) end
  346.     end
  347. end
  348.  
  349. --[[    Base Functions  ]]--
  350. function Menu()
  351.     PrintChat("<font color='#CCCCCC'> >> Ultimate Lee Sin 2.0 loaded! <<</font>")
  352.     LeeSinConfig = scriptConfig("LeeSin Config", "LeeSincombo")
  353.     LeeSinConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  354.     LeeSinConfig:addParam("wardjump", "Ward Jump", SCRIPT_PARAM_ONKEYDOWN, false, 71)
  355.     LeeSinConfig:addParam("qDodge", "Jump Shield Combo", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  356.     --LeeSinConfig:addParam("quickJump", "Quick Jump", SCRIPT_PARAM_ONKEYDOWN, false, 90)
  357.     LeeSinConfig:addParam("rClose", "Ult Closest Enemy", SCRIPT_PARAM_ONKEYDOWN, false, 88)
  358.     LeeSinConfig:addParam("useUlti", "Use Ult in combo", SCRIPT_PARAM_ONOFF, false)
  359.     LeeSinConfig:addParam("drawcirclesEnemy", "DrawCircles - Enemies", SCRIPT_PARAM_ONOFF, false)
  360.     LeeSinConfig:addParam("drawcirclesSelf", "DrawCircles - Self", SCRIPT_PARAM_ONOFF, false)
  361.     LeeSinConfig:addParam("drawtext", "DrawText - Enemies", SCRIPT_PARAM_ONOFF, true)
  362.     LeeSinConfig:addParam("autoult", "Ult when killable", SCRIPT_PARAM_ONOFF, false)
  363.     LeeSinConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  364.     LeeSinConfig:permaShow("scriptActive")
  365.     LeeSinConfig:permaShow("wardjump")
  366.     LeeSinConfig:permaShow("qDodge")
  367.     --LeeSinConfig:permaShow("quickJump")
  368.     LeeSinConfig:permaShow("autoult")
  369.    
  370.     ts = TargetSelector(TARGET_LOW_HP,1250,DAMAGE_PHYSICAL)
  371.     ts.name = "LeeSin"
  372.     LeeSinConfig:addTS(ts)
  373.    
  374.     enemyMinions = minionManager(MINION_ENEMY, 1200, player)
  375.     allyMinions = minionManager(MINION_ALLY, 1000, player)
  376.    
  377.     for i = 0, objManager.maxObjects, 1 do
  378.         local object = objManager:GetObject(i)
  379.             if WardCheck(object) then table.insert(WardTable, object) end
  380.   end  
  381.  
  382.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  383.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  384.     end
  385.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  386. end
  387.  
  388. function Draw()
  389.     if LeeSinConfig.wardjump and not myHero.dead then
  390.         DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x0000FF)
  391.     end
  392.     if LeeSinConfig.drawcirclesSelf and not myHero.dead then
  393.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0xCCFF33)
  394.         DrawCircle(myHero.x, myHero.y, myHero.z, rRange, 0xFF0000)
  395.         DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x0000FF)
  396.     end
  397.     if ts.target ~= nil and LeeSinConfig.drawcirclesEnemy then
  398.         for e=0, 10 do
  399.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + e*1.5, 0x00FF00)
  400.         end
  401.     end
  402.     for i=1, heroManager.iCount do
  403.         local enemydraw = heroManager:GetHero(i)
  404.         if ValidTarget(enemydraw) then
  405.             if LeeSinConfig.drawcirclesEnemy then
  406.                 if killable[i] == 1 then
  407.                     for e=0, 15 do
  408.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0x0000FF)
  409.                     end
  410.                     elseif killable[i] == 2 then
  411.                     for e=0, 10 do
  412.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  413.                     end
  414.                     elseif killable[i] == 3 then
  415.                     for e=0, 10 do
  416.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  417.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + e*1.5, 0xFF0000)
  418.                     end
  419.                     elseif killable[i] == 4 then
  420.                     for e=0, 10 do
  421.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  422.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + e*1.5, 0xFF0000)
  423.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + e*1.5, 0xFF0000)
  424.                     end
  425.                 end
  426.             end
  427.             if LeeSinConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
  428.                 PrintFloatText(enemydraw,0,floattext[killable[i]])
  429.             end
  430.         end
  431.         if waittxt[i] == 1 then waittxt[i] = 30
  432.             else waittxt[i] = waittxt[i]-1
  433.         end
  434.     end
  435. end
  436.  
  437. function SCDmgCalculation()
  438.     local enemy = heroManager:GetHero(calculationenemy)
  439.     if ValidTarget(enemy) then
  440.         local ignitedamage, bwcdamage, brkdamage = 0, 0, 0
  441.         local qdamage = getDmg("Q",enemy,myHero)
  442.         local edamage = getDmg("E",enemy,myHero)
  443.         local rdamage = getDmg("R",enemy,myHero,1)
  444.         local hitdamage = getDmg("AD",enemy,myHero)
  445.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  446.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  447.         local brkdamage = (BRKSlot and getDmg("RUINEDKING",enemy,myHero) or 0)
  448.         local combo1 = hitdamage*2 + qdamage + edamage + rdamage
  449.         local combo2 = hitdamage*2
  450.         local combo3 = hitdamage*1
  451.         local combo4 = 0
  452.     if QREADY then
  453.         combo2 = combo2 + qdamage
  454.         combo3 = combo3 + qdamage
  455.         end
  456.     if EREADY then
  457.         combo2 = combo2 + edamage
  458.     end
  459.     if RREADY then
  460.         combo2 = combo2 + rdamage
  461.         combo4 = combo4 + rdamage
  462.     end
  463.     if BWCREADY then
  464.         combo1 = combo1 + bwcdamage
  465.         combo2 = combo2 + bwcdamage
  466.         combo3 = combo3 + bwcdamage
  467.     end
  468.     if BRKREADY then
  469.         combo1 = combo1 + brkdamage
  470.         combo2 = combo2 + brkdamage
  471.         combo3 = combo3 + brkdamage
  472.     end
  473.     if IREADY then
  474.         combo1 = combo1 + ignitedamage
  475.         combo2 = combo2 + ignitedamage
  476.         combo3 = combo3 + ignitedamage
  477.     end
  478.     if combo4 >= enemy.health then killable[calculationenemy] = 4
  479.         elseif combo3 >= enemy.health then killable[calculationenemy] = 3
  480.         elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  481.         elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  482.         else killable[calculationenemy] = 0 end
  483.     end
  484.     if calculationenemy == 1 then calculationenemy = heroManager.iCount
  485.         else calculationenemy = calculationenemy-1
  486.     end
  487. end
  488.  
  489. function minionCollision(predic, width, range)
  490.     for _, minionObjectE in pairs(enemyMinions.objects) do
  491.         if predic ~= nil and player:GetDistance(minionObjectE) < range then
  492.             ex = player.x
  493.             ez = player.z
  494.             tx = predic.x
  495.             tz = predic.z
  496.             dx = ex - tx
  497.             dz = ez - tz
  498.             if dx ~= 0 then
  499.                 m = dz/dx
  500.                 c = ez - m*ex
  501.             end
  502.             mx = minionObjectE.x
  503.             mz = minionObjectE.z
  504.             distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  505.             if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
  506.                 return true
  507.             end
  508.         end
  509.     end
  510. return false
  511. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement