• 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 Scroll tps you to "x"pos, then to temple, then disappear

Rufo

New Member
Joined
Jan 9, 2008
Messages
251
Reaction score
1
I saw a friend of mine, asking for this script, this tps you to an "x" position, then you use it again and tps you back to temple, you may not have pz lock. its fully configurable and please dont delete the credits :*.

Tested on TFS 0.3.4+ (It only prints an error but theres no problem)

LUA:
function onUse(cid, item, frompos, item2, topos)
-- 100% by Rufo
-- [url]Http://myrland.servegame.com/[/url]

-- Config

local iditem = XXXX -- Id of your scroll.
local actionitem = XXXX -- Actionid thats gonna be added to scroll.
local temple = getPlayerMasterPos(cid) -- Dont touch
local nuevapos = {x=xxxx, y=xxxx, z=x} -- New position

-- End config

if item.itemid == iditem and isPlayerPzLocked(cid) == FALSE then
	if item.actionid == actionitem then
		doTeleportThing(cid,temple)	
		doRemoveItem(item.uid,1)
	else
	doSetItemActionId(item.uid, actionitem)
	doTeleportThing(cid,nuevapos)
	end
	else
	doCreatureSay(cid,"You cant use this scroll with protection zone lock.", TALKTYPE_ORANGE_1)

end
return TRUE
end

And on actions.xml
<action itemid="Itemidofthescript" event="script" value="nameofscript.lua" />
<action actionid="actionidofthescript" event="script" value="nameofscript.lua" />
 
Last edited:
Error:

[13/08/2009 21:42:08] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/heartstone.lua)
[13/08/2009 21:42:08] data/actions/scripts/heartstone.lua:20: '<eof>' expected near 'end'
[13/08/2009 21:42:08] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/heartstone.lua)
[13/08/2009 21:42:08] data/actions/scripts/heartstone.lua:20: '<eof>' expected near 'end'

(yes i've putted the script where it should be. data/actions/scripts.)
 
Yes i did.
As far as I know if I replace the file.lua name's it should work the same as it should be with the original name.
However, I've renmed it like the name what is in your tuturail but it give's the same problem.

----------------------------------------------------------------
~Feel free to if my post helped you :D
----------------------------------------------------------------

 
LUA:
  function onUse(cid, item, frompos, item2, topos)
-- 100% by Rufo
-- [url]Http://myrland.servegame.com/[/url]

-- Config

local iditem = XXXX -- Id of your scroll.
local actionitem = XXXX -- Actionid thats gonna be added to scroll.
local temple = getPlayerMasterPos(cid) -- Dont touch
local nuevapos = {x=xxxx, y=xxxx, z=x} -- New position

-- End config

if item.itemid == iditem and isPlayerPzLocked(cid) == FALSE then
        if item.actionid == actionitem then
                doTeleportThing(cid,temple)    
                doRemoveItem(item.uid,1)
        else
        doSetItemActionId(item.uid, actionitem)
        doTeleportThing(cid,nuevapos)
        end
        else
        doCreatureSay(cid,"No puedes usar el scroll con protection zone lock.", TALKTYPE_ORANGE_1)

end
return TRUE
end
 
anny discription of what you'll meen with your post?..

----------------------------------------------------------------
~Feel free to if my post helped you :D
----------------------------------------------------------------

 
Last edited:
I havent seen some things on spanish, does the return true fix it?
 
Tell me, why player with PZ Locked can enter to PRotection zone (i think that temple is one of them);> you should rewrite it;P
 
Code:
if (hasCondition(cid, CONDITION_INFIGHT) == true) then
	return true
end
 
so, whole script would look:

LUA:
  function onUse(cid, item, frompos, item2, topos)
-- 100% by Rufo
-- [url]Http://myrland.servegame.com/[/url]

-- Config

local iditem = XXXX -- Id of your scroll.
local actionitem = XXXX -- Actionid thats gonna be added to scroll.
local temple = getPlayerMasterPos(cid) -- Dont touch
local nuevapos = {x=xxxx, y=xxxx, z=x} -- New position

-- End config

if item.itemid == iditem then
if (hasCondition(cid, CONDITION_INFIGHT) == true) then
        if item.actionid == actionitem then
                doTeleportThing(cid,temple)    
                doRemoveItem(item.uid,1)
        else
        doSetItemActionId(item.uid, actionitem)
        doTeleportThing(cid,nuevapos)
        end
        else
        doCreatureSay(cid,"You cant use this scroll with protection zone lock.", TALKTYPE_ORANGE_1)
end
end
return TRUE
end

i think "isPlayerPZLocked" won't work with new skull system, so the way that chojrak shows is good ;)

btw. @chorak Zajebisty avatar xD
 
Back
Top