Advertisement
princeofheaven

Untitled

Aug 24th, 2015
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. print("SystemA Started")
  2. Id = script.Parent.EveryThing.System.Id.NumberValue
  3.  
  4. Pitch = script.Parent.EveryThing.System.Pitch.NumberValue
  5.  
  6. Volume = script.Parent.EveryThing.System.Volume.NumberValue
  7.  
  8. local Sound = Instance.new("Sound") --You had a random do above this line, so that has been removed, along with the extra end.
  9.  
  10. Sound.Parent = script.Parent
  11.  
  12. Sound.Looped = false
  13.  
  14. Sound.SoundId = "http://www.roblox.com/asset/?id=266005094"..Id.Value..""
  15.  
  16. Sound.Pitch = Pitch.Value
  17.  
  18. Sound.Volume = Volume.Value
  19. while wait() do --Changed to "while wait() do" as it reduces the extra line.
  20. Sound.SoundId = "http://www.roblox.com/asset/?id=266005094"..Id.Value..""
  21. Sound.Pitch = Pitch.Value
  22. Sound.Volume = Volume.Value
  23. Sound:Stop() --Stops first so that you don't get the same sound playing multiple times.
  24. if script.Play.Value == true then
  25. script.Play.Value = false
  26. wait(1) --A delay to let the SoundId, Pitch and Volume change.
  27. Sound:Play()
  28. end
  29. 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.
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement