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

Solved TFS 1.2 Auto Broadcast [SOLVED]

Xaqiion

New Member
Joined
May 8, 2015
Messages
11
Reaction score
1
I used this script for my server when i used TFS 1.1

Code:
function onThink(interval, lastExecution)
    local MESSAGE = {
        "[COMMAND] Use !buyaddon to buy addons to your outfit.",
        "[FORUM] Report bugs on the forum! We have admins checking there every day!",
        "[Fixing] We are working on to fix POI, INQ and Svargrond Arena. News on updates made on them can be found on nightimpot.zapto.org",
        "[INFO] You can buy your blessings from Quentin in Thais tempel.",
    }
    broadcastMessage(MESSAGE[math.random(1, #MESSAGE)], MESSAGE_STATUS_WARNING)
    return true
end

Now i compiled TFS 1.2 and added this script and i started to get this error.

Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/others/autobroadcast.lua:onThink
data/globalevents/scripts/others/autobroadcast.lua:8: attempt to call global 'br
oadcastMessage' (a nil value)
stack traceback:
        [C]: in function 'broadcastMessage'
        data/globalevents/scripts/others/autobroadcast.lua:8: in function <data/
globalevents/scripts/others/autobroadcast.lua:1>
[Error - GlobalEvents::think] Failed to execute event: autoBroadcast

Scratching my head and i Think i missed something but cant find out what.
Anyone have a clue?
 
I solved it..
I changed
Code:
broadcastMessage(MESSAGE[math.random(1, #MESSAGE)], MESSAGE_STATUS_WARNING)
to
CODE]
Game.broadcastMessage(MESSAGE[math.random(1, #MESSAGE)], MESSAGE_STATUS_WARNING)
[/CODE]
 
I can share my script :p
Code:
<globalevent name="globalTip" interval="900000" script="globalTip.lua"/>
Code:
local message = {
    "Are you stuck somewhere? type !exit. Don't forget to report bug place with !bug command.",
    "To see full list of available commands type !commands.",
    "Please report bugs with command !bug description. Your position when reporting is saved so please stay near bug position.",
    }

local i = 0
function onThink(interval, lastExecution)
local message = message[(i % #message) + 1]
    addEvent(Game.broadcastMessage, 150, 'Info: ' .. message .. '', MESSAGE_STATUS_CONSOLE_ORANGE)
    i = i + 1
    return true
end
You are welcome.
 
I can share my script :p
Code:
<globalevent name="globalTip" interval="900000" script="globalTip.lua"/>
Code:
local message = {
    "Are you stuck somewhere? type !exit. Don't forget to report bug place with !bug command.",
    "To see full list of available commands type !commands.",
    "Please report bugs with command !bug description. Your position when reporting is saved so please stay near bug position.",
    }

local i = 0
function onThink(interval, lastExecution)
local message = message[(i % #message) + 1]
    addEvent(Game.broadcastMessage, 150, 'Info: ' .. message .. '', MESSAGE_STATUS_CONSOLE_ORANGE)
    i = i + 1
    return true
end
You are welcome.
thank you
 
Back
Top