zorgkirill Posted February 18, 2017 Share Posted February 18, 2017 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 More sharing options...
Aki Posted February 18, 2017 Share Posted February 18, 2017 Server() hasn't got addScript() or addScriptOnce(). Link to comment Share on other sites More sharing options...
zorgkirill Posted February 18, 2017 Author Share Posted February 18, 2017 So I need to implement this function in server.lua, and call it from "update" function? Link to comment Share on other sites More sharing options...
zorgkirill Posted February 18, 2017 Author Share Posted February 18, 2017 Why whatever i write in server.lua update function, dedicated server acts like i din't add anything at all? I even modified server.lua of the game, but it didn't help... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now