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

RevScripts never ending box items

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,394
Reaction score
162
hey hey, got idea to share and ask for making it real :)

tfs 1.4++ 1098
the idea:
if i put in rme a box and in box lets say a 1x fish and 1x leather boots(as example) , can be any item.

in online server i come to the box , i shall not be aible to move the box or step on it either monsters, i shall be aible to open the box and see the items, i can take the items out and as i take items out , box refresh same sec having same items, exaust on move/take item shall be given on player, not on chest.


also if possible and if its easy option, in config i would like to enable or dissable, the possability to spawn monsters(from config list) , monster spawn only if while any player is near box by 0-2x sqm, and with some exaust on spawn and if max summons is 10, summon 1 by 1 with exaust not 10 in one time.

And player who takes item out starts getting random burn physical or holy or energy or fire or death or poison burn for 8 seconds, burn every 1 sec.

any upgrades or adjustments to make it better can be added i guess :) i think its realy great idea and can be played around nicely


i hope someone can scriptplay around with this idea :))
 
I suggest studying a little more how TFS logic works to try to apply a new idea like this.
The way you are proposing is making it too complicated, you can have the same objective in a way that is aligned with the functions of tfs. For example, why take away the player's moving item? he wouldn't move any more items. Putting this only on the player for items only in the box is much more complicated than thinking any other way.
 
LUA:
local config = {
    actionId = 65300,
    storageKey = 46870,
    exhaustion = 10 -- seconds
}

local event = EventCallback -- or Event()

function event.onMoveItem(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
    if item:getActionId() == config.actionId then return RETURNVALUE_NOTMOVEABLE end
    local topParent = item:getTopParent()
    if toCylinder and toCylinder:isItem() and toCylinder:getActionId() == config.actionId then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You can't put items into this chest.")
        return RETURNVALUE_NOTPOSSIBLE
    end
    if topParent and topParent:isItem() and topParent:getActionId() == config.actionId then
        local timing = tonumber(player:getStorageValue(config.storageKey)) or 0
        if timing > os.time() then
            player:sendTextMessage(MESSAGE_INFO_DESCR,
                "You need to wait " ..
                (timing - os.time()) .. " seconds to take items from this chest again.")
            return RETURNVALUE_NOTPOSSIBLE
        end

        local cloneItem = item:clone()
        cloneItem:moveTo(toCylinder)
        player:setStorageValue(config.storageKey, os.time() + config.exhaustion)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found " .. cloneItem:getName() .. ".")
        return RETURNVALUE_NOTPOSSIBLE
    end
    return RETURNVALUE_NOERROR
end

event:register()

dfgfdgfdg.gif

Here I leave you the logic of the chest, I didn't do the monsters thing.
 

Similar threads

Back
Top