Auto follow player
local Player = 'Player name'
local Monsters = { 'Demon', 'Demon Skeleton', 'Ghoul' }
if maround(0, table.unpack(Monsters)) == 0 and target().id == 0 then
local follow_creature = followed()
if (follow_creature.id == 0 or (follow_creature.id > 0 and follow_creature.name:lower() ~= Player:lower())) and paround(0, Player) > 0 then
follow(Player)
wait(1000)
end
end
local Player = 'Player name'
local PlayerDistance = 3 -- Distance to stay away from player.
local Monsters = { 'Demon', 'Demon Skeleton', 'Ghoul' }
local monsters_around = maroundreachable(0, table.unpack(Monsters))
if monsters_around == 0 and target().id == 0 then
local creature = getcreature(Player)
if creature.id > 0 and creature.dist > PlayerDistance then
local tries = 0
while creature.id > 0 and creature.dist > PlayerDistance do
reachcreature(Player)
creature = getcreature(Player)
tries = tries + 1
if tries >= 2 and target().id > 0 then
tries = 0
break
end
end
end
end