I don't know Lua, and I don't know how it works in this game. But I want to make a simple dedicated server script, that will show messages with information periodically.
In server.lua "onStartUp() function I added string:
Server():addScriptOnce("messager.lua")
In the same folder I added messager.lua script:
if onServer() then
function initialize() --executed once at start, starting message i.e.
Server():broadcastChatMessage("Server", 3, "Starting to annoy!"%_t)
end
function getUpdateInterval() --after how many seconds, update function will be called
return 60
end
function update(timeStep) --main function, all magic here
Server():broadcastChatMessage("Server", 0, "I will annoy you!"%_t)
end
end
Comments are made by me, i can be wrong (for now, I think it all works like this).
When I launch dedicated server, it works as usual, but shows no messages. What have I done wrong?