Nightimarez
New Member
- Joined
- Jul 24, 2008
- Messages
- 287
- Reaction score
- 2
This script rotates tapestrys by clicking use on them. If you have it in your backpack, it causes an error and disappears. I need for it to only work on the ground.
Heres some functions that could help.
And this is the error I get.
PHP:
function onUse(cid, item, frompos, item2, topos)
cortina1 = {x=topos.x-1, y=topos.y, z=topos.z}
cortina2 = {x=topos.x+1, y=topos.y-1, z=topos.z}
cortina3 = {x=topos.x, y=topos.y+1, z=topos.z}
if item.itemid == 1857 or item.itemid == 1860 or item.itemid == 1863 or item.itemid == 1866 or item.itemid == 1869 or item.itemid == 1872 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid-1,1,cortina1)
return 1
elseif item.itemid == 1856 or item.itemid == 1859 or item.itemid == 1862 or item.itemid == 1865 or item.itemid == 1868 or item.itemid == 1871 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid-1,1,cortina2)
return 1
elseif item.itemid == 1855 or item.itemid == 1858 or item.itemid == 1861 or item.itemid == 1864 or item.itemid == 1867 or item.itemid == 1870 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid+2,1,cortina3)
elseif item.itemid == 1880 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid-1,1,cortina1)
elseif item.itemid == 1879 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid-1,1,cortina2)
elseif item.itemid == 1878 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid+2,1,cortina3)
elseif item.itemid == 5616 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid-1,1,cortina1)
elseif item.itemid == 5615 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid-1,1,cortina2)
elseif item.itemid == 5614 then
doRemoveItem(item.uid,1)
doCreateItem(item.itemid+2,1,cortina3)
return 1
end
end
Heres some functions that could help.
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if fromPosition.x ~= CONTAINER_POSITION then
fireworksEffect = math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE)
doSendMagicEffect(fromPosition, fireworksEffect)
else
doSendMagicEffect(fromPosition, CONST_ME_HITBYFIRE)
doSendMagicEffect(fromPosition, CONST_ME_EXPLOSIONAREA)
doCreatureSay(cid, "Ouch! Rather place it on the ground next time.", TALKTYPE_ORANGE_1)
doCreatureAddHealth(cid, -10)
end
doRemoveItem(cid, item.uid, 1)
return TRUE
end
And this is the error I get.
PHP:
[05/05/2011 16:14:05] luaDoCreateItem(). ( 65534 / 00064 / 000 ) Tile not found
[05/05/2011 16:14:05] stack traceback:
[05/05/2011 16:14:05] [C]: in function 'doCreateItem'
[05/05/2011 16:14:05] data/actions/scripts/other/tapestry.lua:11: in function <data/actions/scripts/other/tapestry.lua:3>
Last edited: