How to make a game version checker

Hello, I am trying to make a small GUI that appears at the bottom left of my game letting people know what version the game is (Not the place version) and if it’s out of date.

For example:
The current game version is 1.2.5b
The server that the user is in is version 1.2.5b this will have the text show green saying you are on the current version.

If the version the user is in was 1.2.5a it would have text in red saying you are on an outdated game version.

I know you can get the place version with Game.PlaceVersion

I’m assuming you could compare the game place version with the most current place version but I’m curious how you would get the current place version on an older place version.

I’m new to scripting so if there is an obvious way to do this I apologize for wasting your time.

1 Like

I found this that shows how to do it:

Hope it can help you!

1 Like

still though, why don’t you just use migrate to latest update or shut down all servers?

That’s useful but it can disturb players if they are in the middle of a game. I publish a lot of minor updates to my game and shutting down for such a minor thing feels like I’m annoying other people.

1 Like

i see, but wouldn’t it be hard for them to find an updated server? it’ll just be joining and rejoining trying to get in a new server. unless you have something for that

not my script its from the fourm the first person replied from but here

edited to make more simple

local MarketplaceService = game:GetService("MarketplaceService")
local placeVersion = MarketplaceService:GetProductInfo(game.PlaceId).Updated
local headerText = "Version: " .. placeVersion

script.Parent.Text = headerText

tell me if something is wrong.

You could just teleport all of the existing players to a reserved server and then when the game is done updating, you teleport them back to new servers.

2 Likes

It could be possible to use a server listing feature that also has the version but that’s complex. I usually migrate the update when the game is least active. It really is that important to find an updated server as if I don’t migrate the update it’s probably a very minor update.

1 Like

yeah, a good way of doing this is using soft shutdowns.

2 Likes

That could work and is what I currently do manually using a soft shutdown command in Adonis. I’ll see if there is a way to make this happen on every active server for the game.

use the script i showed but. it doesn’t show its outdated. ill try to find a solution

copied this from Roblox’s developer website for a base to start on this. I think I might be able to make it where a place version = a version number so it will show up how I want it to show up instead of just the place version. So instead of saying Server Version: 10 it will say Server Version: 0.1.0a (just an example) I will go test around with this to see if I can make something work. I’ll also look into that soft shutdown suggestion. Thanks for the help.

local textLabel = Instance.new("TextLabel")

-- position in the bottom right corner
textLabel.Position = UDim2.new(0, 0, 1, 0)
textLabel.AnchorPoint = Vector2.new(0, 1)
textLabel.Size = UDim2.new(0, 150, 0, 40)

-- configure the text settings
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.TextStrokeTransparency = 0
textLabel.TextXAlignment = Enum.TextXAlignment.Right
textLabel.TextScaled = true

-- display the version number
local placeVersion = game.PlaceVersion
textLabel.Text = string.format("Server version: %s", placeVersion)
textLabel.Parent = versionGui

-- parent to the StarterGui
versionGui.Parent = StarterGui
1 Like

The first script I ever made without a tutorial (yay me) it sucks a lot cause it’s my first time not following a tutorial.

anyways: I got it to check that the place version is up to date but it doesn’t update the text if it’s out of date. I’m assuming I did something wrong with the else part of the command.

local StarterGui = game:GetService("StarterGui")

-- create a screenGui
local versionGui = Instance.new("ScreenGui")

-- create a textLabel
local textLabel = Instance.new("TextLabel")

-- position in the bottom right corner
textLabel.Position = UDim2.new(0, 0, 1, 0)
textLabel.AnchorPoint = Vector2.new(0, 1)
textLabel.Size = UDim2.new(0, 150, 0, 40)

-- configure the text settings
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.TextStrokeTransparency = 0
textLabel.TextXAlignment = Enum.TextXAlignment.Right
textLabel.TextScaled = true

-- display the version number
local placeVersion = game.PlaceVersion
textLabel.Text = string.format("Server version: %s", placeVersion)
textLabel.Parent = versionGui

-- parent to the StarterGui
versionGui.Parent = StarterGui


	-- Creating stuff
	local VersionCheckerGui = Instance.new("ScreenGui")
local VersionLabel = Instance.new("TextLabel")
	
	-- Setting stuff up
	
	VersionLabel.Position = UDim2.new(0, 10, 1, -30)
	VersionLabel.AnchorPoint = Vector2.new(0, 1)
	VersionLabel.Size = UDim2.new(0, 150, 0, 40)
	VersionLabel.BackgroundTransparency = 1
	VersionLabel.TextStrokeTransparency = 0
	VersionLabel.TextXAlignment = Enum.TextXAlignment.Left
	VersionLabel.TextScaled = true
-- Checking Stuff
while true do
	print("Server Version has been checked!")
	if placeVersion == game.PlaceVersion then
	VersionLabel.TextColor3 = Color3.new(0, 0.666667, 0)
	
	-- Activating the stuff
	VersionLabel.Text = string.format("Server is up to date!")
	VersionLabel.Parent = VersionCheckerGui
		VersionCheckerGui.Parent = StarterGui
		wait(20.0)
else if placeVersion ~= game.PlaceVersion then
		VersionLabel.TextColor3 = Color3.new(0.666667, 0, 0)
		--ACTIVATING stuff again
		VersionLabel.Text = string.format("Server is out of date!")
		VersionLabel.Parent = VersionCheckerGui
			VersionCheckerGui.Parent = StarterGui
		end
	end
end
2 Likes