Hello, I've been looking for a yalahar mechanism action that works, but so far I've only seen from tfs 0.4-, and it doesnt work on my server, I'll post here the action.lua that I'm using
And in actions.xml i have this
When I click on the mechanism, it says the following error:
Lua Script Error: [Action Interface]
data/actions/scripts/yalahar_mechanism.luanUse
attempt to index a nil value
stack traceback:
[C]: at 0x5588bfb89c96
[C]: in function 'doTeleportThing'
data/actions/scripts/yalahar_mechanism.lua:17: in function <data/actions/scripts/yalahar_mechanism.lua:15>
Lua:
local t = {
[51151] = {x=32729, y=31200, z=5},
[51152] = {x=32734, y=31200, z=5},
[51153] = {x=32744, y=31161, z=5},
[51154] = {x=32744, y=31164, z=5},
[51155] = {x=32776, y=31141, z=5},
[51156] = {x=32776, y=31145, z=5},
[51159] = {x=32874, y=31202, z=5},
[51160] = {x=32869, y=31202, z=5},
[51161] = {x=32855, y=31252, z=5},
[51162] = {x=32853, y=31248, z=5},
[51163] = {x=32834, y=31269, z=5},
[51164] = {x=32833, y=31266, z=5},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tmp = getThingPos(cid)
doTeleportThing(cid, t[item.uid])
doSendMagicEffect(tmp, CONST_ME_TELEPORT)
doSendMagicEffect(t[item.uid], CONST_ME_TELEPORT)
return true
end
And in actions.xml i have this
XML:
<action actionid="51151" script="yalahar_mechanism.lua"/>
<action actionid="51152" script="yalahar_mechanism.lua"/>
<action actionid="51153" script="yalahar_mechanism.lua"/>
<action actionid="51154" script="yalahar_mechanism.lua"/>
<action actionid="51155" script="yalahar_mechanism.lua"/>
<action actionid="51156" script="yalahar_mechanism.lua"/>
<action actionid="51159" script="yalahar_mechanism.lua"/>
<action actionid="51160" script="yalahar_mechanism.lua"/>
<action actionid="51161" script="yalahar_mechanism.lua"/>
<action actionid="51162" script="yalahar_mechanism.lua"/>
<action actionid="51163" script="yalahar_mechanism.lua"/>
<action actionid="51164" script="yalahar_mechanism.lua"/>
When I click on the mechanism, it says the following error:
Lua Script Error: [Action Interface]
data/actions/scripts/yalahar_mechanism.luanUse
attempt to index a nil value
stack traceback:
[C]: at 0x5588bfb89c96
[C]: in function 'doTeleportThing'
data/actions/scripts/yalahar_mechanism.lua:17: in function <data/actions/scripts/yalahar_mechanism.lua:15>