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

TFS 1.0 max tile items limit

Can you be more specific? What exactly are you trying to do? Do you have an error, or are you trying to make a script, what do you need?
 
Use the onMoveItem function I think the same is, check data/events/scripts/player.lua.
 
Sorry for my bad english friends, my problem is: In 0.3.6 config.lua, have tilemax items right? But in 1.0 dont have it, in my server have players stacking 8 chars in the same sqm and turn on ANTIPUSH so fast, with that can CRASH or LAG my server..
@Wibben is there, but u know how i can check how many items have in a right ground?
 
Last edited:
Bump, i need this.
you need a max amount of items for each tile?
try this?
Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    local tile = Tile(toPosition)
    local max = 20
    if tile then
        if #tile:getItems() >= 20 then
            self:sendTextMessage(MESSAGE_STATUS_SMALL, 'This tile has the max amount of items on it already.')
        end
    end
    return true
end
 
you need a max amount of items for each tile?
try this?
Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    local tile = Tile(toPosition)
    local max = 20
    if tile then
        if #tile:getItems() >= 20 then
            self:sendTextMessage(MESSAGE_STATUS_SMALL, 'This tile has the max amount of items on it already.')
        end
    end
    return true
end

I add this code in the "data/events/scripts/player.lua
, in my events.xml have this too:
<event class="Player" method="onMoveItem" enabled="1" />

and Don't work bro :/
 
Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    local tile = Tile(toPosition)
    local max = 1
    if tile then
        if #tile:getItems() >= max then
            self:sendTextMessage(MESSAGE_STATUS_SMALL, 'This tile has the max amount of items on it already.')
            return false
        end
    end
    return true
end
forgot return false
 
Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    local tile = Tile(toPosition)
    local max = 1
    if tile then
        if #tile:getItems() >= max then
            self:sendTextMessage(MESSAGE_STATUS_SMALL, 'This tile has the max amount of items on it already.')
            return false
        end
    end
    return true
end
forgot return false

don't work :( i put 23423 items and don't say the alert
 
player events
Hello bro hahaha i have this error with your script.. when i move a item to the water says this error:

24ffhoh.png


is your script:
function Player:eek:nMoveItem(item, count, fromPosition, toPosition)
local tile = Tile(toPosition)
local max = 1
if tile then
if #tile:getItems() >= max then
self:sendTextMessage(MESSAGE_STATUS_SMALL, 'This tile has the max amount of items on it already.')
return false
end
end
return true
end
 
Back
Top