How to make a GUI text show the date when a game updates?

Hello,

I am wondering if there is a way where I can make a TextLabel show players in the game the last time my game updated? I am wondering this because I don’t want to change the text every time my game updates, but instead, let a script handle that part. Like is there something I can do with HTTPSService or something else? Let me know if there is a Tutorial I can learn this from.

Thanks for your help!

Sincerely,

papahetfan

You can use MarketplaceService to get when the game last updated.

local gameId = 0000 -- set assetId here
local assetInfo = game:GetService("MarketplaceService"):GetProductInfo(gameId, Enum.InfoType.Asset)
print(assetInfo.Updated) 

Here is what I got?

Screen Shot 2022-07-30 at 3.40.43 PM

How can I make it just the date?

Use string.split() to cut out the unnecessary parts.

It did not work. Here is my script:

local gameId = 0000 -- set assetId here
local assetInfo = game:GetService("MarketplaceService"):GetProductInfo(gameId, Enum.InfoType.Asset)
script.Parent.Text = string.split(assetInfo.Updated)

(I did set up the gameID, I just don’t want to share my game ID.)

Here is my error: Unable to assign property Text. string expected, got table

How can I fix this problem?

Replace it with this

local gameId = 0000 -- set assetId here
local assetInfo = game:GetService("MarketplaceService"):GetProductInfo(gameId, Enum.InfoType.Asset)
script.Parent.Text = string.split(assetInfo.Updated,"T")[1]
2 Likes

It works, thank you. Glad it could work fine.

1 Like