Mauzim
Member
- Joined
- Jan 3, 2011
- Messages
- 568
- Reaction score
- 9
in tfs 4.0 i cannot use getTileItemById for what i can replace this function?
ERROR
PHP:
local teleport = {
[3103] = {action = 1, {x = 32861, y = 31061, z = 9}, {x = 32859, y = 31056, z = 9}},
[3104] = {action = 0, {x = 32856, y = 31055, z = 9}},
[3105] = {action = 1, {x = 32888, y = 31045, z = 9}, {x = 32894, y = 31044, z = 9}},
[3106] = {action = 0, {x = 32894, y = 31046, z = 9}},
}
function onStepIn(cid, item, position, lastPosition)
if(teleport[item.uid].action == 1) then
if(getTileItemById(teleport[item.uid][3], 8303).uid > 0) then
doRemoveItem(getTileItemById(teleport[item.uid][3], 8303).uid, 1)
doTeleportThing(cid, teleport[item.uid][2])
doSendMagicEffect(teleport[item.uid][2], CONST_ME_TELEPORT)
else
doTeleportThing(cid, lastPosition)
doSendMagicEffect(lastPosition, CONST_ME_ENERGY)
doCreatureSayWithRadius(cid, "You may not enter without a sacrifice of a energy soil.", TALKTYPE_ORANGE_1, 1, 1)
end
end
return true
end
ERROR
PHP:
[Error - MoveEvents Interface]
data/movements/scripts/yalahar/demonTeleport.lua:onStepIn
Description:
attempt to index a nil value
stack traceback:
[C]: in function 'getTileItemById'
data/movements/scripts/yalahar/demonTeleport.lua:10: in function <data/m
ovements/scripts/yalahar/demonTeleport.lua:8>