Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

How to show timer

timer

  • Please log in to reply
9 replies to this topic

#1
masterys

masterys

    Newbie

  • Members
  • 3 posts

Hi people, sorry for my bad english  FeelsBadMan

 

I started to learn these scripts, i started to make for tryndamere and other champions,  and i want to make a timer function for this script ,to show on screen active ult 5 seconds.

Example , script activate ult and show me on screen seconds 5 , 4, 3 , 2 , 1

How to do this magic ? Sugestions ?  :thugdoge:

require("Inspired" )

if GetObjectName(GetMyHero()) ~= "Tryndamere" then return end

local Tryndamere = MenuConfig("Crazy Trynda v1.5", "Tryndamere")
	  Tryndamere:Menu("c", "Auto")
			Tryndamere.c:Boolean("Q", "Use Auto Q", true)
			Tryndamere.c:Boolean("R", "Use Auto R", true)
	  Tryndamere:Menu("aq","AutoQ")
			Tryndamere.aq:Slider("AutoQ","Q when Health is < ", 15, 1, 100, 1)	
	  Tryndamere:Menu("ar","AutoR")
			Tryndamere.ar:Slider("AutoR", "R when Health is < ", 35, 1, 100, 1)
	  Tryndamere:Menu("rp","AreaR")
		Tryndamere.rp:Slider("AreaR","AreaR",600,1,2500,25)
	  Tryndamere:Menu("qp","AreaQ")
		Tryndamere.qp:Slider("AreaQ","AreaQ",600,1,2500,25)
      Tryndamere:Menu("ig", "Ignite")
			Tryndamere.ig:Boolean("IG", "Ignite", true)			
	  Tryndamere:Menu("dr", "Draw Ult")
			Tryndamere.dr:Boolean("DR", "Draw ", true)

OnTick(function(myHero) 
	
	local hp = (GetCurrentHP(myHero)/GetMaxHP(myHero))
	local valq = (Tryndamere.aq.AutoQ:Value()/100)
    local valr = (Tryndamere.ar.AutoR:Value()/100)
	local posq = Tryndamere.qp.AreaQ:Value()
	local posr = Tryndamere.rp.AreaR:Value()
	
	-------- Q -----------
	if CanUseSpell(myHero, _Q) == READY and Tryndamere.c.Q:Value() and 	
		hp < valq and EnemiesAround(myHeroPos(), posq) < 1
			then CastSpell(_Q)    	
	end
	
	-------- R -----------
	if CanUseSpell(myHero, _R) == READY and Tryndamere.c.R:Value()  	
		and hp < valr and EnemiesAround(myHeroPos(), posr) > 0
			then 
			CastSpell(_R)   
				
		end
		
		----IGNITE----
		if Tryndamere.ig.IG:Value() then
		for _, enemy in pairs(GetEnemyHeroes()) do
		if Ignite and Tryndamere.ig.IG:Value() then
        if IsReady(Ignite) and 20*GetLevel(myHero)+50 > GetCurrentHP(enemy)+GetHPRegen(enemy)*2.5 and ValidTarget(enemy, 600) then
         CastTargetSpell(enemy, Ignite)
         end
    end
	end
	end
end)
	
	
PrintChat("<font color='#FF0000'> Crazy Trynda v1.5 </font><font color='#FFFF00'> by mastternick <font color='#897176'>(thank you all nice people for inspiration)</font>")


  • 0

#2
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts
OnTick(function(myHero)
If GotBuff(myHero) == "TryndaRBuffName" then
PrintChat("Buff On")
end
end)

Or use something from here
Spoiler


Dunno really ¯\_(ツ)_/¯
  • 0

#3
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

OnTick(function(myHero)
If GotBuff(myHero) == "TryndaRBuffName" then
PrintChat("Buff On")
end
end)
Or use something from here

Spoiler

Dunno really ¯\_(ツ)_/¯


wutt
  • 0

#4
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

OnTopic : Try this (not tested, should work 99%)

local immunitytimer = 0
local immunityendtime = 0
 
OnDraw(function(myHero)
  local drawPos = WorldToScreen(1,GetOrigin(myHero))

  if immunityendtime + 0.1 >= GetGameTimer() then
    local secondsleft = immunityendtime - GetGameTimer()
    if immunitytimer >= secondsleft then
    immunitytimer = secondsleft - 1
    DrawText(tostring(secondsleft),20,drawPos.x,drawPos.u,ARGB(255,255,0,0))
    end
  end
end)
 
OnUpdateBuff(function(unit,buff)
  if unit == myHero and buff.Name == "Undying Rage" then
  immunitytimer = GetGameTimer() + 5
  immunityendtime = buff.ExpireTime
  end
end)
 

  • 0

#5
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

wutt


#Zypppy Logic Kappa
  • 1

#6
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

#Zypppy Logic Kappa

+1 Kreygasm


  • 0

#7
Icesythe7

Icesythe7

    Forum Manager

  • Contributor
  • 181 posts

OnTick(function(myHero)
If GotBuff(myHero) == "TryndaRBuffName" then
PrintChat("Buff On")
end
end)

Or use something from here

Spoiler


Dunno really ¯\_(ツ)_/¯

i like this


  • 0

#8
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

check my vlad script

https://github.com/i...ladimir.lua#L82


  • 1

#9
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

i like this

everyones do, i'm sure Kappa


  • 0

#10
masterys

masterys

    Newbie

  • Members
  • 3 posts

Thanks you guys for nices replies , finaly this script is working.  :)

 

I use this to show ult timer:

local stackExpireTime = nil

OnDraw(function(myHero)
	if  stackExpireTime then
		local time = stackExpireTime - GetGameTimer()
		if time > 0 then
			DrawText("R expire in : "..string.format("%.1f",time).."s", 40,600,200,0xffffd700)
		end
	end

end)
 
local eBuffName = "UndyingRage"
OnUpdateBuff(function(object,buffProc)
	if object == myHero and buffProc.Name == eBuffName then
		stackExpireTime = buffProc.ExpireTime
	end
end)

OnRemoveBuff(function(object,buffProc)
	if object == myHero and buffProc.Name == eBuffName then
		stackExpireTime = nil
	end
end)
	

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users