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

[Action] The World Board

christx

New Member
Joined
Jun 25, 2017
Messages
24
Reaction score
2
Hi,
I need script for the world board that will showing players on Server Log channel current world changes like Fury Gate etc after clicking on the world board. I tried to do it on my way (code below) , but result is like this

Lua:
local strings = {
     [1] = {storage = FuryGates, string = "A fiery fury gate has opened near one of the major cities somewhere in Tibia."}, -- Fury Gates
    [2] = {storage = 100, string = "A fiery fury gate has opened near one of the major cities somewhere in Tibia."}, -- Fury Gates
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
     for i = 0, #strings do
         local t = strings[i]
         if Game.getStorageValue(t.storage)
             player:sendTextMessage(MESSAGE_EVENT_ADVANCE, strings.string)
         end
     end
     return true
end

Result (Server Log)
Code:
13:11
13:11

 
Lua:
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, strings.string)
Lua:
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, t.string)
 
@Xikini, I checked your code but there is a error in console like this:
IXlbdVc.png
I'm at work, can upload the image to OtLand or literally any other image hoster? :p
My work doesn't like imgur.

If it's what I think it is though,
change "string" to "text" in your table and in that line.
I believe string is a guarded word? idk how to explain
like if you use 'string.lower' it's a predefined function..
So your script is probably freaking out, cuz it doesn't know what 't.string' is.

anyways..
Try this, and post errors.

Lua:
local strings = {
    [1] = {storage = FuryGates, text = "A fiery fury gate has opened near one of the major cities somewhere in Tibia."}, -- Fury Gates
    [2] = {storage = 100, text = "A fiery fury gate has opened near one of the major cities somewhere in Tibia."}, -- Fury Gates
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    for i = 0, #strings do
        local t = strings[i]
        if Game.getStorageValue(t.storage)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, t.text)
        end
    end
    return true
end
 
Ok bro as you wish :p

Hmm, I'm newbie in coding Lua/C++ so that's what you are telling is so 'black magic' for me right now :D Anyway I am gonna test this code and we will see results

@edit:
Script is loading but after clicking on the world board there appears these errors
 

Attachments

Last edited:
Ok bro as you wish :p

Hmm, I'm newbie in coding Lua/C++ so that's what you are telling is so 'black magic' for me right now :D Anyway I am gonna test this code and we will see results

@edit:
Script is loading but after clicking on the world board there appears these errors
Code:
local strings = {
    [1] = {storage = FuryGates, text = "A fiery fury gate has opened near one of the major cities somewhere in Tibia."}, -- Fury Gates
    [2] = {storage = 100, text = "A fiery fury gate has opened near one of the major cities somewhere in Tibia."}, -- Fury Gates
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    for i = 0, #strings do
        local t = strings[i]
        if Game.getStorageValue(t.storage) then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, t.text)
        end
    end
    return true
end
 
Okey bro, finally works :D thank you soooooo much :)
15:36 A fiery fury gate has opened near one of the major cities somewhere in Tibia.
15:36 A fiery fury gate has opened near one of the major cities somewhere in Tibia.
 
Back
Top