johnsamir
Advanced OT User
HI
i know that getthingfrompos code was removed in tfs 1.5
this script is not working in tfs 1.5 but it used to work in tfs 0.4
geisor show me the way how to update it. and now look like this but the script is not working either or sending errors in console.
as you can see the script has two actions id one where do you need to add an scarab coins and another where you only should step into the teleport flame
none of both function ain't working
ideas?
thanks
i know that getthingfrompos code was removed in tfs 1.5
this script is not working in tfs 1.5 but it used to work in tfs 0.4
Lua:
--function onStepIn(cid, item, pos)
-- coin = {x=33240, y=32855, z=13, stackpos=1}
-- newpos = {x=33246, y=32850, z=13}
-- getcoin = getThingPosition(coin)
-- if item.actionid == 6007 and getcoin.itemid == 2159 then
-- doTeleportThing(cid,newpos)
-- doRemoveItem(getcoin.uid,1)
-- doSendMagicEffect(coin, CONST_ME_MAGIC_RED)
-- doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
-- else
-- end
-- if item.actionid == 6008 then
-- doTeleportThing(cid, {x=33239, y=32856, z=13})
-- doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
-- end
-- return true
--end
geisor show me the way how to update it. and now look like this but the script is not working either or sending errors in console.
as you can see the script has two actions id one where do you need to add an scarab coins and another where you only should step into the teleport flame
none of both function ain't working
Code:
--adaptation felipe93
local coinPosition = {x=33240, y=32855, z=13}
local coinItemId = 2159
local newPosition = {x=33246, y=32850, z=13}
function onStepIn(cid, item, pos)
if item.actionid == 6007 then
local coinItem = Tile(coinPosition):getItemById(coinItemId)
if coinItem then
coinItem:remove(1)
doTeleportThing(cid,newPosition)
doSendMagicEffect(coinPosition, CONST_ME_MAGIC_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
end
end
if item.actionid ==6008 then
doTeleportThing(cid, {x=33239, y=32856, z=13})
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
end
return true
end
Code:
<moveevent event="StepIn" tileitem="1" actionid="6007" script="The Ancient Tombs Quest/Mahrdis/coalbasin.lua"/>
<!-- <moveevent event="StepIn" actionid="6007" script="The Ancient Tombs Quest/Mahrdis/coalbasin.lua"/> -->
<moveevent event="StepIn" actionid="6008" script="The Ancient Tombs Quest/Mahrdis/coalbasin.lua"/>
thanks