• 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
430
Solutions
1
Reaction score
38
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)...
OP
OP
nefinoo

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
430
Solutions
1
Reaction score
38
Location
Lo Mochis, Sinaloa
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
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,825
Solutions
438
Reaction score
3,967
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
Top