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

Why does my value not update?

Asked by 8 years ago

So, a question was proposed about how to check if the place is the newest possible, and I went out and tried to figure it out and play with it, based on Shawnyg's post that was used as an answer.

Well, the outcome:

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

function fetchUpdateTime()
    Asset = game:GetService("MarketplaceService"):GetProductInfo(391268435)
    return Asset.Updated
end

spawn(function()
    while wait(5) do
        local newTime = fetchUpdateTime()

        _G.output(newTime, tracker.Value)

        if newTime ~= tracker.Value then
            local h = Instance.new("Hint")
            h.Parent = game.Workspace
            h.Text = "The game has been updated!"
            wait(2)
            h.Text = "Will shutdown server after players have been saved!"
            wait(2)
            h:Destroy()
        end
    end
end)

Sadly, this does not work. newTime is never updated, no matter how many times I update my place. However when I leave the game, shutdown the server, and start a new one, all is updated, but it still doesn't work. newTime never updates.. Why?

0
What does _G.output do? Can we see the code for that? M39a9am3R 3210 — 8y
0
It's just an output. There's nothing to it. TinyPanda273 110 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

you may have messed it up by defining Asset twice

0
How so? How is this even remotely close to an answer? Why is this a thing? What? TinyPanda273 110 — 8y
Ad

Answer this question