<globalevent name="item" interval="7200" event="script" value="item.lua"/>
local pos = {x=1000,y=1000,z=7}
function removeCoal()
doRemoveItem(getTileItemById(pos,1484).uid,1)
doBroadcastMessage("The coal basin is removed.")
return true
end
function returnCoal()
doCreateItem(1484,1,pos)
doBroadcastMessage("The coal basin is back.")
return true
end
function onThink(interval, lastExecution)
doBroadcastMessage("The coal basin will be removed in 20 seconds!")
addEvent(removeCoal, 20000)
addEvent(returnCoal, 320000)
return true
end
hey @Limos i want the script script but when i use lever it count down for 1 mint and close againXML:<globalevent name="item" interval="7200" event="script" value="item.lua"/>
LUA:local pos = {x=1000,y=1000,z=7} function removeCoal() doRemoveItem(getTileItemById(pos,1484).uid,1) doBroadcastMessage("The coal basin is removed.") return true end function returnCoal() doCreateItem(1484,1,pos) doBroadcastMessage("The coal basin is back.") return true end function onThink(interval, lastExecution) doBroadcastMessage("The coal basin will be removed in 20 seconds!") addEvent(removeCoal, 20000) addEvent(returnCoal, 320000) return true end
how can i add more pos of more tiles?XML:<globalevent name="item" interval="7200" event="script" value="item.lua"/>
LUA:local pos = {x=1000,y=1000,z=7} function removeCoal() doRemoveItem(getTileItemById(pos,1484).uid,1) doBroadcastMessage("The coal basin is removed.") return true end function returnCoal() doCreateItem(1484,1,pos) doBroadcastMessage("The coal basin is back.") return true end function onThink(interval, lastExecution) doBroadcastMessage("The coal basin will be removed in 20 seconds!") addEvent(removeCoal, 20000) addEvent(returnCoal, 320000) return true end