Skip to content

Lua API improvements

Compare
Choose a tag to compare
@maximegmd maximegmd released this 22 Dec 22:42
· 1291 commits to master since this release

You can now pass ref and wref to functions as well as create TweakDBID and ItemID objects.

Sample:

player = Game.GetPlayer()
ts = Game.GetTransactionSystem()

tid = TweakDBID.new("Items.money")
itemid = ItemID.new(tid)

result = ts:GiveItem(player, itemid, 100000)
if result then
    print("We added " .. tostring(itemid) .. " to the inventory!")
else
    print("Failed to add " .. tostring(itemid))
end