Solved by putting sounds in a DockWidget (u have to clone parts for 3d sounds)
I still think it should be possible to play sounds in edit mode without having to clone to DockWidget.
I found solution and it works becasue i tested it
Here is source:
You need to parent sound into DockWidgetPluginGui
My plugin script
local Toolbar = plugin:CreateToolbar("Toolbar")
local PlayTheSound = Toolbar:CreateButton("b","Button","")
local Sound = script:FindFirstChild("Sound")
local DockWidgetGui = plugin:CreateDockWidgetPluginGui("SoundHolder",DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Left,
false,
false,
500,
500,
200,
200
)
)
Sound.Parent = DockWidgetGui
Sound:Stop()
PlayTheSound.Click:Connect(function()
if Sound.IsPlaying then
Sound:Stop()
else
Sound:Play()
end
end)
You don’t need any permission
Note:DockWidgetGui is just for holding sounds nothing else
Just make sure dockwidgetplugininfo is not Enabled and
InitialEnabled ,InitialEnabledShouldOverrideRestore must be false or it will randomly pop up DockWidgetPluginGui when starting
Hi @xcreatee
Your solution works perfectly for gui sounds.
but is there a way to play sounds that are in a part/attachment?
Clone sound into DockWidget and then destroy it after sound is finished?
i mean they have to be in the part/attachment so that you can hear depending on the position
Wait a sec i need to test maybe it will work
Clone part that contains sound and make parent DockWidgetGui?
Yep it works i tested it
make sure it clones into dockwidget and then after sound stop playing destroys part or Attachment that conatins sound
Sound is different based on position
If you need script i can give you
Works!! thanks so much ![]()
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.