• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

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!
 

Limos

Senator
Premium User
Joined
Jun 7, 2010
Messages
10,013
Solutions
8
Reaction score
3,035
Location
Netherlands
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
 

cuba

New Member
Joined
Feb 24, 2015
Messages
136
Reaction score
2
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
 

Sotomayor

New Member
Joined
Jan 28, 2012
Messages
76
Reaction score
4
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?
 
Top