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

Easy Global Event

GOD Fito

Member
Joined
Oct 3, 2008
Messages
97
Solutions
1
Reaction score
8
Hi otland,

i need easy script

In every two hours .... remove X item (id:1484) for 5 min in X position and when time runs appears the X item

with broadcast

i think is globalevent

if you dont understand

comment please!
 
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
 
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
hey @Limos i want the script script but when i use lever it count down for 1 mint and close again
 
how can i
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
how can i add more pos of more tiles?
 
Back
Top