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?
Scripts
RPG solid monsters
RPG solid monsters
1

Mami Tomoe has written
Mami Tomoe: That's how it was supposed to work actually, tiles to tiles(if you use
goweiwen's RPG). Yet,
EngiN33R's one is pixels to pixels. It doesn't matter though if we would have lags. 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
EngiN33R: 's script)
VADemon: By "good" he means that's what he wants, by "not done" means it's just not been made for him yet. 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
Mami Tomoe: You should edit the movement of the monster as well in that case
1
