I want to make a surface gui that will show if a server is new or old. I can’t find an example but I remember Murder Mystery 2 had something like that.
I have tried using server version but that doesnt update unless you update the server.
How can I possibly see if the game was updated since the server was out?
This was my script:
local gversion = game.PlaceVersion
script.Parent.ServerVersion.Value = game.PlaceVersion
while true do
wait(10)
if script.Parent.ServerVersion.Value < script.Parent.GameVersion.Value then
script.Parent.Text = "Server: Old"
script.Parent.TextColor3 = Color3.new(0.666667, 0, 0)
else
script.Parent.Text = "Server: New"
script.Parent.TextColor3 = Color3.new(0, 0.635294, 0)
end
end
The script above would get the value from when the server was made, and also from a different intvalue that updates the placeversion every 10 seconds. I realized that the server version always stays the same in the server and am now looking for a solution.
You can start measuring time using os.clock() when the server starts.
Never mind, above statement is correct for server age, but I obviously misread your question.
@uhi_o found a perfect solution. Alternatively and also less effectively, you could use an external source. That would be a waste of resources, although you can also transfer bigger amounts of data easier across different servers using tables, for example. That way servers reach out for the site using HttpService.
I think messaging service is one option. Everytime a server starts you fire the message to the servers with the current Version placed inside that server and do the check from the others. But then you need to update the version every time you publish which might be annoying every time.
There’s a Migrate option on your game which shuts down all servers which are outdated and reconnects the users into new up to date servers.
Then I don’t really see a point in putting something displaying if the server is outdated. Even if it were the players would have still stayed on that outdated server and wait for the server to close to get to a newer version.