How can I make a script that prints a message in the console if the server is up to date

Today I was trying to make a script that would print a message in the console if the server was up to date otherwise not. I searched on the internet but couldn’t find anything. I appreciate any help.

4 Likes

i have made a auto shutdown model that detects if the server is up to date and shuts down it
this is the file that you are asking for though
UpdatesCheck.rbxm (1.7 KB)
if you want to try the original model then

1 Like

So, If I want to make a script that prints if the server is updated I have to write this:

function CheckIfUpToDate()
	local uptodate = nil
	local state,err = pcall(function()
		local asset = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId)
		local update_stamp = tostring(asset.Updated)
		upDateTime = ConvertTimeStampToUnix(update_stamp)
		uptodate = os.time() - upDateTime > time()
	end)
	if state then
		print("Server is up-to-date")
	end
	return uptodate
end
1 Like

pretty much yes but you have to run the function each time

1 Like

Ok. Thank you so much for the help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.