Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPlayersAround(radius, ...)
- local t = {...}
- local players = {}
- if type(radius) == "table" then
- range, multiFloor = radius[1], radius[2]
- else
- range, multiFloor = radius, false
- end
- local spectators = Self.GetSpectators()
- for i = 1, #spectators do
- local creature = spectators[i]
- if creature:isPlayer() and creature:DistanceFromSelf() <= range then
- if not table.contains(t, creature:Name()) then
- table.insert(players, creature)
- end
- end
- end
- return players
- end
- function playersAround(radius, ...)
- if getPlayersAround(radius, ...) then
- return #getPlayersAround(radius, ...)
- else
- return 0
- end
- end
- while true do
- if not XenoBot.IsPaused() then
- if playersAround(8) > 0 then
- setTargetingEnabled(false)
- Self.StopAttack() -- Cancel attack
- else
- setTargetingEnabled(true)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement