• 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!

Problems with script [fixed]

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
what i want it to do is kinda like this 1
http://otland.net/f81/release-annihilator-v2-1-a-45958/
Code:
credits to shawak for idea =D

the thing is that when someone is inside it still is possible to enter, and the monsters arnt deleted if it's emty inside.

LUA:
local mobx =  {
	mob1 = {x=1122, y=958, z=7},
	mob2 = {x=1130, y=958, z=7},
	mob3 = {x=1126, y=956, z=7},
	mob4 = {x=1126, y=963, z=7},
	mob5 = {x=1126, y=959, z=7},
	mob6 = {x=1126, y=960, z=7},
	mob7 = {x=1126, y=962, z=7},
	mob8 = {x=1126, y=955, z=7}
}

local room = { -- room with monsters
	fromX = 1119,
	fromY = 954,
	fromZ = 7,
       
	toX = 1135,
	toY = 963,
	toZ = 7
}



function onStepIn(cid, item, pos)
	if item.uid == 14999 then
		if(item.itemid == 1387) then
			doSummonCreature("minotaur", mobx.mob1)
			doSummonCreature("minotaur", mobx.mob2)
			doSummonCreature("minotaur", mobx.mob3)
			doSummonCreature("minotaur", mobx.mob4)
			addEvent(mino1, 25 * 1000, p)
		elseif item.uid == 14999 then
			local player_room =  0
			for x = room.fromX, room.toX do
				for y = room.fromY, room.toY do
					for z = room.fromZ, room.toZ do
						local pos = {x=x, y=y, z=z, stackpos = 253}
						local thing = getThingfromPos(pos)
						if thing.itemid > 0 then
							if isPlauer(thing.uid) == true then
								player_room = player_room+1
							end
						end
					end
				end
			end
			if player_room >= 1 then
				doPlayerSendTextMessage(cid,19,"there is already a player in the quest room.")
			end
		elseif player_room == 0 then
			for x = room.fromX, room.toX do
				for y = room.fromY, room.toY do
					for z = room.fromZ, room.toZ do
						local pos = {x=x, y=y, z=z, stackpos = 253}
						local thing = getThingfromPos(pos)
						if thing.itemid > 0 then
							doRemoveCreature(thing.uid)
						end
					end
				end
			end
		end
	end
return true
end

function mino1(p)
		doSummonCreature("minotaur guard", mobx.mob1)
		addEvent(mino2, 25 * 1000, p)
    return false
end

function mino2(p)
		doSummonCreature("minotaur", mobx.mob5)
		doSummonCreature("minotaur", mobx.mob6)
		doSummonCreature("minotaur", mobx.mob7)
		doSummonCreature("minotaur", mobx.mob8)
		doSummonCreature("minotaur guard", mobx.mob1)
		stopEvent(mino1)
		stopEvent(mino2)
    return false
end
 
Last edited:
Back
Top