GM Middle
Learn 7.4 Tibia
- Joined
- Jul 7, 2016
- Messages
- 18
- Reaction score
- 3
Hi i have problem with this script actions
When i use item with 1878 then always i see 'Try Again'
only this part working
When i use item with 1878 then always i see 'Try Again'
Code:
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1878 and getPlayerStorageValue(cid,13340) < 0 then
setPlayerStorageValue(cid,13340,1)
doSendMagicEffect(frompos, CONST_ME_MAGIC_BLUE)
elseif item.itemid == 1856 and getPlayerStorageValue(cid,13340) == 1 then
setPlayerStorageValue(cid,13340,2)
doSendMagicEffect(frompos, CONST_ME_MAGIC_BLUE)
elseif item.itemid == 1861 and getPlayerStorageValue(cid,13340) == 2 then
setPlayerStorageValue(cid,13340,3)
doSendMagicEffect(frompos, CONST_ME_MAGIC_BLUE)
elseif item.itemid == 1867 and getPlayerStorageValue(cid,13340) == 3 then
setPlayerStorageValue(cid,13340,4)
doSendMagicEffect(frompos, CONST_ME_MAGIC_BLUE)
elseif item.itemid == 1858 and getPlayerStorageValue(cid,13340) == 4 then
setPlayerStorageValue(cid,13340,5)
doSendMagicEffect(frompos, CONST_ME_MAGIC_BLUE)
elseif item.itemid == 1865 and getPlayerStorageValue(cid,13340) == 5 then
setPlayerStorageValue(cid,13340,6)
doSendMagicEffect(frompos, CONST_ME_MAGIC_BLUE)
elseif item.itemid == 1871 and getPlayerStorageValue(cid,13340) == 6 then
setPlayerStorageValue(cid,13340,7)
doSendMagicEffect(frompos, CONST_ME_MAGIC_GREEN)
doPlayerSendTextMessage(cid,22,"You Got Access to Door! ")
else
setPlayerStorageValue(cid,13340,0)
doPlayerSendTextMessage(cid,22,"Try again! ")
doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)
end
return true
end
only this part working
Code:
setPlayerStorageValue(cid,13340,0)
doPlayerSendTextMessage(cid,22,"Try again! ")
doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)