HelpClosestEntity

Posts 14 of 4 · Page 1 of 1
ClosestEntity
I saw the code somewhere but I feel stupid for not remembering it.
I basically just need to get the closest entity, and check if its alive.
Thanks.
ents.FindInSphere ?
Also, you can't use Alive() on every ents
Quote Originally Posted by Doremi Harukaze View Post
ents.FindInSphere ?
Also, you can't use Alive() on every ents
Code:
                local radius = 0
		for k,v in pairs ( player.FindInSphere(LocalPlayer():GetPos(),radius) ) do
                        if v then
			    //aimbotcodehere
                        else
                                radius++
                                return
                        end
		end
Quote Originally Posted by Trollaux View Post


Code:
                local radius = 0
		for k,v in pairs ( player.FindInSphere(LocalPlayer():GetPos(),radius) ) do
                        if v then
			    //aimbotcodehere
                        else
                                radius++
                                return
                        end
		end
Yeah, why not ? Also, i'm not sure this will work correctly, cause radius never goes down. And I don't know if ++ works (if it doesn't, use radius = radius +1).
Posts 14 of 4 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?