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
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
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
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"
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