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

Place updated detection?

Asked by 9 years ago

I saw it in The Quarry, where if the place is updated, it teleports everyone to a different place.

I'm not sure if this is a universe or something, or if it literally can detect if the place is updated.

If anyone knows how this works, can I get a wiki link?

1 answer

Log in to vote
3
Answered by 9 years ago

I've done something like this before. Take a look at my script.

local placeid = game.PlaceId
local start = game.MarketplaceService:GetProductInfo(placeid)
local startup = start['Updated']
local isShuttingDown = false

function shutdown()
    isShuttingDown = true
    for i,v in next, game.Players:GetPlayers() do
        v:Kick()
    end 
end

while wait(1) do
    if not isShuttingDown then
        local newinfo = game.MarketplaceService:GetProductInfo(placeid)
        local newup = newinfo['Updated']

        if newup ~= startup then
            local m = Instance.new("Message", Workspace)
            m.Text = "This game has been updated! Shutting down server..."
            wait(1.5)
            shutdown()
        end
    end 
end

game.Players.PlayerAdded:connect(function(p)
    if isShuttingDown then
        p:Kick()
    end
end)

Just be careful with this one. It depends on the updated time, and that time updates when you update the description.

Ad

Answer this question