mardi 25 mars 2014

[Help] Binding a Key topic




Ive had success with binding my own keys with Pirate Perfection, but I've come across one that I cant seem to get working, I'm trying to bind Opening deposit boxes to a key and it doesn't seem to be working. Here is the script I pulled from perfection and made into an .lua file


Code:


bankbuster = bankbuster or function()
            local depositboxes = {} --interacting while looping invalidates the table, so we have to build a list
            local id
            for _,v in pairs(managers.interaction._interactive_objects) do
                    if v.interaction then
                            id = string.sub(v:interaction()._unit:name():t(), 1, 10)
                            if id == "@ID7999172" or -- Harvest Bank
                            id == "@IDe4bc870" or id == "@ID51da6d6" or id == "@ID8d8c766" or id == "@ID50aac55" or id == "@ID5dcd177" --Armoured Transport
                            or id == "@IDe93c9b2" then -- GO Bank
                                    table.insert(depositboxes, v:interaction())
                            end
                    end
            end
                    for _,v in pairs(depositboxes) do
                    v:interact(managers.player:player_unit())
            end

bankbuster ()       

        managers.hud:show_hint( { text = "pooooof-- deposits busted" } )
    end


Can anyone help me please? Am I missing something? Any suggestions would be appreciated. Side note in captains log it throws no error when running the file but it doesn't work in game, I can get it to open from the trolls menu, but I would like it to be mapped to a single key





Aucun commentaire:

Enregistrer un commentaire