• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Remove and reset back. Rep++ for sure

sick

Member
Joined
Feb 5, 2009
Messages
258
Reaction score
6
Location
Lithuania, Vilnius
If anyone could help me out here i would realy appreciate it. I need script for this action with reset timer for 1min ( the wall has to appear back ) :
hkhk.png


Thanks in advance :thumbup:
 
Not Tested

Only need to edit the "CFG."

data/actions/scripts/script.lua
LUA:
local cfg = {
	ClickHere = XXXX, -- Item you click.
	GATE_ID = XXXX, -- The gate item id.
	ClickUID = 3300, -- Item you click, unique ID.
	gateTime = 3 -- Minutes to leave gate open.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local gatePosition = {x=100, y=100, z=7, stackpos=1} -- Position of the gate.
        local getGate = getThingFromPos(gatePosition)
	if (item.itemid == cfg.ClickHere) and (getGate.itemid == cfg.GATE_ID) then
		doRemoveItem(getGate.uid)
		doSendMagicEffect(gatePosition, CONST_ME_POFF)
		doCreatureSay(getCreaturePosition(cid), "You have ".. cfg.gateTime .." minutes to enter the teleport.", TALKTYPE_ORANGE_1)
		addEvent(doCreateItem, cfg.gateTime * 60 * 1000, cfg.GATE_ID, 1, gatePosition)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The gate appears to already be missing.")
	end
	return true
end
 
Last edited:
Back
Top