Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("SystemA Started")
- Id = script.Parent.EveryThing.System.Id.NumberValue
- Pitch = script.Parent.EveryThing.System.Pitch.NumberValue
- Volume = script.Parent.EveryThing.System.Volume.NumberValue
- local Sound = Instance.new("Sound") --You had a random do above this line, so that has been removed, along with the extra end.
- Sound.Parent = script.Parent
- Sound.Looped = false
- Sound.SoundId = "http://www.roblox.com/asset/?id=266005094"..Id.Value..""
- Sound.Pitch = Pitch.Value
- Sound.Volume = Volume.Value
- while wait() do --Changed to "while wait() do" as it reduces the extra line.
- Sound.SoundId = "http://www.roblox.com/asset/?id=266005094"..Id.Value..""
- Sound.Pitch = Pitch.Value
- Sound.Volume = Volume.Value
- Sound:Stop() --Stops first so that you don't get the same sound playing multiple times.
- if script.Play.Value == true then
- script.Play.Value = false
- wait(1) --A delay to let the SoundId, Pitch and Volume change.
- Sound:Play()
- end
- repeat wait() until script.Play.Value == true --Waits until the play value is true again so that it doesn't stop and replay the song in a loop, causing it to not play at all.
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement