tomaszek123
Active Member
- Joined
- May 29, 2014
- Messages
- 87
- Solutions
- 2
- Reaction score
- 25
Running it in 8.6 tfs 1.3 nekiros and got it running but player does not receive items, as stated above I tried to replace the inbox since 8.6 doesnt have it but I'm not really good at scripting and player just doesnt receive items. This is what I changed in the Winner section
If someone could help out it would be greatly appreciatedLUA:function SnakeEvent.win(winner) local bag = Game.createItem(SnakeEvent.reward.bagId, 1) if bag then for _, it in pairs(SnakeEvent.reward.items) do if it.chance >= math.random(1, 100) then bag:addItem(it.itemId, it.count) end end winner:addItem(bag) -- Pretty much just replaced this line winner:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You reward: %s.\nCheck your inbox!", bag:getContentDescription())) end
function SnakeEvent.win(winner)
local bag = winner:addItem(SnakeEvent.reward.bagId, 1)
if bag then
for _, it in pairs(SnakeEvent.reward.items) do
if it.chance >= math.random(1, 100) then
bag:addItem(it.itemId, it.count)
end
end
winner:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You reward: %s.\nCheck your inbox!", bag:getContentDescription()))
end
if SnakeEvent.debug then
print(string.format("[SnakeEvent/Debug] %s is the winner.", winner:getName()))
end
end
Are you in a protection zone?TFS 1.5 12.86
I am having this issue no errors in console its just doesn't spawn "snake"
View attachment 68856
Use:Ctrl
+Arrrows
Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
...ktop\TFS-1.5-Downgrades-7.72\data\scripts\snakeevent.lua:166: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: at 0x7ff7cec13160
[C]: in function 'pairs'
...ktop\TFS-1.5-Downgrades-7.72\data\scripts\snakeevent.lua:166: in function 'step'
...ktop\TFS-1.5-Downgrades-7.72\data\scripts\snakeevent.lua:202: in function <...ktop\TFS-1.5-Downgrades-7.72\data\scripts\snakeevent.lua:200>