• 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 Open Teleport With Item For Seconds.

Dalt0n

Hiho:)
Joined
Dec 14, 2011
Messages
535
Reaction score
31
Location
Italia
Hello I decided to create this script, for I am in the basics of lua (; Let's start; The script consists of; If you have an item, the click, open a tp in Part X (configurable) for X time, and after that time, it closes. Since the test, and use it as a quest.

Code:
local m = {
	item = ?????,
	time = 10, -- Segundos en el que podrás utilizar el teleport
	to = { x = 1847, y = 1747, z = 10 }, -- Dónde te lleva el teleport
	tp = { x = 1843, y = 1747, z = 10 } -- Dónde aparece el teleport.
}
local function deleteTeleport()
	local teleport = getTileItemById(m.tp, 1387)
	if(teleport.uid > 0) then
		doRemoveItem(teleport.uid)
		doSendMagicEffect(m.tp, CONST_ME_POFF)
		doSendAnimatedText(m.tp, "Cerrado, llegaste tarde", TEXTCOLOR_RED)
	end
	return true
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveItem(cid, m.item) then
		doPlayerSendTextMessage(cid, ???????????, "Apresurate Se Ah Abierto")
	else
		doPlayerSendCancel(cid, "No tienes el item")
	end
	if(???????????) then
		doCreateTeleport(1387, m.to, m.tp)
		addEvent(deleteTeleport, m.time*1000)
		doCreatureSay(cid, "Tu tienes " .. m.time .. " segundos para seguir!", TALKTYPE_ORANGE_1)
	end
	return true
end


actions.xml

Code:
<action itemid="XXXX" event="script" value="tportal.lua"/>


Credits;
100% Rhyxz
 
Last edited:
that's not all .. so quickly changed to what I saw
why you the stars '*' inserted there? :w00t:

LUA:
local m = {
	item = ?????,
	time = 10, -- Segundos en el que podrás utilizar el teleport
	to = { x = 1847, y = 1747, z = 10 }, -- Dónde te lleva el teleport
	tp = { x = 1843, y = 1747, z = 10 } -- Dónde aparece el teleport.
}
local function deleteTeleport()
	local teleport = getTileItemById(m.tp, 1387)
	if(teleport.uid > 0) then
		doRemoveItem(teleport.uid)
		doSendMagicEffect(m.tp, CONST_ME_POFF)
		doSendAnimatedText(m.tp, "Cerrado, llegaste tarde", TEXTCOLOR_RED)
	end
	return true
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveItem(cid, m.item) then
		doPlayerSendTextMessage(cid, ???????????, "Apresurate Se Ah Abierto")
	else
		doPlayerSendCancel(cid, "No tienes el item")
	end
	if(???????????) then
		doCreateTeleport(1387, m.to, m.tp)
		addEvent(deleteTeleport, m.time*1000)
		doCreatureSay(cid, "Tu tienes " .. m.time .. " segundos para seguir!", TALKTYPE_ORANGE_1)
	end
	return true
end
 
How do i make it so the item disappears after one use? everything i try just debugs me
 
Back
Top