This question already has been asked, but i want to create my own thread asking it, so i can understand properly some stuff and be able to respond.
I want to know how do i use MessagingService, what i want to achieve is a Daily featured shop system. Of course i can’t ask the script here, so i want to know how do i make Daily Messages which are written by me. That might help me script stuff with MessagingService.
In summary: I want to know how do i use MessagingService to create “Daily” stuff.
Dailies aren’t done through MessagingService. If you read documentation and the other threads about MessagingService, it is merely intended to pass serialised content between all places of a game and their servers. Dailies are done through the use of DataStores and os.time.
If you know, then you shouldn’t be suggesting the use of MessagingService for dailies.
With this response, I can no longer tell what you want: your title says “how do I use MessagingService”, your post says “I want to make dailies” and you linked a thread about “limited stock”. Make it clear what you’re looking for so you don’t lead people on a wild goose chase trying to figure out what you really want.
In terms of learning how to use MessagingService, do your own research. There are plenty of threads about the use of MessagingService around and documentation even provides sufficient explanation about how to use it. You should also perform tests yourself with your code first before anything.
As far as making a daily-based system, virtually the only way you are going to be able to do this is through some involvement of DataStores so that you are able to check between when the last recorded collection or read of something was and whether it should be changed over or not. You should be using DataStores for this. You won’t exhaust requests unless you aren’t being smart about it.
When creating a limited-stock item shop, DataStores still work and you should try to stay away from third party services, hosting or expenditures where you don’t actually need them. Work around the limits and make a system such that you don’t exhaust your requests so quickly. If you really need the accuracy, then sure you can use an external server to determine stock for an item.
Ok so it seems like you aren’t familiar with exploring new APIs. Seriously, please search on the devforum for MessagingService and you will find hundreds of examples of use cases and code.
Ok enough of my rambling. MessagingService is a service in which you can send data to other game instances. Say I’m in my server and I want to send something to my friend, but he’s in another server and lets say it’s full and I can’t join. I could use MessagingService to send data from my server to his server.
I found a very great tutorial here on the DevForums, but the short of it is:
On a server, you subscribe to a stream and that server will receive data from that stream. You can send data on that stream and any servers connected to it will receive it.
Now I suppose you meant for a “daily messaging system” in which you join a game and you send a message which would be featured in your shop. That could work, but you’d have to join the game and send the message/data from an in-game server (I think studio might work but I haven’t tested that). Either way, not the best system. Have all servers subscribe to a message stream, then send your message down the stream then use the incoming data and display it in your shop.
Now I don’t want you to think MessagingService is stupid or useless. It’s most definitely not as you can essentially do stuff at a game level.
My favorite use case is ForeverHD’s infinite player servers. Definitely check that out as it’s a great example of a complex use of MessagingService. It’s open source - and very interesting. You don’t need to get that complex for your system, but dissecting the code won’t hurt.
I don’t know why you’re being dismissive of my points. I pretty much gave you all kinds of information but you seem confused as to what you’re doing or do you not understand it or is it something else? I don’t think what I said was any different from the above, aside from a lack of linked articles.