Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I detect a new update for a game?

Asked by 7 years ago

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

Log in to vote
1
Answered by 7 years ago

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.

0
I think you put me on the right track. Thanks! thebootsie123 160 — 7y
Ad

Answer this question