Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to i get the sound i used to be heard by everyone in the server?

So, I've got this script and everything done and when i test it i can hear the music. But when i tested it in game with a player only i could hear the music playing.

local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
local g = Instance.new("Hint",workspace)
local Tool = script.Parent

local Mouse = nil

local function UpdateIcon()
	if Mouse then
		Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
	end
end

local function OnEquipped(mouse)
	script.Alarm:Play()
	g.Text ="THE FINAL BOSS HAS BEEN SPAWNED!!!"
	wait(5)
	g:Remove()
	script.Alarm:Stop()
	script.Final:Play()
	Mouse = mouse
	UpdateIcon()
end

local function OnChanged(property)
	if property == 'Enabled' then
		UpdateIcon()
	end
end

Tool.Equipped:connect(OnEquipped)
Tool.Changed:connect(OnChanged)

This script is held as a localscript, i was thinking its because of that but it seems like i have no other way of making it work. i need it so that when the tool is acquired the g.Text shows and the music can be heard by everyone, i also have a problem with the g.Text only showing for me too.

2 comments

0

Set SoundService.RespectFilteringEnabled to false, or use a RemoteEvent to make the server play the sound as well as display the hint message.

0

No, never set RespectFilteringEnabled to false. It's lazy and opens a door for exploiters to play any sound in the workspace at any time.

1 answer

✓ Accepted answer

You are right about the problem being the fact that the script is a localscript. That means that only the client will be able to hear the sound due to filtering enabled. To have the sound be heard by other players, you could either make a script(not localscript) that plays the sound on Tool.Equipped, or fire a RemoteEvent to request the server to play the sound

3 comments

0

"What are the exceptions to FilteringEnabled? .. Sound playback, when SoundService.RespectFilteringEnabled is set to false" - Roblox Developer Wiki, unless something changed or I'm mistaken then the sound shouldn't be a problem. But the hint message obviously will be.

0

Never heard about that option before, I assume he has it on true then.

0

I haven't checked to see if filtering is enabled but thank you for pointing it out so that I can fix it.

This discussion is preserved as it was. New answers, comments, and votes are closed.