Ecstacy
Mothafuckaaa
Hey,
I'm experimenting with local t[~],
but it keeps telling me it can't find the monster name.
I don't want the script to be shrinked, but I want to know what I did wrong.
Thanks in advance,
unknown666
I'm experimenting with local t[~],
but it keeps telling me it can't find the monster name.
I don't want the script to be shrinked, but I want to know what I did wrong.
Code:
[12/05/2010 19:01:37] [Error - Action Interface]
[12/05/2010 19:01:37] data/actions/scripts/other/pokeball.lua:onUse
[12/05/2010 19:01:37] Description:
[12/05/2010 19:01:37] (luaDoSummonMonster) Creature not found
LUA:
local storage = 50715
local t = {
[1] = {name='red butterfly'},
[2] = {name='dragon'},
[3] = {name='squirrel'}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) < 1 then
local pick = math.random(1,3)
doSummonMonster(t[pick].name, getThingPos(cid))
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'You have summoned a random monster to help you!')
doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
return doRemoveItem(item.uid)
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try to say !resetstorage and see if it works')
doSendMagicEffect(getThingPos(cid), 2)
end
return TRUE
end
Thanks in advance,
unknown666