LocalScript but work for all, i maked a audio visualizer in button its localscript https://imgur.com/a/1y2G4 but when other player press button that change to all players
BUTTON CODE :
sound = workspace.Sound function onButtonClicked() local ContentProvider = game:GetService("ContentProvider") local Audio = "http://www.roblox.com/asset/?id=300647220" sound.SoundId = Audio sound:Play() end script.Parent.MouseButton1Click:connect(onButtonClicked)
And i dont know im just new to LUA scripting but anyways is there is anyway to fix it?
Solution: 1. FilteringEnabled, obviously. afaik sound changes does not replicate to server nor other clients when FilteringEnabled is enabled and so is an option called "RespectFilteringEnabled" in SoundService.
Not helped when somebudy press on button itss still change to all
In my opinion, it's easier to use a :Connect(function(Open)
instead of function whenClicked()
The way I do things like this is:
local sound = script.Parent,Sound -- sound is now in the button with the local script local button = script.Parent playing = false button.MouseButton1Click:Connect(function(Play) if playing == false then sound:Play() playing = true end end)