detodounpoquito

MainExecutor

Apr 29th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. script.Parent.TextButton.MouseButton1Click:Connect(function()
  2.     script.Parent.Frame.Visible = not script.Parent.Frame.Visible
  3. end)
  4.  
  5. script.Parent.Frame.Play.MouseButton1Click:Connect(function()
  6.     local number = "rbxassetid://"..script.Parent.Frame.IDInput.Text
  7.    
  8.     script.Parent.Sound:Stop()
  9.    
  10.     wait(0.5)
  11.    
  12.     script.Parent.Sound.SoundId = number
  13.    
  14.     wait(1)
  15.    
  16.     script.Parent.Sound:Play()
  17.     script.Parent.Sound.Looped = true
  18. end)
  19.  
  20. script.Parent.Frame.Stop.MouseButton1Click:Connect(function()
  21.     script.Parent.Sound:Stop()
  22. end)
  23.  
  24.  
  25. script.Parent.Frame.Pause.MouseButton1Click:Connect(function()
  26.    
  27.     if script.Parent.Sound.IsPaused == true then
  28.         script.Parent.Sound:Resume()
  29.         script.Parent.Frame.Pause.Text = "Pause"
  30.     elseif script.Parent.Sound.IsPaused == false then
  31.         script.Parent.Sound:Pause()
  32.         script.Parent.Frame.Pause.Text = "Resume"
  33.     end
  34. end)
  35.  
  36. local volumeinput = script.Parent.Frame.VolumeInput
  37.  
  38. local idinput = script.Parent.Frame.IdInput
  39.  
  40. volumeinput:GetPropertyChangedSignal("Text"):Connect(function()
  41.     if tonumber(volumeinput.Text) then
  42.         script.Parent.Sound.Volume = volumeinput.Text
  43.     else
  44.         --Not number
  45.     end
  46. end)
  47.  
  48. idinput:GetPropertyChangedSignal("Text"):Connect(function()
  49.     if tonumber(idinput.Text) then
  50.         script.Parent.Sound.SoundId = "rbxassetid://"..idinput.Text
  51.         wait(1)
  52.         script.Parent.Sound:Play()
  53.         script.Parent.Sound.Looped = true
  54.     else
  55.         --Not number
  56.     end
  57. end)
Advertisement
Add Comment
Please, Sign In to add comment