Update Detection Not Working

Hi!
Recently I made this Update Detection. It wasn’t working, what is wrong?

local player = game.Players.LocalPlayer																																																											

																																																											
manualShutDown = false
placeId = 6453701895 
																																																	

function CloneUI ()
	script.UiThing:Clone().Parent = player:WaitForChild("PlayerGui")
end
	

if placeId == 0 then script:Destroy() end -- No proper info.
local market = game:WaitForChild("MarketplaceService")
local serverVersion = Instance.new("StringValue",game)
serverVersion.Value = market:GetProductInfo(placeId)
serverVersion.Name = "SERVER_VERSION"

while true do
	game:GetService("RunService").Stepped:wait()
	local currentVersion = market:GetProductInfo(placeId)
	if currentVersion ~= serverVersion.Value then
		if manualShutDown ~= true then
		CloneUI ()
			wait(15)
			Instance.new("ManualSurfaceJointInstance",workspace)
		else
			local f,s = string.find(currentVersion,"autoshutdown:go")
			if f ~= nil and s ~= nil then
			CloneUI ()
				wait(15)
				Instance.new("ManualSurfaceJointInstance",workspace)
			end
		end
	end
end																															

Thanks!

I need to bump this, as this is a huge issue.

You could try printing() out what works and what doesn’t work inside your loop

while true do
    print("Running")
	game:GetService("RunService").Stepped:wait()
	local currentVersion = market:GetProductInfo(placeId)
	if currentVersion ~= serverVersion.Value then
        print("Not the same version")
		if manualShutDown ~= true then
        print("Oop")
		CloneUI ()
			wait(15)
			Instance.new("ManualSurfaceJointInstance",workspace)
		else
            print("Shutting down I'm assuming")
			local f,s = string.find(currentVersion,"autoshutdown:go")
			if f ~= nil and s ~= nil then
			CloneUI ()
				wait(15)
				Instance.new("ManualSurfaceJointInstance",workspace)
			end
		end
	end
end		

1 Like
serverVersion.Value = market:GetProductInfo(placeId)

Something is wrong with this line.

Hello? Still not working. ggggg

Oh I see the issue I believe

GetProductInfo returns a Dictionary, & it’s attempting to compare it with the StringValue's Value which is resulting as an error so you’ll have to find some other way to detect the version history, you could try printing out what the market:GetProductInfo(placeId) is and see where to go from there

My PC is the capacity of a potato ok I can only say so much in such a short span of time

1 Like

if placeId == 0 then script:Destroy() end -- No proper info.
local market = game:WaitForChild("MarketplaceService")
local serverVersion = Instance.new("StringValue",game)
print (market:GetProductInfo(placeId))
serverVersion.Value = market:GetProductInfo(placeId)
serverVersion.Name = "SERVER_VERSION"

It didn’t print/

I don’t think you can get a version from GetProductInfo, just the date of the last update:

is there an alternative?ddddddd

1 Like

This maybe?

	script.UiThing:Clone().Parent = player:WaitForChild("PlayerGui")
			CloneUI ()

For somereason, this gave an error.
image
It also seemed to try and update, as I was in studio./

I’ve never used it so I’m no expert but just reading from the link I gave you last time it says:

In Roblox Studio, this property is set to 0

so it probably only works in actual servers.

adding on to this

Hence the Console Error.
If it was trying to run CloneUI, it would have kicked me.

That’s not the issue. It’s not running the function CloneUI

I just tested it. It didn’t clone the UI into my PlayerGUI, then it did this:


(i cant stop getting http errors pls fix roblox)\

but anyways, i’m guessing it worked and tp’d me.

image
In Studio:
image
In Roblox:

For some reason I think it’s now working.
I’m not getting the OH NO UPDATE INCOMING/

"In Roblox Studio, this property is set to 0 .

When a server instance is created for a place it is done so at the place’s current version. If the place is later updated whilst this server is running, the server will remain at its current version."

So update, it isn’t working again. I updated the code to make it update and check the version, did i break it?

wait (10)
local player = game.Players.LocalPlayer																																																											

																																																											
manualShutDown = false
placeId = 6453701895 
																																																	

function CloneUI ()
	script.UiThing:Clone().Parent = player:WaitForChild("PlayerGui")
end
	

if placeId == 0 then script:Destroy() end -- No proper info.
local market = game:WaitForChild("MarketplaceService")
local serverVersion = Instance.new("StringValue",game)
print ("Current Version:"..game.PlaceVersion)
serverVersion.Value = game.PlaceVersion
serverVersion.Name = "SERVER_VERSION"

while true do
	serverVersion.Value = game.PlaceVersion
	print("Running")
	game:GetService("RunService").Stepped:wait()
	serverVersion.Value = game.PlaceVersion
	local currentVersion = market:GetProductInfo(placeId)
	if currentVersion ~= serverVersion.Value then
		print("Not the same version")
		if manualShutDown ~= true then
			print("Oop")
			CloneUI ()
			wait(15)
			Instance.new("ManualSurfaceJointInstance",workspace)
		else
			print("Shutting down I'm assuming")
			local f,s = string.find(currentVersion,"autoshutdown:go")
			if f ~= nil and s ~= nil then
				CloneUI ()
				wait(15)
				Instance.new("ManualSurfaceJointInstance",workspace)
			end
		end
	end
end