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

Checking the current "PlaceVersion" versus the most recent PlaceVersion?

Asked by 7 years ago

I'm trying to make an automatic Place Version checker, which see's if the servers' game version is the same at the most recent one.

I'm aware of the PlaceVersion method, but am unaware of how to use it. Could someone give me an example?

1 answer

Log in to vote
1
Answered by 7 years ago

As I posted before, and was quick to accept it, this is a working method of this. It takes up to a full minute to register that there was an update. Sadly, we can't make that any slower, as it is on roblox's servers.

But here you go:

local GameID = 00000000;
local Asset = game:GetService("MarketplaceService"):GetProductInfo(GameID) -- My place Id
local tracker = Instance.new("StringValue")
tracker.Name = "UpdateTracker"
tracker.Parent = script
tracker.Value = Asset.Updated

spawn(function()
    while wait(5) do
        local newTime = game:GetService("MarketplaceService"):GetProductInfo(GameID).Updated

        if newTime ~= tracker.Value then
            --do things here.
        end
    end
end)
0
Thanks so much. I saw something about MarketplaceService, but had no clue how to incorporate it. TheHospitalDev 1134 — 7y
Ad

Answer this question