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

Why does my value not update?

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?

2 comments

0

What does _G.output do? Can we see the code for that?

0

It's just an output. There's nothing to it.

1 answer

you may have messed it up by defining Asset twice

1 comment

0

How so? How is this even remotely close to an answer? Why is this a thing? What?

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