So basically I’ve been playing around with MessagingService and I’m just wondering how to send multiple variables at the same time, as in right now I have this curl command:
curl -L -X POST 'https://apis.roblox.com/cloud/v2/universes/{id}:publishMessage' -H 'x-api-key: api-key-here' -H 'Content-Type: application/json' --data '{
"topic": "bmt",
"message": "Hello, world!" -- how to send another variable through? my server script is accepting message.data, so i should be able to?
}'
This sends the message variable to the server code, which is here:
local MessagingService = game:GetService("MessagingService")
local Players = game:GetService("Players")
local MESSAGING_TOPIC = "bmt"
Players.PlayerAdded:Connect(function(player)
local subscribeSuccess, subscribeConnection = pcall(function()
return MessagingService:SubscribeAsync(MESSAGING_TOPIC, function(message)
print(message.Data)
end)
end)
if subscribeSuccess then
player.AncestryChanged:Connect(function()
subscribeConnection:Disconnect()
end)
end
end)
I want to be able to send multiple “messages” through variables to the server. Like message
, playername
, etc…
Any help is welcome.