Joriangames

RadioHandler

Apr 21st, 2021 (edited)
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. --Thanks for using this script
  2. --This script is made by Joriangames/Problox Studio Scripts
  3. --Want to know how to use this? Watch my tutorial: https://youtu.be/BR_sSdQ9t78
  4. local frame = script.Parent.Frame
  5. local musicBox = frame.MusicBox
  6. local close = frame.Close
  7. local playButton = frame.PlayButton
  8. local stopButton = frame.StopButton
  9. local sound = script.Parent.Sound
  10.  
  11. local toggle = script.Parent.Toggle
  12.  
  13. toggle.MouseButton1Click:Connect(function()
  14.     if frame.Visible == true then
  15.         frame.Visible = false
  16.     else
  17.         frame.Visible = true
  18.     end
  19. end)
  20.  
  21. close.MouseButton1Click:Connect(function()
  22.     frame.Visible = false
  23. end)
  24.  
  25. playButton.MouseButton1Click:Connect(function()
  26.     local musicId = musicBox.Text
  27.     print(musicId)
  28.     sound.SoundId = "rbxassetid://"..musicId
  29.     sound.Playing = true
  30.     musicBox.Text = "Currently playing: "..musicId
  31. end)
  32.  
  33. stopButton.MouseButton1Click:Connect(function()
  34.     sound.Playing = false
  35.     musicBox.Text = ""
  36. end)
Add Comment
Please, Sign In to add comment