Advertisement
dannismo

Music Box Script

Aug 11th, 2017
2,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. play = false
  3. enable = false
  4.  
  5. script.Parent.Play.MouseButton1Click:connect(function()
  6. if play == false and enable == false then
  7. play = true
  8. local text = script.Parent.Music
  9. script.Parent.Play.Text = "Playing Music..."
  10. wait(3)
  11. local music = Instance.new("Sound", plr.PlayerGui)
  12. music.SoundId = "http://www.roblox.com/asset/?id=" .. text.Text
  13. music.Playing = true
  14. enable = true
  15. script.Parent.Play.Text = "PLAY"
  16. elseif play == true and enable == true then
  17. play = false
  18. local text = script.Parent.Play
  19. text.Text = "Stopping Music..."
  20. wait(3)
  21. local music = plr.PlayerGui.Sound
  22. music:Destroy()
  23. enable = false
  24. text.Text = "PLAY"
  25. end
  26. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement