Jump to content

[Q]Simplest server mod/guide/help


zorgkirill

Recommended Posts

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?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...