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 get objects around player radius


  • Please log in to reply
4 replies to this topic

#1
thevinsmarciano1

thevinsmarciano1

    Newbie

  • Members
  • 5 posts

Hi I'm actually creating a Yasuo auto Q script if an enemy is detected around the Q's distance and I'm stucked because I already maximized the search engine of google and this site but I still don't know how to get objects around the player for specific distance. Please help. Thanks


  • 0

#2
Fl0at

Fl0at

    Reseller

  • Members
  • 604 posts
you could loop through all objects and check the distance :V
  • 0

#3
puszyy

puszyy

    Advanced Member

  • Members
  • 69 posts
for _, enemy in pairs(GetEnemyHeroes()) do
		if ValidTarget(enemy, 470) then -- 470 is range
			-- add there Q cast
		end
end

If you want to check for minions, then:
for _, minion in pairs(minionManager.objects) do
	if GetTeam(minion) == MINION_ENEMY then
		if ValidTarget(minion, 470) then -- 470 is range
			-- add there Q cast
		end
	end
end

I specially insert a little bit smaller range than it's normally (475), because if you add exactly same range as it's have, then you will get worse hitchance.

Edited by puszyy, 14 April 2018 - 09:59 .

  • 1

#4
thevinsmarciano1

thevinsmarciano1

    Newbie

  • Members
  • 5 posts
for _, enemy in pairs(GetEnemyHeroes()) do
		if ValidTarget(enemy, 470) then -- 470 is range
			-- add there Q cast
		end
end

If you want to check for minions, then:
for _, minion in pairs(minionManager.objects) do
	if GetTeam(minion) == MINION_ENEMY then
		if ValidTarget(minion, 470) then -- 470 is range
			-- add there Q cast
		end
	end
end

I specially insert a little bit smaller range than it's normally (475), because if you add exactly same range as it's have, then you will get worse hitchance.

 

Is this a "for-loop" syntax that I can use inside OnDraw ? I'm new to this language! OMG thank you! I can't see the minionManager.objects in the API's though?


  • 0

#5
puszyy

puszyy

    Advanced Member

  • Members
  • 69 posts

Is this a "for-loop" syntax that I can use inside OnDraw ? I'm new to this language! OMG thank you! I can't see the minionManager.objects in the API's though?

Yes, you can use it in OnDraw, just replace Q cast lines with DrawCircle.

minionManager.objects is from Inspired library (I think lol :D)
Im amateur in scripting, but learned a lot by fixing outdated scripts and improving them for my own :D
I recommend you this form of study :)
Greetings.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users