Well I'm trying to make a script that summons a monster to the closest free tile around. The only problem is that certain borders (ocean borders to be more specific) are counted as free tiles, but you cannot summon on them. Anyone know how to workaround this?
It just doesn't seem to work at all. -.-
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local freeTile = getClosestFreeTile(cid, fromPosition)
function summonSeaCreature(cid, creatureName)
if doCreateMonster(creatureName, freeTile, false) then
ret = true
else
ret = false
end
function summonMonster(cid, creatureName)
repeat
summonSeaCreature(cid, creatureName)
until
ret == true
end
summonMonster(cid, "Rat")
It just doesn't seem to work at all. -.-