stringdeveloper
New Member
- Joined
- Mar 25, 2014
- Messages
- 25
- Reaction score
- 2
Someone here can help me to make a max tile items limit?
you need a max amount of items for each tile?Bump, i need this.
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
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 falseCode: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
works fine for me loldon't worki put 23423 items and don't say the alert
Hmmm you put this script exactly where?works fine for me lol
i tested it
wont let me put any items if there's 1 on the tile
try troubleshooting with print
player eventsHmmm you put this script exactly where?
Ready bro thanks you! I have other question, I want a script for "house level player and one house per account" in tfs 1.0 you can make this possible?player events
Hello bro hahaha i have this error with your script.. when i move a item to the water says this error:player events
function PlayernMoveItem(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
Hello bro hahaha i have this error with your script.. when i move a item to the water says this error:
![]()
is your script:
player events
use the script i posted lol.I have the same bug, check up please
use the script i posted lol.
if its not working enable onmoveitem event in your xml
...Yes bro i use your script, and the OnMoveItem its "on" and its working fine but when a item moving to the water get error in console...
...
how am i expected to help you if you dont tell me what the error is