I can happily share this with you:
Code:
-------Anti-KS Script
MA = 2 -------How many monsters around you for the Script to cancel (This will make you KS)
function getMonstersAround(radius, ...)
local t = {...}
local monsters = {}
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if (creature:isValid()) and creature:ID() ~= Self.ID() then
if (creature:isOnScreen() and creature:isVisible() and creature:isAlive()) then
if not creature:isPlayer() then
local name = creature:Name()
if (creature:DistanceFromSelf() <= radius) then
if (#t > 0 and table.contains(t, name)) or (#t == 0) then
table.insert(monsters, creature)
end
end
end
end
end
end
return monsters
end
function monstersAround(radius, ...)
if getMonstersAround(radius, ...) then
return #getMonstersAround(radius, ...)
else
return 0
end
end
function getPlayersAround(radius, ...)
local t = {...}
local players = {}
if (radius == 0) then
radius = 8
end
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if (creature:isValid()) and creature:ID() ~= Self.ID() then
if (creature:isOnScreen() and creature:isVisible() and creature:isAlive()) then
if creature:isPlayer() then
local name = creature:Name()
if (creature:DistanceFromSelf() <= radius) then
if (not table.contains(t, name)) then
table.insert(players, creature)
end
end
end
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 (playersAround(7) == 0) or (Self.TargetID() ~= 0) or ((monstersAround(1) > MA) and (playersAround(1) == 0)) or ((monstersAround(1) > 0) and (playersAround(3) == 0)) then
setTargetingEnabled(true)
wait(500)
else