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

Lua [Globalevent] doesn't work!

Northnorial

Member
Joined
May 30, 2009
Messages
742
Reaction score
5
Location
Germany
The thing I wanted to make, is a teleport, which appears for 5 minutes. It will dissapear after this 5 minutes. This event will start every 2 hours.

Code:
local teleport = {x=1040, y=977, z=6, stackpos=1}
local getteleport = getThingfromPos(teleport)

function executeEvent()
	doBroadcastMessage("Event Area opening in 2 hours again!")
        doRemoveItem(getteleport.uid, 1)
	return true
end

function onThink(interval, lastExecution, thinkInterval)
	doBroadcastMessage("Event Area has been opened! It will close in 5 minutes.")
	doCreateTeleport(1387, {x=1015, y=989, z=10}, teleport)
	addEvent(executeEvent, 32000)
	return true
end


The script doesn't work! :(

Any help?
 
Code:
local teleport = {x=1040, y=977, z=6}

function removeTP()
	doBroadcastMessage("Event Area opening in 2 hours again!")
	doRemoveItem(getTileItemById(teleport, 1387).uid)
end

function onThink(interval, lastExecution, thinkInterval)
	doBroadcastMessage("Event Area has been opened! It will close in 5 minutes.")
	doCreateTeleport(1387, {x=1015, y=989, z=10}, teleport)
	addEvent(removeTP, 5 * 60 * 1000)
	return true
end
 
Back
Top