Udun
Well-Known Member
- Joined
- Jan 5, 2012
- Messages
- 192
- Solutions
- 1
- Reaction score
- 67
Hello there, today I want to share this little script that someone might need.
The script is of Cykotitan (credits to him), I saw it as response on a thread where someone need it but I want to explain it in more detail here.
Tested on TFS 0.3.6, idk if works in others.
So we go to:
data/actions/scripts, there we'll create a .lua file called kaz_elev
Inside will put this:
NOTE: Remember to check on your map editor the sqms where the player must be to use the elevator to configure the script.
Then we go to our actions.xml
We choose an action id with no use and put this (Note: in the XXXX you must put the action id):
Now we need to go to our map on the map editor and put the action ids on each lever of the kaz elevator and that should do the magic.
I hope this will be useful.
Have a nice day.
The script is of Cykotitan (credits to him), I saw it as response on a thread where someone need it but I want to explain it in more detail here.
Tested on TFS 0.3.6, idk if works in others.
So we go to:
data/actions/scripts, there we'll create a .lua file called kaz_elev
Inside will put this:
Lua:
local t = {
{x=2657, y=1655, z=7}, --coordinate of the tile down the elevator
{x=2657, y=1655, z=2} --coordinate of the tile up the elevator
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local r = item.itemid == 1945
doRelocate(t[r and 1 or 2], t[r and 2 or 1])
doSendMagicEffect(t[1], CONST_ME_POFF)
doSendMagicEffect(t[2], CONST_ME_POFF)
return doTransformItem(item.uid, r and 1946 or 1945)
end
NOTE: Remember to check on your map editor the sqms where the player must be to use the elevator to configure the script.
Then we go to our actions.xml
We choose an action id with no use and put this (Note: in the XXXX you must put the action id):
XML:
<!-- Kaz elevator-->
<action actionid="XXXX" event="script" value="kaz_elev.lua"/>
Now we need to go to our map on the map editor and put the action ids on each lever of the kaz elevator and that should do the magic.
I hope this will be useful.
Have a nice day.