Zerity
New Member
- Joined
- Jul 7, 2009
- Messages
- 89
- Reaction score
- 0
Hallo I have a code that "can make" so you get teleported by a lever if you put a soul stone on the coal basin and pulling the lever should make you get teleported but it wont work for me 
Thats the code i use and when i click on the lever nothings happens and i get this error in "console"function onUse(cid, item, fromPosition, itemEx, toPosition)
local tpPos = {x = 307, y = 61, z = 9}
local pPos = {x = 305, y = 61, z = 9, stackpos = 253} -- dont touch the stackpos
local itemPos = {x = 304, y = 61, z = 9, stackpos = 1}
local getItem = getThingFromPos(itemPos)
local getPlayer = getThingFromPos(pPos)
local itemId = 5944
if getPlayer.itemid > 0 then
if getItem.itemid == itemId then
doRemoveItem(getItem.uid, 1)
doSendMagicEffect(getPlayer.uid, CONST_ME_POFF)
doTeleportThing(getPlayer.uid, tpPos)
doSendMagicEffect(tpPos, 37)
else
doPlayerSendCancel(cid, "You have to stay on the right position and put the "..getItemNameById(itemId).." on the coal basin")
end
end
return TRUE
end
[12/07/2009 01:26:02] Lua Script Error: [Action Interface]
[12/07/2009 01:26:02] data/actions/scripts/tele.luanUse
[12/07/2009 01:26:02] data/actions/scripts/tele.lua:5: attempt to call global 'getThingFromPos' (a nil value)
[12/07/2009 01:26:02] stack traceback:
[12/07/2009 01:26:02] data/actions/scripts/tele.lua:5: in function <data/actions/scripts/tele.lua:1