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

how to add time to this script?

tompan

Member
Joined
Dec 13, 2008
Messages
646
Reaction score
24
Location
Sweden
Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=747, y=1043, z=7, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 5006 and item.itemid == 1945 and getgate.itemid == 1353 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 5006 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(1353,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end


want the stone to get back after 1min.
 
LUA:
local e = 0

function onUse(cid, item, frompos, item2, topos)
	if item.itemid == 1945 then
		doRemoveItem(getTileItemById({x=747, y=1043, z=7}, 1353).uid)
		e = addEvent(doCreateItem, 60000, 1353, 1, {x=747, y=1043, z=7})
	else
		stopEvent(e)
		e = 0
		doCreateItem(1353, 1, {x=747, y=1043, z=7})
	end
	return 1, doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
could you add time to this one too?
function onUse(cid, item, frompos, item2, topos)
if item.uid == 8001 and item.itemid == 2699 then
doTransformItem(item.uid,item.itemid-2316)

else
doPlayerSendCancel(cid,"Sorry, not possible.")
end

return TRUE
end
 
add decayTo and duration for item 383 to items.xml, and doDecayItem(item.uid) to that script just under doTransformItem
 
LUA:
local function reset(p)
	doTransformItem(getTileItemById(p, 383).uid, 2699)
end

function onUse(cid, item, frompos, item2, topos)
	if item.itemid == 2699 then
		doTransformItem(item.uid, 383)
		addEvent(reset, 60000, frompos)
		return 1
	end
end
 
Back
Top