• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Problem with auto broadcast message TFS 1.0

Versteckt

New Member
Joined
Jul 3, 2013
Messages
13
Reaction score
1
Hi guys, as i said, i'm having a little problem with this script i think its not the correct one for my tfs version(1.0).

my script:

Code:
function onThink(interval, lastExecution)
MENSAGEM = {
"message 1",
"message 2",
"message 3",
"message 4",
"message 5",
}
doBroadcastMessage(MENSAGEM[math.random(1,#MENSAGEM)],22)
return TRUE
end

So i got this error on console:

Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/mensagem.lua:onThink
data/globalevents/scripts/mensagem.lua:10: attempt to call global 'doBroadcastMessage' (a nil value)
stack traceback:
        [C]: in function 'doBroadcastMessage'
        data/globalevents/scripts/mensagem.lua:10: in function <data/globalevents/scripts/mensagem.lua:2>
[Error - GlobalEvents::think] Failed to execute event: mensagem

Please can anyone help me ? Thank-you!
 
Code:
function onThink(interval, lastExecution)
MENSAGEM = {
"message 1",
"message 2",
"message 3",
"message 4",
"message 5",
}
broadcastmessage(MENSAGEM[math.random(1,#MENSAGEM)],22)
return TRUE
end

TFS 1.0 doesnt have
Code:
doBroadcastMessage
, they only have
Code:
broadcastMessage
 
Code:
function onThink(interval, lastExecution)
MENSAGEM = {
"message 1",
"message 2",
"message 3",
"message 4",
"message 5",
}
broadcastmessage(MENSAGEM[math.random(1,#MENSAGEM)],19)
end
return TRUE
end

Try this.
 
Back
Top