Hi could someone help me with this problem please . It is working correctly ageinst bots but if my target is a real player I'm getting an error.
OnTick(function()
target = GetCurrentTarget()
    SpellCooldown()
end)
function SpellCooldown()
    local champTable = {"Renekton","MonkeyKing","Garen"}
    for i = 1 , #champTable do
        if target.name:find(champTable[i])  then
            if champTable[i] == "Renekton" then
                if  ValidTarget(target,3000) then
                    SpellCd = target:GetSpellData(_W).currentCd
                    if SpellCd <= 3 or GotBuff(target,"RenektonPreExecute") > 0 then
                        lockE = true
                    elseif SpellCd > 3 then
                        lockE = false
                    else
                        lockE = false
                    end
                end
            end
            --
            if champTable[i] == "MonkeyKing" then
                if ValidTarget(target,3000) then
                    SpellCd = target:GetSpellData(_Q).currentCd
                    if SpellCd <= 3 or GotBuff(target,"MonkeyKingDoubleAttack") > 0 then
                        lockE = true
                    elseif SpellCd > 3 then
                        lockE = false
                    else
                        lockE = false
                    end
                end
            end
            --
            if champTable[i] == "Garen" then
                if ValidTarget(target,3000) then
                    SpellCd = target:GetSpellData(_Q).currentCd
                    if  GotBuff(target,"GarenQ") > 0 then
                        lockE = true
                    elseif SpellCd < 3 then
                        lockE = true
                    else
                        lockE = false
                    end
                end
            end
        end
    end
end
OnDraw(function()
    if SpellCd == nil then return end
-- xd
    unitvec = Vector(GetDirection(myHero)):normalized()
    textpos3d = GetOrigin(myHero) + (unitvec * 200)
    datas = WorldToScreen(1, textpos3d)
-- xd
DrawText("Cooldown: " .. SpellCd,20, datas.x, datas.y - 10, GoS.White)
if lockE == false then
    DrawText("LOCKE::FALSE",20, datas.x, datas.y - 30,ARGB(255,252,57,57))
elseif lockE == true then
    DrawText("LOCKE::TRUE",20, datas.x, datas.y - 30,ARGB(255,48,242,74))
end
end)
					
					Edited by Sad, 05 December 2017 - 12:52 .
 Sign In
 Sign In Create Account
 Create Account

 
	
 
                     
				
					 
			
			 Back to top
 Back to top Report
 Report








