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

getTibiaTime() System

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,623
Solutions
6
Reaction score
539
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Hello Guys!

When I say 'time' to npcs, they don't answer.
I try using opentibia npc system and jiddo npc system.
What I have to do ?

OpenTibia NPC System
Code:
<interact keywords="time">
<response>
<action name="script">
selfSay("It is about "..getTibiaTime()..". I am so sorry, I have no watches to sell. Do you want to buy something else?")
</action>
</response>
</interact>

Jiddo NPC System
Code:
if msgcontains(msg, 'time') then
npcHandler:say('It is about "..getTibiaTime()..". I am so sorry, I have no watches to sell. Do you want to buy something else?')

getTibiaTime() Function
Code:
function getTibiaTime()
	local worldTime = getWorldTime()
	return {hours = worldTime/60, minutes = worldTime - 60}
end

or

Code:
function getTibiaTime()
    local minutes = getWorldTime()
    local hours = 0
    while (minutes > 60) do
        hours = hours + 1
        minutes = minutes - 60
    end

    return {hours = hours, minutes = minutes}
end

Thanks!
 
Code:
local time = getTibiaTime()
npcHandler:say('It is about '.. time.hours .. string.char(58) .. time.minutes ..' I am so sorry, I have no watches to sell. Do you want to buy something else?')
 
Back
Top