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

Checking for an update... What's wrong with my script?

Asked by
sgsharp 265 Moderation Voter
10 years ago

Okay, so I have written some code, and when I update the plugin, a gui shows up (if the plugin is opened) and tells the player to update the plugin via the Plugin Manager. However, it started working at first, and then it just stopped. Can you tell me what's wrong? Did I code this right?

If there are any sources I can look at, I'd appreciate if you give me the links.

Thanks...

Code:

local AssetId = 142776964

----

local Info = game:GetService("MarketplaceService"):GetProductInfo(AssetId)

while true do

    wait()

    local NewInfo = game:GetService("MarketplaceService"):GetProductInfo(AssetId)
        if NewInfo["Updated"] ~= Info["Updated"] then
            if NewInfo["Description"] == Info["Description"] and NewInfo["Name"] == Info["Name"] or NewInfo["AssetId"] ~= game.PlaceId then

            script.Parent.Main.Update.Visible = true
            script.Parent.Main.Tabs.InfoButton.Visible = false
            script.Parent.Main.InfoPage.Visible = false

            else

                Info = NewInfo

        end 
    end
end
0
Dude, that's sending out a web request like 30 times a second. You should make it wait at least 5 seconds at minimum. Merely 2122 — 10y
0
Is that the issue? Is that why it's not working...? sgsharp 265 — 10y

Answer this question