Playing Sound When Sending a Roblox Notification

I am trying to make it so when it sends Roblox’s default notification to the client that it plays a sound with it but when I attempted to do it, the script stopped working so I just removed the sound part and it was fixed. Does anyone know a workaround for this?

The script is;

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local StarterGui = game:GetService("StarterGui")
local NotifyPlayer = SilenceManager:WaitForChild("NotifyPlayer")

local function ChatEnabled(Enabled)
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, Enabled)
end

local function Notification(Title, Text)
	StarterGui:SetCore("SendNotification", {
		Title = Title,
		Text = Text
	})
end

NotifyPlayer.OnClientEvent:Connect(function(Title, Message)
	Notification(Title, Message)
end)
3 Likes

Can anyone help if you can, I really need to find a solution quickly.

1 Like

how did u play the audio (i expect sound:Play())


1 Like

I saw something on that could play a local sound but I removed the script for it. The audio is located in ServerStorage.

1 Like

ok so, if the audio is in serverstorage a localscript wont be able to access it. because serverscriptservice and serverstorage and seen as empty to localscripts (only if u used a localscript, and not a script.).

1 Like
NotifyPlayer.OnClientEvent:Connect(function(Title, Message)
	Notification(Title, Message)
    Sound:Play()
end)
1 Like

Yeah that too, just put the sound somewhere else, even under the notification script would work, not really NEEDED for the sound to be in the serverstorage

1 Like

So I move the sound to ReplicatedStorage and I add a line like this;

local NotificationSound = ReplicatedStorage.Notification

And I change;

NotifyPlayer.OnClientEvent:Connect(function(Title, Message)
	Notification(Title, Message)
    Sound:Play()
end)
1 Like

As ball stated, a local script will not be able to see the sound inside serverstorage, this is also true for replicated storage, these are only accessible from the server. (This is why people suggest keeping events and important game data in here, to prevent exploiters from touching this data or whatever is in there)

You can do something like this
image

NotifyPlayer.OnClientEvent:Connect(function(Title, Message)
	Notification(Title, Message)
    script.NotificationSound:Play() -- Dont forget to add a sound value
end)

What sound value? Also how did you make your sound thing colored like that and whatever the sound is parented to?

This is what I mean by the sound value
image

About the icons in my explorer, I am using a resource known as “Vanilla 3”
It changes the icons in studio to be more up to date with modern standards.
You can look into it here

Here is a full image of some new icons
image

looks right, just input your roblox sound id to the property called SoundId.

I can’t see the Enable DPI Aware Studio thingy in Beta Features.

Why do you need “Enable DPI Aware Studio”, neither vanilla 3 nor the sound id requires the DPI Awareness

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