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

Delvire

°£°
Joined
Feb 24, 2008
Messages
236
Reaction score
9
Hello everybody. I have a sample question.

I would like to make a global event, where it would check the Tibian Time (getTibiaTime()), and, if the time is X, then the script would summon an npc (doCreateNpc(name, pos))at a Y coord.

Else, remove the NPC

Thanks from now.


Delvire will REP ++
 
Thanks for helping, but i am really noob, and I could not understand, how to get the tibian time, just like a watch


can this line help me?
Lua:
(os.date('%M') * 60 + os.date('%S')) / 150
 
This is the final noobish solution

Lua:
function onStartup()

local spawnpos = {x=727, y=546, z=7}

if getWorldTime() < 1200 then -- 1200 means 12:00, I think
doCreateNpc("Aldrey", spawnpos)
end
	return true
end

thanks everybody
 
Back
Top