For example, in Miner's Haven he releases codes, then a couple days after it's expired, how do you do that?
It's extremely easy to make the scripting behind the code GUI, but how do you make it so it expires? One way I know could be to make an IntValue called 'Expired' and set it to true but what if someone joins in a old server and they use that code? It would still be valid in old servers so it's not the most efficient way of doing it.
How do you make it so it expires for all servers, I'm assuming HttpService?
You can use DataStores to communicate between servers.
A better way to go about this though is check the table os.time() and validate if the date is past expiration or not.
More info on the table os.time if needed: http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#os.time
There are probably many ways of doing this, but if it were me, I would have a module consisting of all my codes in a table of tables like this:
local codes = { { code = "FREESTUFF", expired = false, reward = { diamond = 5000, money = 2000, } }, { code = "OMGMONEYZ", expired = true, reward = { money = 5000, } } } return codes
I know a lot of places that have codes only release codes when they push large updates, and this would work well because you can force close all servers after the update is pushed and all your servers would be updated to match the new codes.
There's no way to do that without HttpService, so I assume you need to use HttpService for this.