• 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!

Windows Some TFS 1.1 errors.

s7efan

New Member
Joined
Oct 31, 2011
Messages
28
Reaction score
1
Hey guys, I got TFS 1.1 compiled by myself on Win 7 32bits.

Got 2 problems (console errors):

first ~>
Code:
49.***.138.*** disconnected for exceeding packet per second limit.

second ~>
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/surprisebag.lua:onUse
data/actions/scripts/other/surprisebag.lua:12: attempt to get length of global 'present' (a nil value)
stack traceback:
    [C]: in function '__len'
    data/actions/scripts/other/surprisebag.lua:12: in function <data/actions/scripts/other/surprisebag.lua:10>

Cheers :)

@edit

This is my suprisebag.lua

Code:
local config = {
    [6570] = { -- blue present
        {2687, 10}, {6394, 3}, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114
    },
    [6571] = { -- red present
        {2152, 10}, {2152, 10}, {2152, 10}, 2153, 5944, 2112, 6568, 6566, 2492, 2520, 2195, 2114, 2114, 2114, 6394, 6394, 6576, 6576, 6578, 6578, 6574, 6574
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local count = 1
    local gift = present[math.random(#present)]
    if type(gift) == "table" then
        count = gift[2]
        gift = gift[1]
    end

    player:addItem(gift, count)
    item:remove(1)
    fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
    return true
end
 
Edit:
Code:
local gift = present[math.random(#present)]
To:
Code:
local gift = config[math.random(#present)]
 
Thanks for respond :) but still got that same error:
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/surprisebag.lua:onUse
data/actions/scripts/other/surprisebag.lua:12: attempt to get length of global 'present' (a nil value)
stack traceback:
    [C]: in function '__len'
    data/actions/scripts/other/surprisebag.lua:12: in function <data/actions/scripts/other/surprisebag.lua:10>

Lua Script Error: [Action Interface]
data/actions/scripts/other/surprisebag.lua:onUse
data/actions/scripts/other/surprisebag.lua:12: attempt to get length of global 'present' (a nil value)
stack traceback:
    [C]: in function '__len'
    data/actions/scripts/other/surprisebag.lua:12: in function <data/actions/scripts/other/surprisebag.lua:10>


actions.xml:
Code:
<action fromid="6570" toid="6571" script="other/surprisebag.lua"/>
 
Try this, its working for me on 1.1

Code:
local config = {
    [6570] = { -- bluePresent
        {2687, 10}, {6394, 3}, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114
    },
    [6571] = { -- redPresent
        {2152, 10}, {2152, 10}, {2152, 10}, 2153, 5944, 2112, 6568, 6566, 2492, 2520, 2195, 2114, 2114, 2114, 6394, 6394, 6576, 6576, 6578, 6578, 6574, 6574
    },
    [9108] = { -- surpriseBag
        {2148, 10}, 7487, 2114, 8072, 7735, 8110, 6574, 6394, 7377, 2667, 9693
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local present = config[item.itemid]
    if not present then
        return false
    end

    local count = 1
    local gift = present[math.random(#present)]
    if type(gift) == "table" then
        count = gift[2]
        gift = gift[1]
    end

    player:addItem(gift, count)
    item:remove(1)
    fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
    return true
end

Code:
    <action fromid="6570" toid="6571" script="other/surprisebag.lua"/>
 
Try this, its working for me on 1.1

Code:
local config = {
    [6570] = { -- bluePresent
        {2687, 10}, {6394, 3}, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114
    },
    [6571] = { -- redPresent
        {2152, 10}, {2152, 10}, {2152, 10}, 2153, 5944, 2112, 6568, 6566, 2492, 2520, 2195, 2114, 2114, 2114, 6394, 6394, 6576, 6576, 6578, 6578, 6574, 6574
    },
    [9108] = { -- surpriseBag
        {2148, 10}, 7487, 2114, 8072, 7735, 8110, 6574, 6394, 7377, 2667, 9693
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local present = config[item.itemid]
    if not present then
        return false
    end

    local count = 1
    local gift = present[math.random(#present)]
    if type(gift) == "table" then
        count = gift[2]
        gift = gift[1]
    end

    player:addItem(gift, count)
    item:remove(1)
    fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
    return true
end

Code:
    <action fromid="6570" toid="6571" script="other/surprisebag.lua"/>

Thanks, its working :)

@edit

Someone's know how to fix this error in console and kicking people from server:
Code:
49.***.138.*** disconnected for exceeding packet per second limit.
 
Back
Top