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

When game updates it shuts down? (Solved) (Answered)

Asked by 7 years ago
Edited 7 years ago

So i have another problem.

I have problems making a script that if there is an update the games shuts down.

So if i click on Roblox Studio "Publish update to ROBLOX" the game will shutdown and players need to rejoin.

And a custom kick message like "Our game has been updated! Please join a new server."

Anyone has some examples or a script for me ?

0
This seems like a "Make a script for me" request. Not a "I need help" YTRaulByte 389 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

SOLVED MYSELF! Guys, If you want to know the answer? Copy and paste this script in you're game!

--user-defined--

local PollDelay = 5
local AssetId   = game.PlaceId

----------------
local MS = game:GetService("MarketplaceService");
local Info = MS:GetProductInfo(AssetId);
while wait(PollDelay) do
    local NewInfo = MS:GetProductInfo(AssetId);
    if NewInfo["Updated"] ~= Info["Updated"] then
        if (((NewInfo["Description"] == Info["Description"]) and (NewInfo["Name"] == Info["Name"])) or (NewInfo["AssetId"] ~= game.PlaceId)) then
            --payload{--
            local connected;
            for it, replicator in pairs(game:GetService("NetworkServer"):GetChildren()) do
                if replicator:IsA("NetworkReplicator") then
                    local player = replicator:GetPlayer();
                    if player then
                        if not connected then
                            connected = game:GetService("Players").PlayerAdded:connect(player.Kick);
                        end;
                        player:Kick("CHANGE KICK MESSAGE HERE");
                    end;
                end;
            end;
            --}payload--
        else
            Info = NewInfo;
        end;
    end;
end;

The only thing you need is change the kick message. The rest already does his job!

0
e SharkTailOof 22 — 4y
Ad

Answer this question