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

Lua Npc sell exercise weapons

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
549
Solutions
1
Reaction score
58
Location
Lo Mochis, Sinaloa
If you could help me with an npc that sells exercise weapons and send them to the store inbox? i am using tfs 1.3 master
 
Solution
Lua:
    storei = player:addItem(2598, 1)
    if storei then
        storei:setStoreItem(true)
    end

you just need to change item ID and add charges below line 3
You're kinda close. xD
Lua:
function onUse(player, item, fromPosition, itemEx, toPosition)
storei = player:addItem(31208, 1)
    if storei then
        storei:setStoreItem(true)
    end
return true
end

I use this to use in a lever to see if works and not works, send the sword on my backpack
Try this. It should work.
Lua:
    local storeInbox = player:getStoreInbox()
    if storeInbox then
        local item = Game.createItem(2598, 1)
        if item then
            item:setStoreItem(true)
            storeInbox:addItemEx(item)...
Lua:
    storei = player:addItem(2598, 1)
    if storei then
        storei:setStoreItem(true)
    end

you just need to change item ID and add charges below line 3
Lua:
function onUse(player, item, fromPosition, itemEx, toPosition)
storei = player:addItem(31208, 1)
    if storei then
        storei:setStoreItem(true)
    end
return true
end

I use this to use in a lever to see if works and not works, send the sword on my backpack
 
Lua:
    storei = player:addItem(2598, 1)
    if storei then
        storei:setStoreItem(true)
    end

you just need to change item ID and add charges below line 3
You're kinda close. xD
Lua:
function onUse(player, item, fromPosition, itemEx, toPosition)
storei = player:addItem(31208, 1)
    if storei then
        storei:setStoreItem(true)
    end
return true
end

I use this to use in a lever to see if works and not works, send the sword on my backpack
Try this. It should work.
Lua:
    local storeInbox = player:getStoreInbox()
    if storeInbox then
        local item = Game.createItem(2598, 1)
        if item then
            item:setStoreItem(true)
            storeInbox:addItemEx(item)
            item:setStoreItem(false) -- this allows the item to be moved out of the storeInbox. Remove this line if you don't want that
        end
    end
View attachment bandicam 2021-09-26 17-03-39-377.mp4
 
Solution
Back
Top