Conversions
Converts between Sounds and SoundDefinitions. These do not need the schema, so they work before startup.
Functions
ToDefinition
Turns a Sound and its SoundEffect children into a SoundDefinition. Only properties that differ from the
defaults are kept, plus the name.
local definition = VluxySF.Conversions.ToDefinition(workspace.MySound)
print(definition.Properties.Volume)
FromDefinition
Builds a new, unparented Sound from a SoundDefinition. Effects are parented under their class names.
local sound = VluxySF.Conversions.FromDefinition({
Properties = {
Name = "MySound",
SoundId = "rbxassetid://123456789",
Volume = 0.5,
},
Effects = {
EchoSoundEffect = { Delay = 0.5 },
},
EffectsCount = 1,
})
sound.Parent = workspace
sound:Play()