I have a AutoShutdownScript on my game that was not made by me and it has an error. A value is detected as a table, not a string value as it is supposed to be.
if placeId == 0 then script:Destroy() end -- No proper info. local market = game:WaitForChild("MarketplaceService") local serverVersion = Instance.new("StringValue",game) --This is the StringValue that is detected as a table serverVersion.Value = market:GetProductInfo(placeId) --This line is where it errors serverVersion.Name = "SERVER_VERSION" while true do --Extra code in the script if you want to see it game:GetService("RunService").Stepped:wait() local currentVersion = market:GetProductInfo(placeId) if currentVersion ~= serverVersion.Value then if manualShutDown ~= true then local m = Instance.new("Message",workspace) m.Text = "This game has been updated! Shutting down server..." wait(1) Instance.new("ManualSurfaceJointInstance",workspace) else local f,s = string.find(currentVersion,"autoshutdown:go") if f ~= nil and s ~= nil then local m = Instance.new("Message",workspace) m.Text = "This game has been updated! Shutting down server..." wait(1) Instance.new("ManualSurfaceJointInstance",workspace) end end end end
Please Help
The issue is that you're trying to set a string value to a table value.
serverVersion.Value -- a string = market:GetProductInfo(placeId) --- get product info returns a table for a place Id
I'm not proficient with tables enough to show you how to do it, but you could try a for loop that index through that table and then use the value inside that table to assign to your string value
Sorry if that didn't make any sense