whitevo
Feeling good, thats what I do.
I have a tile where i want to reSpawn bucket every hour.
but every time the script starts i want it to first remove the all items from that tile before.
then create bucket there.
working script
sidenote*
you don't have to use addEvent, but my script actually continues, that is why you see them here.
This is the tile position i want to change.
you can use any function you like. I use onThink because i have a globalEvent.
You can make things clean and create items for onUse or whatever else function.
under items i collect all the items what are located in position
for every item i found in that tile: remove them all 1 sec later
2 seconds after using script (and 1 seconds after deleting all items)
makes item in the position i defined earlier
2005 is bucket and 0 means its empty.
1 would mean its water in it, etc
but every time the script starts i want it to first remove the all items from that tile before.
then create bucket there.
working script
Code:
local pos1 = {x=558,y=654,z=7}
function onThink()
local items = Tile(pos1):getItems()
for i = 1, #items do
addEvent(function() items[i]:remove() end, 1000)
end
addEvent(doCreateItem, 2000, 2005, 0, pos1)
return true
end
sidenote*
you don't have to use addEvent, but my script actually continues, that is why you see them here.
Code:
local pos1 = {x=558,y=654,z=7}
Code:
function onThink()
You can make things clean and create items for onUse or whatever else function.
Code:
local items = Tile(pos1):getItems()
Code:
for i = 1, #items do
addEvent(function() items[i]:remove() end, 1000)
end
Code:
addEvent(doCreateItem, 2000, 2005, 0, pos1)
makes item in the position i defined earlier
2005 is bucket and 0 means its empty.
1 would mean its water in it, etc
Last edited: