Advertisement
Hmm465_Gaming

loop sound remove gui

Apr 21st, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.89 KB | None | 0 0
  1. -- by Hmm465#7106
  2. --loop sound remove
  3. --click on to turn on loop
  4. --click off to turn off loop
  5. --destroy gui is exactly what you think it is
  6.  
  7. local plr = game.Players.LocalPlayer
  8. plrgui = plr.PlayerGui
  9. local base = Instance.new("ScreenGui",plrgui)
  10.  
  11. local bground = Instance.new("Frame",base)
  12. bground.Draggable = true
  13. bground.Name = "bground"
  14. bground.Position = UDim2.new(0.0,0,0.3,0)
  15. bground.Size = UDim2.new(0.2,0,0.22,0)
  16. bground.BackgroundColor3 = Color3.fromRGB(0,0,0)
  17. bground.BorderColor3 = Color3.fromRGB(163,162,165)
  18. bground.BorderSizePixel = 6
  19. bground.ClipsDescendants = true
  20.  
  21. local submit = Instance.new("TextButton",bground)
  22. submit.Name = "on"
  23. submit.Text = "on"
  24. submit.Position = UDim2.new(0.20,0,0.0,0)
  25. submit.Size = UDim2.new(0.7,0,0.25,0)
  26. submit.TextScaled = true
  27. submit.TextWrapped = true
  28. submit.BackgroundColor3 = Color3.fromRGB(200,200,200)
  29.  
  30. function sound()
  31. _G.LoopEnabled = true
  32. repeat
  33. wait(0.1)
  34. for _,x in pairs(game:GetDescendants()) do
  35. if x:IsA'Sound' then
  36. x:Remove()
  37. end
  38. end
  39. until _G.LoopEnabled == false
  40. end
  41.  
  42. local submit2 = Instance.new("TextButton",bground)
  43. submit2.Name = "off"
  44. submit2.Text = "off"
  45. submit2.Position = UDim2.new(0.2, 0,0.3, 0)
  46. submit2.Size = UDim2.new(0.7,0,0.25,0)
  47. submit2.TextScaled = true
  48. submit2.TextWrapped = true
  49. submit2.BackgroundColor3 = Color3.fromRGB(200,200,200)
  50.  
  51. function sound2()
  52. _G.LoopEnabled = false
  53. end
  54.  
  55. local destory = Instance.new("TextButton",bground)
  56. destory.Name = "destory"
  57. destory.Text = "destroy"
  58. destory.Position = UDim2.new(0.2, 0,0.6, 0)
  59. destory.Size = UDim2.new(0.7,0,0.25,0)
  60. destory.TextScaled = true
  61. destory.TextWrapped = true
  62. destory.BackgroundColor3 = Color3.fromRGB(200,200,200)
  63.  
  64. function die()
  65. _G.LoopEnabled = false
  66. base.Enabled = false
  67. base:ClearAllChildren()
  68. end
  69.  
  70. submit.MouseButton1Down:connect(sound)
  71. submit2.MouseButton1Down:connect(sound2)
  72. destory.MouseButton1Down:connect(die)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement