So I can't walk into them.
If this is possible how will it work? Will I have to TP the player back every time he tries to go in or is there another way that works better?
addhook("move", "RPG.moveHook") function RPG.moveHook(id, x, y) 	for _, m in pairs(MONSTERS) do 		local x2, y2 = m.x, m.y 		local d = math.sqrt((x2-x)^2 + (y2-y)^2) 		if (d < 30) then 			local a = -(math.atan2(x2-x,y2-y)+math.pi/2)%(2*math.pi) 			local nx, ny = x2 + math.cos(a)*30, y2 + math.sin(a)*30 			if (tile(math.floor(nx/32), math.floor(ny/32), "walkable")) then 				parse("setpos " .. id .. " " .. nx .. " " .. ny) end end end end
for _, self in pairs(MONSTERS) do local n = -(math.atan2(self.x-x,self.y-y)+math.pi/2)%(2*math.pi) local nx, ny = self.x + math.cos(n)*32, self.y + math.sin(n)*32 local sx, sy = math.floor(nx/32), math.floor(ny/32) if (player(id,"x") < self.x + self.width and player(id,"x") + 32 > self.x and player(id,"y") < self.y + self.height and 32 + player(id,"y") > self.y) then if tile(sx, sy, "walkable") then parse("setpos " .. id .. " " .. nx .. " " .. ny) end end end