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

Stone appear after 15 minutes...

Nutaharion

New Member
Joined
Oct 29, 2008
Messages
133
Reaction score
4
Location
Poland
Hi,

I have problem with this script, I completly don't know how to use function onThink so I have problem's with delay beetween action.

1) Player killing monster, wall dissapear
2) Player have 15 minutes to escape the room, after that stone appear one more time and he need to kill next boss to wall dissapear

:)

Lua:
function onKill(cid, target, lastHit)
pos = {x=1173, y=974, z=14, stackpos=1}
getgate = getThingfromPos(pos)
 
	if (getCreatureName(target) == "boss") then
		if isPlayer(target) or not lastHit then
			return true 
		end
			doRemoveItem(getgate.uid, 1)
			doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)

		local function Kamien(seconds)
			doCreateItem(1355, 1, pos)
			return true
		end

		function onThink(interval)
			executeKamien(60)
			return true
		end

	end

	return true
end
 
Lua:
function doCreateGateAndBoss(gatePos, bossPos)
	doCreateItem(1355, 1, gatePos)
	doCreateMonster('Boss', bossPos)
end

function onKill(cid, target, lastHit)
	local pos = {x=1173, y=974, z=14, stackpos=1}
	local gate = getThingfromPos(pos)
	local respawnBoss = {x=1173, y=974, z=14, stackpos=1} --   <-- change this pos
	local respawnTime = 900 -- in seconds
 
	if getCreatureName(target) == 'Boss' then
		if isPlayer(cid) then
			doRemoveItem(gate.uid, 1)
			doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)
			addEvent(doCreateGateAndBoss, respawnTime * 1000, pos, respawnBoss)
		end
	end
	return true
end

register in login.lua
 
Last edited:
Back
Top