My MessagingService is not working

local MessagingService = game:GetService("MessagingService")

MessagingService:SubscribeAsync("test", function(msg)
	print(msg.Data)
end)

It is my studio script

`

const axios = require('axios');
const Object = {
  'RobloxID':1234, "Money":10000
}

const RobloxAPI = async () => {
  axios.post("https://apis.roblox.com/messaging-service/v1/universes/4317834354/topics/test", {'message': JSON.stringify(Object)}, {
    headers: {
      "x-api-key": "mykey",
      "Content-Type": "application/json"
    }
  }).then(response => {
    console.log(response.data)
  }).catch(error => {
    console.log(error.response.data)
  })
}

RobloxAPI()

It is my node.js web server code

In Roblox Studio, Game Settings/Security/“Enable use of Studio’s API service” is turned on, ip setting is set to 0.0.0.0/0 in the API key settings, and the universe ID and access permission settings are set perfectly, and I have reviewed them several times.

When I run the game and run my code with node . in vscode, I get an empty response in my webserver console, but no response in Roblox studio.

There is no error output from the whole process, so I’m not sure how to fix this.
Can you please help me with my problem?

Messages published with Open Cloud are only received by live game servers, not Studio. So you need to publish your game to test it.

1 Like

Thank you so much. I went to the normal way to access the game, not the test button in the studio, and it worked!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.