• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Check area if there are any monsters

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
Hi OtLanders!

I am sure of that this script exist somewhere, BUT I am not able to find it.

What the script is suppose to do:
When you use the lever, the script shall check if there is any monster from.xyz to.xyz
If there are any monsters there then don't do anything.
If there aren't any monsters there, then summon a creature.

I tried to make the script myself (But as someone already told me, I really sux at scripting <_<)

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = { x=10001, y=10644, z=7},
local from = { x=9996, y=10636, z=7 },
local to = { x=10005, y=10651, z=7},
if(item.itemid == 1945) then
	for x = from.x, to.x do
		for y = from.y, to.y do
			for z = from.z, to.z do
				if isMonster(v) then
					doPlayerSendTextMessage(cid, 19,"The mini boss is already summoned!")
				else
					doSummonCreature("Mad Technomancer", pos)
				end
			end
		end
	end
end
return true
end

Thanks in Advance
Tosse12
 
Lua:
local pos = { x=98, y=139, z=7}
local from = { x=90, y=137, z=7 }
local to = { x=96, y=142, z=7}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 1945) then
			search = 0
				for t = from.x, to.x do
					for f = from.y, to.y do
						pos = {x=t,y=f,z=7}
						pid = getTopCreature(pos).uid
							if isMonster(pid) then
								search = true
							end
					end
				end
 
				if search == true then
					doPlayerSendTextMessage(cid, 19,"The mini boss is already summoned!")
				else
					doSummonCreature("Mad Technomancer", pos)
					doTransformItem(item.uid,1946)
				end
	else
		doTransformItem(item.uid,1945)
	end
return true
end
 
Last edited:
Thanks :p now it atleast summons a monster :p
But, the main problem is that, it still summons a monster when I am using the lever, even though there is a monster there :(
 
Back
Top