Global Market with messaging service?

Hi,

I was wondering if it’s possible to make a global marketplace with messaging service. If not, how else can it be done?

Thank you.

This would definitely be possible using MessagingService but do keep in mind that the service has usage limits. One alternative could include DataStoreService but this has even stricter usage limits and is pretty slow, so MessagingService definitely beats this option. Another possibility is using HttpService which has reasonably lenient usage restrictions but would take an external server to handle the entire system which could be very difficult and time consuming for someone who hasn’t done it before.

MessagingService is probably your best option but just make sure you watch out for those limits, you could possibly have a cooldown for each player before they can send a global request or create a queing system and send requests in bulk.

If you know any Php or SQL, you could use HttpService along with GetAsync and JSON to insert, remove, or check a players information into a database, which would be a better way of doing this.
If you choose HttpService, it is also a good idea to provide an authorization key on your page that roblox sends when using GetAsync, heres an example
(You would need to return a JSONEncoded table on your web page for Roblox to read)

game.Players.PlayerAdded:Connect(function(plr)
   local authkey = 123456789 --change this later on
   local a = game:GetService('HttpService'):GetAsync('www.example.com?key='..authkey..'?plrid'..plr.PlayerId)
   local b = game:GetService('HttpService'):JSONDecode(a)
   if b.Purchased == true then
      print('this player has purchased the item!')
   end
end

I typed this pretty quickly so if anyone sees any issues with it please let me know! otherwise, it should work properly.

I tried doing this with MessagingService, but the delay is so big that instead of buying 3 items (max) I bought 6

Same thing with different servers.
2 people spam buy button, both people get more items than the limit

I would suggest using HTTPService, however I have no experience with it, so I cant help you.

I would suggest using POST instead of GET as you can use a table to manage your data. In any event you did make a minor mistake with the player ID argument it should have been "&plrid="..player.UserId.

In any case @Mirtiny if you are looking for a fast solution PHP and either SQL or NoSQL would be your best bet unless anyone else has any ideas. If you do end up going this route do not use the client to make these requests. Furthermore make sure you use an encrypted key in your script and check the key on your web server using the password_verify method.