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

[TFS 1.3] EventCallback: Firestorm Event

maper1

New Member
Joined
Aug 17, 2012
Messages
38
Reaction score
0
I found the problem, if I put an area with nothing just the floor it works more if I put something on the ground it gives error, can you help me?

 
OP
OP
Sarah Wesker

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
1,036
Solutions
102
Reaction score
1,093
Location
London
GitHub
MillhioreBT
Updated your main post, in the future use the report button 👍
Very much thank, and ok i use button in the future
Post automatically merged:

I found the problem, if I put an area with nothing just the floor it works more if I put something on the ground it gives error, can you help me?

and the error? show me

i use that:

1609891028031.png
 
OP
OP
Sarah Wesker

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
1,036
Solutions
102
Reaction score
1,093
Location
London
GitHub
MillhioreBT

your error description is strange and it doesn't seem to be part of the code that I post here, I have also tried to reproduce your problem by editing a map with many things, walls, walls and more, and it still works fine, and to complete you are not using TFS 1.3, you are using OTServ BR, In theory it should be compatible, but it was not my intention to make this event for OTServ BR users
 

Gicu

Premium User
Premium User
Joined
Feb 26, 2011
Messages
185
Reaction score
45
Lua:
if config.miscellaneous.enterOnlyInPzTile then
        if not player:getPosition():getTile():hasFlag(TILESTATE_PROTECTIONZONE) then
            player:sendCancelMessage("You can enter only in PZ.")
            return false
        end
    end

I have problem with this on TFS 1.3 this is solution:


Lua:
   if config.miscellaneous.enterOnlyInPzTile then
    local tile = Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE)
        if not tile then
            player:sendCancelMessage("You can enter only in PZ.")
            return false
        end
    end
 

tommy727272

New Member
Joined
Feb 23, 2019
Messages
19
Reaction score
2
how to fix this error, im using 8.60 realmap

C:\demonica\data\scripts\firestorm.lua:206: attempt to call method 'getInbox' (a nil value)
stack traceback:
[C]: in function 'getInbox'
C:\demonica\data\scripts\firestorm.lua:206: in function <C:\demonica\data\scripts\firestorm.lua:193>
 

oualid6496

Well-Known Member
Joined
Aug 24, 2014
Messages
408
Solutions
4
Reaction score
77
Location
Dordrecht, The Netherlands
how to fix this error, im using 8.60 realmap

C:\demonica\data\scripts\firestorm.lua:206: attempt to call method 'getInbox' (a nil value)
stack traceback:
[C]: in function 'getInbox'
C:\demonica\data\scripts\firestorm.lua:206: in function <C:\demonica\data\scripts\firestorm.lua:193>
What tfs are you using? This script is for tfs 1.3 it seems you're missing the method 'getInbox'.
 

DreadShi

Member
Joined
May 18, 2019
Messages
180
Reaction score
7
data\scripts\firestorm.lua:432: attempt to call method 'getTile' (a nil value)
stack traceback:
 

beenii

Active Member
Joined
Jul 26, 2010
Messages
485
Solutions
1
Reaction score
27
time = "20:02:10", -- time to start event each day

"10:00:00", "15:00:00", "20:00:00" <-- for example

how add more hours?
 

Evil Puncker

prolonged absenteeism
TFS Developer
Joined
May 30, 2009
Messages
8,041
Solutions
215
Reaction score
3,881
Somebody maybe remake this script for 8.6 tibia?

this already works on tibia 8.6, you just need to edit the inbox part to send to depot chest instead

(note: tfs 1.3+ only, if you are using 0.4 there is no way)
 

Nefre

Member
Joined
May 17, 2012
Messages
27
Reaction score
7
Lua:
function _FSE.sendRewards()
    local winner = Player(config.cache.players[1])
    if not winner then
        _FSE.close()
        return
    end
    local depot = winner:getDepotChest(winner:getTown():getId(), true)
    local bag = Game.createItem(config.rewardBag, 1)
    if bag then
        for _, reward in pairs(config.rewards) do
            if reward.chance >= math.random(1, 100) then
                bag:addItemEx(Game.createItem(reward.itemId, reward.count), INDEX_WHEREEVER, FLAG_NOLIMIT)
            end
        end
    if depot then
    local description, items = "You rewards: ", bag:getItems()
            for _, item in pairs(items) do
                description = string.format("%s%d %s%s", description, item:getCount(), item:getName(), (_ == #items and '.' or ', '))
            end
            depot:addItemEx(bag)
            winner:sendTextMessage(MESSAGE_INFO_DESCR, description..'\nCheck your depot inbox.')
            winner:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Firestorm] You have received a reward item. Check your depot.')
        end
        Game.broadcastMessage(winner:getName() .. ' has won firestorm event.')
    end
    _FSE.close()
end

I made this its work i got a reward to depot but after when i make server save i have error with database:
 

Attachments

Evil Puncker

prolonged absenteeism
TFS Developer
Joined
May 30, 2009
Messages
8,041
Solutions
215
Reaction score
3,881
@Nefre
try adding item first, and then moving it to depot (moveTo), and source will take care of using proper data for depot entry

something like this:
Lua:
                        local send_depot = winner:addItem(your code here)
                        if send_depot then
                            local depot = winner:getDepotChest(winner:getTown():getId())
                            send_depot:moveTo(depot)
                        end
 

Nefre

Member
Joined
May 17, 2012
Messages
27
Reaction score
7
@Nefre
try adding item first, and then moving it to depot (moveTo), and source will take care of using proper data for depot entry

something like this:
Lua:
                        local send_depot = winner:addItem(your code here)
                        if send_depot then
                            local depot = winner:getDepotChest(winner:getTown():getId())
                            send_depot:moveTo(depot)
                        end
I gave up with sending bag to depot. Now the bag goes to player backpack. When i save server and player have this reward in backpack it's ok zero error's but when player put away reward to depot and i save the server there is an error again.

Lua:
function _FSE.sendRewards()
    local winner = Player(config.cache.players[1])
    if not winner then
        _FSE.close()
        return
    end
    local bag = winner:addItem(config.rewardBag, 1)
    if bag then
        for _, reward in pairs(config.rewards) do
            if reward.chance >= math.random(1, 100) then
                bag:addItem(reward.itemId, reward.count, INDEX_WHEREEVER, FLAG_NOLIMIT)
            end
        end
    end
    winner:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Firestorm] You have received reward items. Check your backpack.')
    Game.broadcastMessage(winner:getName() .. ' has won firestorm event.')
    _FSE.close()
end
1637082029052.png
 
Top