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 ~>
second ~>
Cheers
@edit
This is my suprisebag.lua
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