#I need help with a script

1 messages · Page 1 of 1 (latest)

marsh nymph
#
local ExperienceNotificationService = game:GetService("ExperienceNotificationService")

local function sendNotification(userId)
    -- This notificationId string must come from a message asset created in Creator Dashboard
    local success, result = pcall(function()
        return ExperienceNotificationService:SendExperienceNotification({
            RecipientUserId = userId,
            NotificationId = "*****************",  -- define in Creator Dashboard
            -- optional payload for dynamic content here
        })
    end)

    if not success then
        warn("Failed to send notification:", result)
    end
    return success
end

game.Players.PlayerAdded:Connect(function(player)
    -- Example trigger when player joins or levels
    sendNotification(player.UserId)
end)
#

The point is whenever the proximityprompt is done the notification request will come up