Here is what I have in a Script in ServerScriptService.
local currentVer = game.Workspace.PlaceVersion.Value local getPlaceVer = game.PlaceVersion local stats1 = game.workspace.ServerStats.GameVersion.SurfaceGui.Stat local stats2 = game.workspace.ServerStats.GameVersion.SurfaceGui.StatDrop print(getPlaceVer, "Script Ran") while true do repeat wait() until currentVer ~= getPlaceVer local getPlaceVer = game.PlaceVersion print(getPlaceVer) stats1.Text = "Outdated" stats1.TextColor3 = Color3.new(255, 0, 0) stats2.Text = "Outdated" break end
Please read on how
game.PlaceVersion works. It says in the roblox official wiki that this variable is not updated, and only shows the place version that the server is currently on, in this case, it returns the exact same value as currentVer
. You need to save the new version in a data store, and have every server check its version against the datastore version, and if their version is greater, then set the datastore version to that server's version, doing this will allow servers to then check their version against the datastored version to see if their version is less then, if so, then you change the text.
Heres a dummy script, which you will need to change to suit your needs.
local datastore= game:GetService("DatastoreService"):GetDatastore("GameVer") local key= "serverversion" local placeVer= datastore:GetAsync(key) local currentVer= game.PlaceVersion if placeVer then if placeVer<=game.PlaceVersion then datastore:SetAsync(key,game.PlaceVersion) currentVer= game.PlaceVersion end else datastore:SetAsync(key,game.PlaceVersion) end --We have to wait 6+ secs so that we can make sure the datastore wont error. (I have a module that can be used to sort of make this easier, link below code block). --Also not really recommended you do a while wait in a while wait, but you can modify this to your liking. while wait() do while wait(6) do placeVer= datastore:GetAsync(key) if not placeVer then break end repeat wait() until placeVer>currentVer --Rest of your code. end end
If you want my module to make datastore setting, getting and saving a little easier(also has a neat function to save almost all value objects), then click here.