Hi guys, in my game Players Are Able to follow each other, start chats, post posts, like posts, and reply to posts. My question is how can I use experience notifications to let offline players know when someone is interacting in any way with them because I’m not really understanding how this Roblox experience notifications system is working.
theres a tutorial made by roblox that goes over all the steps in detail
https://create.roblox.com/docs/production/promotion/experience-notifications
and this is the main code snippet they give for sending a message, note that the module in the code is also given in the tutorial
and i think the user has to be prompted to receive notifications and click accept first. They also have to be 13+
local ServerScriptService = game:GetService("ServerScriptService")
local OCUserNotification = require(ServerScriptService.OpenCloud.V2.UserNotification)
local recipientPlayerID = 505306092
-- In the payload, "messageId" is the value of the notification asset ID
local userNotification = {
payload = {
messageId = "5dd7024b-68e3-ac4d-8232-4217f86ca244",
type = "MOMENT"
}
}
local result = OCUserNotification.createUserNotification(recipientPlayerID, userNotification)
if result.statusCode ~= 200 then
print(result.statusCode)
print(result.error.code)
print(result.error.message)
end
not sure why they have a messageId but you can generate it with HttpService:GenerateGUID(false)
1 Like