• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved [Request] Item (Action) To send player to temple with a delay of 30 minutes.

Xeikh

詠春 ☯
Joined
Oct 23, 2009
Messages
724
Reaction score
17
Can someone help me to script a item with that effect?... adding it a text and specialeffect like teleport effect then player is teleported from and to?

for example:

using teleport:

From place the player was before teleport -effect: bats-
and the place the place the player appear -effect: teleport-

it would send it to temple... can please someone help me?:$
 
Last edited:
edit "ITEM" for the item what do you want to use

XML:
<action itemid="ITEM" script="teleport.lua"/>

edit the config and save this script with the name "teleport.lua"

LUA:
local vars = {
      posicion = {x=1000, y=1000, z=7}, 
      efecto1 = 2, -- effect in the last position  
      efecto2 = 10, -- effect in the new position
      texto = "Edit here your custom text when the player is teleported."
}

function onUse (cid, item, frompos, itemEx, topos)
    return (doSendMagicEffect(frompos, vars.efecto1) and doTeleportThing(cid, vars.posicion) and doSendMagicEffect(getPlayerPosition(cid), vars.efecto2) and doPlayerSendTextMessage(cid, TALKTYPE_PRIVATE, vars.texto))
end

test and post
 
Last edited:
me worksO.o! i understand tile xd!

I edited*
seconds.. etc.

LUA:
local m = {
	item = ?????,
	time = 10, -- Seconds in which you can use the teleport
	to = { x = 1, y = 2, z = 7}, -- Where you take the teleport
	tp = { x = 1, y = 2, z = 7} -- Where teleport appears.
}
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, "Closed, you were later", TEXTCOLOR_RED)
	end
	return true
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveItem(cid, m.item) then
		doPlayerSendTextMessage(cid, ???????????, "Hurry has been opened")
	else
		doPlayerSendCancel(cid, "You don't have item")
	end
	if(???????????) then
		doCreateTeleport(1387, m.to, m.tp)
		addEvent(deleteTeleport, m.time*1000)
		doCreatureSay(cid, "You Have " .. m.time .. " seconds to go!", TALKTYPE_ORANGE_1)
	end
	return true
end
 
Last edited:
edit "ITEM" for the item what do you want to use

XML:
<action itemid="ITEM" script="teleport.lua"/>

edit the config and save this script with the name "teleport.lua"

LUA:
local vars = {
      posicion = {x=1000, y=1000, z=7}, 
      efecto1 = 2, -- effect in the last position  
      efecto2 = 10, -- effect in the new position
      texto = "Edit here your custom text when the player is teleported."
}

function onUse (cid, item, frompos, itemEx, topos)
    return (doSendMagicEffect(frompos, vars.efecto1) and doTeleportThing(cid, vars.posicion) and doSendMagicEffect(getPlayerPosition(cid), vars.efecto2) and doPlayerSendTextMessage(cid, TALKTYPE_PRIVATE, vars.texto))
end

test and post

Hi, before anything, thx a lot:D

but i forgot to say something:$
can add something for the player cant use it if have PZ?
and the frompos effect dont works from far, only if u use the item from 1sqm from position to teleport.. :$

Please can help me?
 
Back
Top