Matt17
New Member
- Joined
- Apr 24, 2010
- Messages
- 52
- Reaction score
- 0
Error when i try to use it:
[05/04/2016 01:53:11] [Error - Action Interface]
[05/04/2016 01:53:11] data/actions/scripts/items/Slithery.lua
nUse
[05/04/2016 01:53:11] Description:
[05/04/2016 01:53:11] data/actions/scripts/items/Slithery.lua:13: attempt to index field '?' (a nil value)
[05/04/2016 01:53:11] stack traceback:
[05/04/2016 01:53:11] data/actions/scripts/items/Slithery.lua:13: in function <data/actions/scripts/items/Slithery.lua:12>
Script is :
local coin = 2143
local lever = {
[1000] = {25,10137},
[1001] = {25,5468},
[1002] = {25,5956},
[1003] = {25,11115},
[1004] = {25,12610},
[1005] = {25,12609},
[1006] = {25,12607},
[1007] = {25,12607}
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "you need "..lever[item.actionid][1].." " ..getItemNameById(coin))
end
doPlayerAddItem(cid,lever[item.actionid][2])
doPlayerSendTextMessage(cid,22,"you bought one " .. getItemNameById(lever[item.actionid][2]))
doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
return true
end
anyone know whats wrong ?
[05/04/2016 01:53:11] [Error - Action Interface]
[05/04/2016 01:53:11] data/actions/scripts/items/Slithery.lua
[05/04/2016 01:53:11] Description:
[05/04/2016 01:53:11] data/actions/scripts/items/Slithery.lua:13: attempt to index field '?' (a nil value)
[05/04/2016 01:53:11] stack traceback:
[05/04/2016 01:53:11] data/actions/scripts/items/Slithery.lua:13: in function <data/actions/scripts/items/Slithery.lua:12>
Script is :
local coin = 2143
local lever = {
[1000] = {25,10137},
[1001] = {25,5468},
[1002] = {25,5956},
[1003] = {25,11115},
[1004] = {25,12610},
[1005] = {25,12609},
[1006] = {25,12607},
[1007] = {25,12607}
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "you need "..lever[item.actionid][1].." " ..getItemNameById(coin))
end
doPlayerAddItem(cid,lever[item.actionid][2])
doPlayerSendTextMessage(cid,22,"you bought one " .. getItemNameById(lever[item.actionid][2]))
doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
return true
end
anyone know whats wrong ?