Gabriel Tibiano
New Member
- Joined
- Nov 21, 2009
- Messages
- 420
- Reaction score
- 4
Hey guys, what should i do in this script for
when i get one player or one creature under the gate
the action do not execute and return something like: 'Someone is under the gate and it can not close'
tiles under the gate:
1 = {x=73, y=97, z=7}
2 = {x=74, y=97, z=7}
3 = {x=73, y=96, z=7}
4 = {x=74, y=96, z=7}
when i get one player or one creature under the gate
the action do not execute and return something like: 'Someone is under the gate and it can not close'
tiles under the gate:
1 = {x=73, y=97, z=7}
2 = {x=74, y=97, z=7}
3 = {x=73, y=96, z=7}
4 = {x=74, y=96, z=7}
LUA:
local config = {
wall1 = {x=73, y=97, z=7, stackpos=1},
wall2 = {x=74, y=97, z=7, stackpos=1},
wall3 = {x=73, y=96, z=7, stackpos=1},
wall4 = {x=74, y=96, z=7, stackpos=1},
}
local message = {
[1] = {x=72, y=96, z=7},
[2] = {x=75, y=98, z=7},
[3] = {x=73, y=97, z=7},
}
function onUse(cid, item, frompos, item2, topos)
local t = message[math.random(1,3)]
getwall1 = getThingfromPos({x=73, y=97, z=7, stackpos=1})
getwall2 = getThingfromPos({x=74, y=97, z=7, stackpos=1})
getwall3 = getThingfromPos({x=73, y=96, z=7, stackpos=1})
getwall4 = getThingfromPos({x=74, y=96, z=7, stackpos=1})
if item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
elseif item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
end
------------------------------------------------------------------------
if getwall1.itemid == 9485 then
exhaustion.set(cid, storage, 1 * 60 * 1000)
doRemoveItem(getwall1.uid,1)
doRemoveItem(getwall2.uid,1)
doRemoveItem(getwall3.uid,1)
doRemoveItem(getwall4.uid,1)
doSendMagicEffect(config.wall1, CONST_ME_POFF)
doSendMagicEffect(config.wall2, CONST_ME_POFF)
doSendMagicEffect(config.wall3, CONST_ME_POFF)
doSendMagicEffect(config.wall4, CONST_ME_POFF)
doSendAnimatedText(t, "Criiinnkchi!", 193)
else
doCreateItem(9485,1,config.wall1)
doCreateItem(9485,1,config.wall2)
doCreateItem(9485,1,config.wall3)
doCreateItem(9485,1,config.wall4)
end
------------------------------------------------------------------------
return true
end