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

Item TP

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I have a script that you use the item in and go to one place,

and I want to boot him in action id, as would? (I AM VERY NOOB IN SCRIPT:p)

script:

LUA:
function onUse(cid, item, fromPosition, itemEx, topos)
local newPosition = {x = 924, y = 1363, z = 7}
        if item.itemid == 3613 then -- delete this line?
                doTeleportThing(cid, newPosition, true)
        doSendMagicEffect(fromPosition, CONST_ME_STUN)
       doSendMagicEffect(newPosition, CONST_ME_STUN)
        end
        return true
end
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local function delete(tp)
		doRemoveItem(tp.uid)
	end
	local cfg = {
		time = 10 * 1000,
		pos = { x = 924, y = 1363, z = 7 }
	}
	local storage = 54312
	local exhausted = exhaustion.check(cid, cfg.storage)
	if(not exhausted) then
		local pzLocked = isPlayerPzLocked(cid)
		if(not pzLocked) then
			exhaustion.set(cid, cfg.storage, cfg.time)
			tp = doCreateTeleport(1387, cfg.pos, toPosition)
			addEvent(delete, cfg.time, tp)
		else
			doPlayerSendCancel(cid, "You are in a fight.")
		end
	else
		doPlayerSendCancel(cid, "You are exhausted.")
	end
	return true
end
 
Code:
local newPosition = {x = 924, y = 1363, z = 7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doTeleportThing(cid, newPosition)
	doSendMagicEffect(fromPosition, CONST_ME_STUN)
	doSendMagicEffect(newPosition, CONST_ME_STUN)
	return true
end
Register it with actionID in actions.xml and give it an actionID in editor[?] :p
 
Back
Top