Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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 ?

1 comment

0

This seems like a "Make a script for me" request. Not a "I need help"

1 answer

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!

1 comment

0

e

This discussion is preserved as it was. New answers, comments, and votes are closed.