• 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] Item Abilities via Lua V2

jakub742

New Member
Joined
May 1, 2010
Messages
81
Solutions
1
Reaction score
3
Location
Slovakia
Hello i tried to implement this to latest tfs pull. I had no errors during compilation or during server startup.
For testing i was using action script posted somewhere here on otland. The problem is when i use this action script it shows 0 error in log, the magic effect will appear but the target item remains the same no bonuses.

<action itemid="8300" script="custom/upgrade.lua" />
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local position = player:getPosition()
    target:setAbility(ITEM_ABILITY_ABSORBPHYSICAL, 10)
    target:setAbility(ITEM_ABILITY_SKILL_SWORD, 5)
    position:sendMagicEffect(CONST_ME_MAGIC_RED)
    return true
end
EDIT:
The sword fighting is added (so its working) i just cant see the description of item with bonuses
 

SzajsNaCha

New Member
Joined
Feb 2, 2015
Messages
4
Reaction score
0
Somebody can help?

[2021-12-06 13:29:06.016] [error] Lua script error: data/global.lua
[2021-12-06 13:29:06.016] [error] data/lib/compat/compat.lua:1388: table index is nil
stack traceback:
[C]: in function '__newindex'
data/lib/compat/compat.lua:1388: in main chunk
[C]: in function 'dofile'
data/lib/lib.lua:5: in main chunk
[C]: in function 'dofile'
data/global.lua:2: in main chunk
[2021-12-06 13:29:06.017] [info] Loading data/global.lua
[2021-12-06 13:29:06.018] [error] Cannot load: data/global.lua
 

Attachments

  • Zrzut ekranu (821).png
    Zrzut ekranu (821).png
    14.3 KB · Views: 8 · VirusTotal
Last edited:
OP
OP
Infernum

Infernum

Senator
Joined
Feb 14, 2015
Messages
5,629
Solutions
559
Reaction score
3,822
Somebody can help?

[2021-12-06 13:29:06.016] [error] Lua script error: data/global.lua
[2021-12-06 13:29:06.016] [error] data/lib/compat/compat.lua:1388: table index is nil
stack traceback:
[C]: in function '__newindex'
data/lib/compat/compat.lua:1388: in main chunk
[C]: in function 'dofile'
data/lib/lib.lua:5: in main chunk
[C]: in function 'dofile'
data/global.lua:2: in main chunk
[2021-12-06 13:29:06.017] [info] Loading data/global.lua
[2021-12-06 13:29:06.018] [error] Cannot load: data/global.lua
post your compat.lua
 

SzajsNaCha

New Member
Joined
Feb 2, 2015
Messages
4
Reaction score
0
Limit 25000 characters :s
Edit: problem with that solved, but i have next problem, i can't see items when i double click on it, and when using crystal for adding bonus i have new problem:
Lua:
[2021-13-06 18:00:25.422] [error] Lua script error: data/events/scripts/player.lua:[email protected]
[2021-13-06 18:00:25.423] [error] ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: attempt to call method 'getAbilities' (a nil value)
stack traceback:
        [C]: in function 'getAbilities'
        ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: in function 'getAbilities'
        data/lib/core/item.lua:294: in function 'getDescription'
        data/events/scripts/player.lua:138: in function <data/events/scripts/player.lua:121>
[2021-13-06 18:00:25.872] [error] Lua script error: data/events/scripts/player.lua:[email protected]
[2021-13-06 18:00:25.873] [error] ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: attempt to call method 'getAbilities' (a nil value)
stack traceback:
        [C]: in function 'getAbilities'
        ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: in function 'getAbilities'
        data/lib/core/item.lua:294: in function 'getDescription'
        data/events/scripts/player.lua:138: in function <data/events/scripts/player.lua:121>
[2021-13-06 18:10:25.542] [error] Lua script error: data/events/scripts/player.lua:[email protected]
[2021-13-06 18:10:25.542] [error] ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: attempt to call method 'getAbilities' (a nil value)
stack traceback:
        [C]: in function 'getAbilities'
        ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: in function 'getAbilities'
        data/lib/core/item.lua:294: in function 'getDescription'
        data/events/scripts/player.lua:138: in function <data/events/scripts/player.lua:121>
[2021-13-06 18:10:25.940] [error] Lua script error: data/events/scripts/player.lua:[email protected]
[2021-13-06 18:10:25.940] [error] ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: attempt to call method 'getAbilities' (a nil value)
stack traceback:
        [C]: in function 'getAbilities'
        ...tservbr-global\data\scripts\ItemAbilities\extensions.lua:33: in function 'getAbilities'
        data/lib/core/item.lua:294: in function 'getDescription'
        data/events/scripts/player.lua:138: in function <data/events/scripts/player.lua:121>

and this:

Lua:
[2021-13-06 18:21:21.835] [warning] [Events::load] - Unknown player method: onInventoryUpdate
 

Attachments

Last edited:
Top