I was playing some Tower Defense Simulator today with my cousins but then I saw they have a version code on the top and I was wondering how to get that.
How can I do this? Help is greatly appreciated!
I was playing some Tower Defense Simulator today with my cousins but then I saw they have a version code on the top and I was wondering how to get that.
When people do “versions”, it’s used to see the difference between servers to know if you’re up to date or not. That version code (if you take a look closely) seems to consist of a time of when it was updated. I’m not too sure what the end is but if you want similar to that you can use os.date()
to get the year, month, and date along with the time.
EDIT: You can also do something simpler where you can do: Version: 1 and then update it as you publish your game.
Contrary to what @Mystifine said, it’s actually just a matter of accessing the PlaceVersion
property of the datamodel. Sure, you can do all the things he listed, but they’re just more work, and I’d rather just read from a consistent property that won’t fail due to human error. See here for more info. Have a nice day!
Considering the format of the version “code” that this game uses, I’m pretty sure they just used the Updated stamp from GetProductInfo and left it in ISO 8601 format.
local placeVersion = MarketplaceService:GetProductInfo(game.PlaceId).Updated
local headerText = "Version: " .. placeVersion
That should give you the exact same result as what you’re seeing in the picture. I find that it’d probably be better to convert that to an actually readable format though, so it might be worth looking up ISO 8601 converters such that you get a number that works with the os library.