• 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 Back MSg

Kippetjee

Member
Joined
Jun 17, 2009
Messages
1,197
Reaction score
11
Location
The Netherlands
Hello

im using this script for removing a stone and it get back in 3 minutes
but can some one make when the stone is back that it give a msg

"The stone in the sewers have been placed back. If you didn't get out you are locked in."
LUA:
local gatepos = {x=949, y=1133, z=8, stackpos=1} 
local newstone = 0
function onUse(cid, item, frompos, item2, topos) 
	local getgate = getThingfromPos(gatepos) 
	if(item.uid == 10200) then
		if(item.itemid == 1945 and getgate.itemid == 1355) then 
			doRemoveItem(getgate.uid, 1) 
			doTransformItem(item.uid, 1946)
			newstone = addEvent(recreateStone, 1000*60, {pos = gatepos, item = item})
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The stone in the sewers have been moved. You have exactly three minutes to enter the dungeon, get your reward and get the hell out of there before you get locked in.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
		elseif(item.itemid == 1946 and getgate.itemid == 0) then 
			doCreateItem(1353,1,gatepos) 
			doTransformItem(item.uid, 1945)
			stopEvent(newstone)
		end
	else 
		doPlayerSendCancel(cid,"Sorry, not possible.") 
	end
	return TRUE
end 
function recreateStone(param)
	doCreateItem(1355, 1, param.pos)
	doTransformItem(param.item.uid, 1945)
	newstone = 0
end
 
Code:
local gatepos = {x=949, y=1133, z=8, stackpos=1} 
local newstone = 0
function onUse(cid, item, frompos, item2, topos) 
	local getgate = getThingfromPos(gatepos) 
	if(item.uid == 10200) then
		if(item.itemid == 1945 and getgate.itemid == 1355) then 
			doRemoveItem(getgate.uid, 1) 
			doTransformItem(item.uid, 1946)
			newstone = addEvent(recreateStone, 1000*60, {cid = cid, pos = gatepos, item = item})
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The stone in the sewers have been moved. You have exactly three minutes to enter the dungeon, get your reward and get the hell out of there before you get locked in.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
		elseif(item.itemid == 1946 and getgate.itemid == 0) then 
			doCreateItem(1353,1,gatepos) 
			doTransformItem(item.uid, 1945)
			stopEvent(newstone)
		end
	else 
		doPlayerSendCancel(cid,"Sorry, not possible.") 
	end
	return TRUE
end 
function recreateStone(param)
	if(isPlayer(param.cid)) then
		doPlayerSendTextMessage(param.cid, MESSAGE_STATUS_WARNING, "The stone in the sewers have been placed back. If you didn't get out you are locked in.")
	end
	doCreateItem(1355, 1, param.pos)
	doTransformItem(param.item.uid, 1945)
	newstone = 0
end

(:
 
Back
Top