mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 12:01:38 +00:00
Add setting to toggle sound effects (#568)
* Use soundPlayer object with setting * Style changes
This commit is contained in:
parent
0987b44e23
commit
54398d4c4b
5 changed files with 32 additions and 7 deletions
|
|
@ -1,22 +0,0 @@
|
|||
-- Roblox decided that sounds only play in Edit mode when parented to a plugin widget, for some reason
|
||||
local plugin = plugin or script:FindFirstAncestorWhichIsA("Plugin")
|
||||
local widget = plugin:CreateDockWidgetPluginGui("Rojo_soundPlayer", DockWidgetPluginGuiInfo.new(
|
||||
Enum.InitialDockState.Float,
|
||||
false, true,
|
||||
10, 10,
|
||||
10, 10
|
||||
))
|
||||
widget.Name = "Rojo_soundPlayer"
|
||||
widget.Title = "Rojo Sound Player"
|
||||
|
||||
return function(soundId)
|
||||
local sound = Instance.new("Sound")
|
||||
sound.SoundId = soundId
|
||||
sound.Parent = widget
|
||||
|
||||
sound.Ended:Connect(function()
|
||||
sound:Destroy()
|
||||
end)
|
||||
|
||||
sound:Play()
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue