• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Casino slot error in console 0.4 3884

Imfreezing

Krossa Kapitalismen
Joined
Jun 7, 2012
Messages
1,009
Solutions
1
Reaction score
88
Location
Edron
Hello Otlands Support,i have a slot system that doesn't work correctly,when i flip the lever the fruits won't appear, i get this error in my console
Code:
[13:1:48.098] [Error - Action Interface]
[13:1:48.098] In a timer event called from:
[13:1:48.098] data/actions/scripts/slot.lua:onUse
[13:1:48.098] Description:
[13:1:48.098] (luaDoCreateItem) Item not found
as the title says im using 0.4 3884
This is my slot script
Code:
--[[
    .::1-Row Slot Machine::.
          for TFS 0.3
      by Cybermaster (cbrm)
]]--

--    1. COMPATIBILITY
if not Position then
    Position = function(x, y, z, stackpos)
        local position = {x = x, y = y, z = z}
        if stackpos then
            position.stackpos = stackpos
        end
        return position
    end
end

if not choose then
    choose = function(...)
        local arg, ret = {...}
        if type(arg[1]) == 'table' then
            ret = arg[1][math.random(#arg[1])]
        else
            ret = arg[math.random(#arg)]
        end
        return ret
    end
end

--    2. FRUITS
TEMP, FRUITS = {
    ['APPLE'] = 2674,    ['BANANA'] = 2676,    ['BERRY'] = 2680,
    ['CHERRY'] = 2679,    ['LEMON'] = 8841,    ['MANGO'] = 5097,
    ['MELON'] = 2682,    ['ORANGE'] = 2675,    ['PUMPKIN'] = 2683
}, {}

for name, id in pairs(TEMP) do
    _G[name] = id
    table.insert(FRUITS, id)
end

--    3. CONFIGURATION
SETUP = {
    MONEY = 1000, --REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
    TIME = 200, --MILLISECONDS TO SWITCH FRUITS
    LIMIT = 20, --COUNTER TO STOP CHANGING FRUIT IF PLAYER DOESN'T (decreases each SETUP.TIME)
    LEVER = {9825, 9826},
    WIN = {
    -- [FRUITS] = {PRIZE,#PRIZE}]
        --MIXED COMBINATIONS
            [{CHERRY,PUMPKIN,CHERRY}] = {2160,2},
            [{LEMON,MELON,LEMON}] = {2160,1},
        --TRIPLE COMBINATIONS
            [{BERRY,BERRY,BERRY}] = {2152,80},
            [{MANGO,MANGO,MANGO}] = {2152,60},
            [{PUMPKIN,PUMPKIN,PUMPKIN}] = {2152,80},
            [{MELON,MELON,MELON}] = {2152,50},
            [{BANANA,BANANA,BANANA}] = {2152,40},
            [{LEMON,LEMON,LEMON}] = {2152,25},
            [{CHERRY,CHERRY,CHERRY}] = {2152,20},
            [{ORANGE,ORANGE,ORANGE}] = {2152,30},
            [{APPLE,APPLE,APPLE}] = {2152,10},
        --ANY COMBINATIONS
            [{ANY,PUMPKIN,PUMPKIN}] = {2152,5},
            [{PUMPKIN,PUMPKIN,ANY}] = {2152,5},
            [{PUMPKIN,ANY,PUMPKIN}] = {2152,10},
            [{ANY,CHERRY,CHERRY}] = {2152,4},
            [{CHERRY,CHERRY,ANY}] = {2152,4},
            [{CHERRY,ANY,CHERRY}] = {2152,8},
            [{ANY,LEMON,LEMON}] = {2152,5},
            [{LEMON,LEMON,ANY}] = {2152,5},
            [{LEMON,ANY,LEMON}] = {2152,5},
        },
    MSG = {'Bingo!','Lucky!','Jackpot!','Win!'},
    POS = {    --[LEVER.UNIQUEID] = {direction to row, distance from lever to row, position of lever}
        [6297] = {direction = SOUTH, distance = 2, position = Position(831, 977, 7)},
        [6298] = {direction = SOUTH, distance = 2, position = Position(835, 977, 7)},
        [6299] = {direction = EAST, distance = 2, position = Position(852, 961, 7)},
        [6300] = {direction = NORTH, distance = 2, position = Position(846, 959, 7)},
        [6301] = {direction = WEST, distance = 2, position = Position(842, 961, 7)},
    },
}

for lever, row in pairs(SETUP.POS) do
    local position = getPositionByDirection(row.position, row.direction, row.distance)
    for tile = 0, 2 do
        if row.direction % 2 == 0 then
            SETUP.POS[lever][tile+1] = Position(position.x+tile, position.y, position.z, 1)
        else
            SETUP.POS[lever][tile+1] = Position(position.x, position.y+tile, position.z, 1)
        end
    end
end

--    4. FUNCTIONS
function switchLever(lev)
    return doTransformItem(lev.uid, lev.itemid == SETUP.LEVER[1] and SETUP.LEVER[2] or SETUP.LEVER[1])
end

function verifyRow(cid, pos)
    local result = false
    for combo, profit in pairs(SETUP.WIN) do
        if (getTileItemById(pos[1], combo[1]).uid > 0) or (combo[1] == ANY) then
            if (getTileItemById(pos[2], combo[2]).uid > 0) or (combo[2] == ANY) then
                if (getTileItemById(pos[3], combo[3]).uid > 0) or (combo[3] == ANY) then
                    result = true
                    doPlayerAddItem(cid, profit[1], profit[2] or 1, true)
                    doSendAnimatedText(getThingPos(cid), choose(SETUP.MSG), 66)
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won ' .. profit[2] .. ' ' .. getItemPluralNameById(profit[1]) ..'!')
                    break
                end
            end
        end
    end

    for tile = 1, 3 do
        doRemoveItem(getTileThingByPos(pos[tile]).uid)
        doSendMagicEffect(pos[tile], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
    end

    return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine :( Try again')
end

--    5. SCRIPT
function onUse(cid, item, fromPosition, itemEx, toPosition)

    if getDirectionTo(getThingPos(cid), fromPosition) > 3 then
        return true
    end

    local function getLever()
        return getTileThingByPos(fromPosition)
    end

    local function doFruit(pos, id, limit)
        if not isPlayer(cid) then
            doItemEraseAttribute(item.uid, 'aid')
            for tile = 1, 3 do
                if getTileThingByPos(pos[tile]).uid > 0 then
                    doRemoveItem(getTileThingByPos(pos[tile]).uid)
                end
            end
            return true
        end
 
        if getTileThingByPos(pos[id]).itemid < 1 then
            doSendMagicEffect(pos[id], CONST_ME_POFF)
            doCreateItem(choose(FRUITS), 1, pos[id])
        else
            doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
        end
 
        if limit < 1 then
            doSendMagicEffect(pos[id], math.random(28, 30))
            doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
            doItemSetAttribute(getLever().uid, 'aid', getLever().actionid+1)
            switchLever(getLever())
        elseif getLever().actionid > id then
            doSendMagicEffect(pos[id], math.random(28, 30))
            doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
        else
            addEvent(doFruit, SETUP.TIME, pos, id, limit-1)
        end
    end

    if item.actionid == 0 then
        if not doPlayerRemoveMoney(cid, SETUP.MONEY) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need ' .. SETUP.MONEY ..' gps to play Slot Machine.')
        end
        doItemSetAttribute(item.uid, 'aid', 1)
        doCreatureSetNoMove(cid, true)
        switchLever(item)
        doSendAnimatedText(getThingPos(cid), '-$' .. SETUP.MONEY, 180)
        for tile = 1, 3 do
            doFruit(SETUP.POS[item.uid], tile, tile*SETUP.LIMIT)
        end
    elseif isInArray({1,2,3}, item.actionid) then
        doItemSetAttribute(item.uid, 'aid', item.actionid+1)
        switchLever(item)
    elseif item.actionid == 4 then
        switchLever(item)
        doCreatureSetNoMove(cid, false)
        verifyRow(cid, SETUP.POS[item.uid])
        doItemEraseAttribute(item.uid, 'aid')
    end
    return true
end
all help is appriacted!
Imfreezing
 
Dude... those are the default coordinates of my sample map. You have to put yours otherwise it won't work
POS = { --[LEVER.UNIQUEID] = {direction to row, distance from lever to row, position of lever}
[6297] = {direction = SOUTH, distance = 2, position = Position(831, 977, 7)},
[6298] = {direction = SOUTH, distance = 2, position = Position(835, 977, 7)},
[6299] = {direction = EAST, distance = 2, position = Position(852, 961, 7)},
[6300] = {direction = NORTH, distance = 2, position = Position(846, 959, 7)},
[6301] = {direction = WEST, distance = 2, position = Position(842, 961, 7)},
},

Map Configuration:
Use this sample to guide yourself to set up your slot machines depending on the direction.
Don't forget to set actionid 6577 to the ground tiles of slot rows and lever!
lpXykPg.png
 
haha thats what I thought. You are also going to get errors if you have coords you arent using. But the ones you do have should still work if they are in the right place.
 
are you telling me that you mapped the slots in those same five positions like in the sample map?
 
Unlike Imfreezing, I edited the script to match my new locations and I get the same problem on 0.4 3884.

Code:
--[[
  .::1-Row Slot Machine::.
  for TFS 0.3
  by Cybermaster (cbrm)
]]--

--  1. COMPATIBILITY
if not Position then
  Position = function(x, y, z, stackpos)
  local position = {x = x, y = y, z = z}
  if stackpos then
  position.stackpos = stackpos
  end
  return position
  end
end

if not choose then
  choose = function(...)
  local arg, ret = {...}
  if type(arg[1]) == 'table' then
  ret = arg[1][math.random(#arg[1])]
  else
  ret = arg[math.random(#arg)]
  end
  return ret
  end
end

--  2. FRUITS
TEMP, FRUITS = {
  ['APPLE'] = 2674,  ['BANANA'] = 2676,  ['BERRY'] = 2680,
  ['CHERRY'] = 2679,  ['LEMON'] = 8841,  ['MANGO'] = 5097,
  ['MELON'] = 2682,  ['ORANGE'] = 2675,  ['PUMPKIN'] = 2683
}, {}

for name, id in pairs(TEMP) do
  _G[name] = id
  table.insert(FRUITS, id)
end

--  3. CONFIGURATION
SETUP = {
  MONEY = 1000, --REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
  TIME = 200, --MILLISECONDS TO SWITCH FRUITS
  LIMIT = 20, --COUNTER TO STOP CHANGING FRUIT IF PLAYER DOESN'T (decreases each SETUP.TIME)
  LEVER = {9825, 9826},
  WIN = {
  -- [FRUITS] = {PRIZE,#PRIZE}]
  --MIXED COMBINATIONS
  [{CHERRY,PUMPKIN,CHERRY}] = {2160,2},
  [{LEMON,MELON,LEMON}] = {2160,1},
  --TRIPLE COMBINATIONS
  [{BERRY,BERRY,BERRY}] = {2152,80},
  [{MANGO,MANGO,MANGO}] = {2152,60},
  [{PUMPKIN,PUMPKIN,PUMPKIN}] = {2152,80},
  [{MELON,MELON,MELON}] = {2152,50},
  [{BANANA,BANANA,BANANA}] = {2152,40},
  [{LEMON,LEMON,LEMON}] = {2152,25},
  [{CHERRY,CHERRY,CHERRY}] = {2152,20},
  [{ORANGE,ORANGE,ORANGE}] = {2152,30},
  [{APPLE,APPLE,APPLE}] = {2152,10},
  --ANY COMBINATIONS
  [{ANY,PUMPKIN,PUMPKIN}] = {2152,5},
  [{PUMPKIN,PUMPKIN,ANY}] = {2152,5},
  [{PUMPKIN,ANY,PUMPKIN}] = {2152,10},
  [{ANY,CHERRY,CHERRY}] = {2152,4},
  [{CHERRY,CHERRY,ANY}] = {2152,4},
  [{CHERRY,ANY,CHERRY}] = {2152,8},
  [{ANY,LEMON,LEMON}] = {2152,5},
  [{LEMON,LEMON,ANY}] = {2152,5},
  [{LEMON,ANY,LEMON}] = {2152,5},
  },
  MSG = {'Bingo!','Lucky!','Jackpot!','Win!'},
  POS = {  --[LEVER.UNIQUEID] = {direction to row, distance from lever to row, position of lever}
  [6297] = {direction = NORTH, distance = 2, position = Position(32341, 32231, 8)},
  [6298] = {direction = NORTH, distance = 2, position = Position(32352, 32231, 8)},
  [6299] = {direction = EAST, distance = 2, position = Position(852, 961, 7)},
  [6300] = {direction = NORTH, distance = 2, position = Position(846, 959, 7)},
  [6301] = {direction = WEST, distance = 2, position = Position(842, 961, 7)},
  },
}

for lever, row in pairs(SETUP.POS) do
  local position = getPositionByDirection(row.position, row.direction, row.distance)
  for tile = 0, 2 do
  if row.direction % 2 == 0 then
  SETUP.POS[lever][tile+1] = Position(position.x+tile, position.y, position.z, 1)
  else
  SETUP.POS[lever][tile+1] = Position(position.x, position.y+tile, position.z, 1)
  end
  end
end

--  4. FUNCTIONS
function switchLever(lev)
  return doTransformItem(lev.uid, lev.itemid == SETUP.LEVER[1] and SETUP.LEVER[2] or SETUP.LEVER[1])
end

function verifyRow(cid, pos)
  local result = false
  for combo, profit in pairs(SETUP.WIN) do
  if (getTileItemById(pos[1], combo[1]).uid > 0) or (combo[1] == ANY) then
  if (getTileItemById(pos[2], combo[2]).uid > 0) or (combo[2] == ANY) then
  if (getTileItemById(pos[3], combo[3]).uid > 0) or (combo[3] == ANY) then
  result = true
  doPlayerAddItem(cid, profit[1], profit[2] or 1, true)
  doSendAnimatedText(getThingPos(cid), choose(SETUP.MSG), 66)
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won ' .. profit[2] .. ' ' .. getItemPluralNameById(profit[1]) ..'!')
  break
  end
  end
  end
  end

  for tile = 1, 3 do
  doRemoveItem(getTileThingByPos(pos[tile]).uid)
  doSendMagicEffect(pos[tile], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
  end

  return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine :( Try again')
end

--  5. SCRIPT
function onUse(cid, item, fromPosition, itemEx, toPosition)

  if getDirectionTo(getThingPos(cid), fromPosition) > 3 then
  return true
  end

  local function getLever()
  return getTileThingByPos(fromPosition)
  end

  local function doFruit(pos, id, limit)
  if not isPlayer(cid) then
  doItemEraseAttribute(item.uid, 'aid')
  for tile = 1, 3 do
  if getTileThingByPos(pos[tile]).uid > 0 then
  doRemoveItem(getTileThingByPos(pos[tile]).uid)
  end
  end
  return true
  end
  if getTileThingByPos(pos[id]).itemid < 1 then
  doSendMagicEffect(pos[id], CONST_ME_POFF)
  doCreateItem(choose(FRUITS), 1, pos[id])
  else
  doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
  end
  if limit < 1 then
  doSendMagicEffect(pos[id], math.random(28, 30))
  doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
  doItemSetAttribute(getLever().uid, 'aid', getLever().actionid+1)
  switchLever(getLever())
  elseif getLever().actionid > id then
  doSendMagicEffect(pos[id], math.random(28, 30))
  doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
  else
  addEvent(doFruit, SETUP.TIME, pos, id, limit-1)
  end
  end

  if item.actionid == 0 then
  if not doPlayerRemoveMoney(cid, SETUP.MONEY) then
  return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need ' .. SETUP.MONEY ..' gps to play Slot Machine.')
  end
  doItemSetAttribute(item.uid, 'aid', 1)
  doCreatureSetNoMove(cid, true)
  switchLever(item)
  doSendAnimatedText(getThingPos(cid), '-$' .. SETUP.MONEY, 180)
  for tile = 1, 3 do
  doFruit(SETUP.POS[item.uid], tile, tile*SETUP.LIMIT)
  end
  elseif isInArray({1,2,3}, item.actionid) then
  doItemSetAttribute(item.uid, 'aid', item.actionid+1)
  switchLever(item)
  elseif item.actionid == 4 then
  switchLever(item)
  doCreatureSetNoMove(cid, false)
  verifyRow(cid, SETUP.POS[item.uid])
  doItemEraseAttribute(item.uid, 'aid')
  end
  return true
end

All animations show up on the correct locations, only items do not spawn.
 
Unlike Imfreezing, I edited the script to match my new locations and I get the same problem on 0.4 3884.

Code:
--[[
  .::1-Row Slot Machine::.
  for TFS 0.3
  by Cybermaster (cbrm)
]]--

--  1. COMPATIBILITY
if not Position then
  Position = function(x, y, z, stackpos)
  local position = {x = x, y = y, z = z}
  if stackpos then
  position.stackpos = stackpos
  end
  return position
  end
end

if not choose then
  choose = function(...)
  local arg, ret = {...}
  if type(arg[1]) == 'table' then
  ret = arg[1][math.random(#arg[1])]
  else
  ret = arg[math.random(#arg)]
  end
  return ret
  end
end

--  2. FRUITS
TEMP, FRUITS = {
  ['APPLE'] = 2674,  ['BANANA'] = 2676,  ['BERRY'] = 2680,
  ['CHERRY'] = 2679,  ['LEMON'] = 8841,  ['MANGO'] = 5097,
  ['MELON'] = 2682,  ['ORANGE'] = 2675,  ['PUMPKIN'] = 2683
}, {}

for name, id in pairs(TEMP) do
  _G[name] = id
  table.insert(FRUITS, id)
end

--  3. CONFIGURATION
SETUP = {
  MONEY = 1000, --REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
  TIME = 200, --MILLISECONDS TO SWITCH FRUITS
  LIMIT = 20, --COUNTER TO STOP CHANGING FRUIT IF PLAYER DOESN'T (decreases each SETUP.TIME)
  LEVER = {9825, 9826},
  WIN = {
  -- [FRUITS] = {PRIZE,#PRIZE}]
  --MIXED COMBINATIONS
  [{CHERRY,PUMPKIN,CHERRY}] = {2160,2},
  [{LEMON,MELON,LEMON}] = {2160,1},
  --TRIPLE COMBINATIONS
  [{BERRY,BERRY,BERRY}] = {2152,80},
  [{MANGO,MANGO,MANGO}] = {2152,60},
  [{PUMPKIN,PUMPKIN,PUMPKIN}] = {2152,80},
  [{MELON,MELON,MELON}] = {2152,50},
  [{BANANA,BANANA,BANANA}] = {2152,40},
  [{LEMON,LEMON,LEMON}] = {2152,25},
  [{CHERRY,CHERRY,CHERRY}] = {2152,20},
  [{ORANGE,ORANGE,ORANGE}] = {2152,30},
  [{APPLE,APPLE,APPLE}] = {2152,10},
  --ANY COMBINATIONS
  [{ANY,PUMPKIN,PUMPKIN}] = {2152,5},
  [{PUMPKIN,PUMPKIN,ANY}] = {2152,5},
  [{PUMPKIN,ANY,PUMPKIN}] = {2152,10},
  [{ANY,CHERRY,CHERRY}] = {2152,4},
  [{CHERRY,CHERRY,ANY}] = {2152,4},
  [{CHERRY,ANY,CHERRY}] = {2152,8},
  [{ANY,LEMON,LEMON}] = {2152,5},
  [{LEMON,LEMON,ANY}] = {2152,5},
  [{LEMON,ANY,LEMON}] = {2152,5},
  },
  MSG = {'Bingo!','Lucky!','Jackpot!','Win!'},
  POS = {  --[LEVER.UNIQUEID] = {direction to row, distance from lever to row, position of lever}
  [6297] = {direction = NORTH, distance = 2, position = Position(32341, 32231, 8)},
  [6298] = {direction = NORTH, distance = 2, position = Position(32352, 32231, 8)},
  [6299] = {direction = EAST, distance = 2, position = Position(852, 961, 7)},
  [6300] = {direction = NORTH, distance = 2, position = Position(846, 959, 7)},
  [6301] = {direction = WEST, distance = 2, position = Position(842, 961, 7)},
  },
}

for lever, row in pairs(SETUP.POS) do
  local position = getPositionByDirection(row.position, row.direction, row.distance)
  for tile = 0, 2 do
  if row.direction % 2 == 0 then
  SETUP.POS[lever][tile+1] = Position(position.x+tile, position.y, position.z, 1)
  else
  SETUP.POS[lever][tile+1] = Position(position.x, position.y+tile, position.z, 1)
  end
  end
end

--  4. FUNCTIONS
function switchLever(lev)
  return doTransformItem(lev.uid, lev.itemid == SETUP.LEVER[1] and SETUP.LEVER[2] or SETUP.LEVER[1])
end

function verifyRow(cid, pos)
  local result = false
  for combo, profit in pairs(SETUP.WIN) do
  if (getTileItemById(pos[1], combo[1]).uid > 0) or (combo[1] == ANY) then
  if (getTileItemById(pos[2], combo[2]).uid > 0) or (combo[2] == ANY) then
  if (getTileItemById(pos[3], combo[3]).uid > 0) or (combo[3] == ANY) then
  result = true
  doPlayerAddItem(cid, profit[1], profit[2] or 1, true)
  doSendAnimatedText(getThingPos(cid), choose(SETUP.MSG), 66)
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won ' .. profit[2] .. ' ' .. getItemPluralNameById(profit[1]) ..'!')
  break
  end
  end
  end
  end

  for tile = 1, 3 do
  doRemoveItem(getTileThingByPos(pos[tile]).uid)
  doSendMagicEffect(pos[tile], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
  end

  return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine :( Try again')
end

--  5. SCRIPT
function onUse(cid, item, fromPosition, itemEx, toPosition)

  if getDirectionTo(getThingPos(cid), fromPosition) > 3 then
  return true
  end

  local function getLever()
  return getTileThingByPos(fromPosition)
  end

  local function doFruit(pos, id, limit)
  if not isPlayer(cid) then
  doItemEraseAttribute(item.uid, 'aid')
  for tile = 1, 3 do
  if getTileThingByPos(pos[tile]).uid > 0 then
  doRemoveItem(getTileThingByPos(pos[tile]).uid)
  end
  end
  return true
  end
  if getTileThingByPos(pos[id]).itemid < 1 then
  doSendMagicEffect(pos[id], CONST_ME_POFF)
  doCreateItem(choose(FRUITS), 1, pos[id])
  else
  doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
  end
  if limit < 1 then
  doSendMagicEffect(pos[id], math.random(28, 30))
  doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
  doItemSetAttribute(getLever().uid, 'aid', getLever().actionid+1)
  switchLever(getLever())
  elseif getLever().actionid > id then
  doSendMagicEffect(pos[id], math.random(28, 30))
  doTransformItem(getTileThingByPos(pos[id]).uid, choose(FRUITS))
  else
  addEvent(doFruit, SETUP.TIME, pos, id, limit-1)
  end
  end

  if item.actionid == 0 then
  if not doPlayerRemoveMoney(cid, SETUP.MONEY) then
  return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need ' .. SETUP.MONEY ..' gps to play Slot Machine.')
  end
  doItemSetAttribute(item.uid, 'aid', 1)
  doCreatureSetNoMove(cid, true)
  switchLever(item)
  doSendAnimatedText(getThingPos(cid), '-$' .. SETUP.MONEY, 180)
  for tile = 1, 3 do
  doFruit(SETUP.POS[item.uid], tile, tile*SETUP.LIMIT)
  end
  elseif isInArray({1,2,3}, item.actionid) then
  doItemSetAttribute(item.uid, 'aid', item.actionid+1)
  switchLever(item)
  elseif item.actionid == 4 then
  switchLever(item)
  doCreatureSetNoMove(cid, false)
  verifyRow(cid, SETUP.POS[item.uid])
  doItemEraseAttribute(item.uid, 'aid')
  end
  return true
end

All animations show up on the correct locations, only items do not spawn.
we have the exact same problem
 
I had that same error I just cant remember how I fixed it plus I am using 1.0 and I don't know how to read your error line. Like which line the problem is in.
[13:1:48.098] [Error - Action Interface]
[13:1:48.098] ????
 
Code:
[16:5:29.794] [Error - Action Interface]
[16:5:29.794] data/actions/scripts/slot.lua:onUse
[16:5:29.795] Description:
[16:5:29.795] (luaDoRemoveItem) Item not found

I see he updated one of the errors for 1.0, I don't see an update for 0.4 - 3884
 
Last edited:
Back
Top