Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I detect a new update for a game?

So I'm trying to make a script that shows a gui once it detects that there is a new update. I'm trying to compare the update times although it keeps being the same. Here's the script. How could I fix this?

local Service = game:GetService("MarketplaceService"):GetProductInfo(494196891)
local Version = Service.Updated
local Version2
local Service2
while true do
	wait(1)
	print(1)
	Service2 = game:GetService("MarketplaceService"):GetProductInfo(494196891)
    Version2 = Service2.Updated
	print(Version)
	print(Version2)
	if Version ~= Version2 then
		local Players = game.Players:GetChildren()
		for _,v in pairs(Players) do
			v.PlayerGui.RestartPoll.Poll.Visible = true
		end
	end
end

1 answer

✓ Accepted answer

I'm not fully experienced with stuff like this, but I believe you can accomplish something like this using DataStores.. I believe you could probably create a "Version" intvalue that holds the current version of the game. Any time you wanted to update the version, you could set that intvalue to the new version number and :SetAsync() it to save to the datastore. I believe datastores share data flawlessly across servers as someone I know made cross-server queue systems using datastore. Anyway, not quite sure if I'm on the right track but I hope I helped.

1 comment

0

I think you put me on the right track. Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.