Hello, I am creating a motd for my server. I am using the script on 2 servers, the gmod single player server, and a actual server. To begin I created an HTML vgui and I am setting the html to be read from a file. Now when I test the motd in single player it works fine and updates when you reopen the menu, but when I add it to my test server it seems to not update. Even if I delete the test server file the HTML is supposed to be reading from it still displays the text I set before I moved it to the server. If I delete the file that the single player motd script is reading from the server script wont display text. Here is the look at the code:
local text = vgui.Create( "HTML", innerPanel ) text:SetHTML( file.Read( "data/motd_text.txt", true ) ) text:SetSize( innerPanel:GetWide() - 20, 315 ) text:SetPos( 10, 55 )
The code above is included in both single player server and actual server scripts as both the scripts are identical.
I tired to explain the problem the best I could, if you have any questions feel free to respond.
I’m not sure why it’s doing this. Any help would be appreciated.
[editline]21st July 2015[/editline]
Fixed (figured this out myself). You have to save the file the motd is reading from to the client by using file.Write.