Guest User

Radio Script Non-FE

a guest
Jul 10th, 2019
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.66 KB | None | 0 0
  1. -- -13.009, 3, 28.169
  2. -- -13.11, 3.23, 28.97
  3. -- -0.101, 0.77, 0.801
  4.  
  5. local player = game.Players.LocalPlayer
  6. local character = player.Character
  7. local humanoid_root_part = character.HumanoidRootPart
  8. local market_place_service = game:GetService("MarketplaceService")
  9.  
  10. function create_weld(parent, part0, part1, c0, c1)
  11.     local weld = Instance.new("Weld", parent)
  12.     weld.Part0 = part0
  13.     weld.Part1 = part1
  14.     weld.C0 = c0
  15.     weld.C1 = c1
  16. end
  17.  
  18. local radio = Instance.new("Part", character)
  19. radio.Name = "Radio"
  20. radio.Size = Vector3.new(3.2, 1.6, 1.2)
  21. radio.CFrame = CFrame.new(humanoid_root_part.CFrame.X + (-0.101), humanoid_root_part.CFrame.Y + 0.23, humanoid_root_part.CFrame.Z + 0.801)
  22. create_weld(radio, radio, humanoid_root_part, radio.CFrame:inverse(), humanoid_root_part.CFrame:inverse())
  23. radio.Orientation = Vector3.new(0, 180, 0)
  24. local radio_mesh = Instance.new("SpecialMesh", radio)
  25. radio_mesh.MeshId = "rbxassetid://212302951"
  26. radio_mesh.MeshType = Enum.MeshType.FileMesh
  27. radio_mesh.Offset = Vector3.new(0, 0, 0)
  28. radio_mesh.Scale = Vector3.new(4, 4, 4)
  29. radio_mesh.TextureId = "rbxassetid://212303049"
  30. radio_mesh.VertexColor = Vector3.new(1, 1, 1)
  31. local sparkles = Instance.new("Sparkles", radio)
  32. sparkles.SparkleColor = Color3.fromRGB(255, 255, 0)
  33. local sound = Instance.new("Sound", radio)
  34. sound.Playing = true
  35. sound.Looped = true
  36.  
  37. local RadioGui = Instance.new("ScreenGui")
  38. local Frame = Instance.new("Frame")
  39. local Title = Instance.new("TextLabel")
  40. local PlayButton = Instance.new("TextButton")
  41. local PauseButton = Instance.new("TextButton")
  42. local StopButton = Instance.new("TextButton")
  43. local SoundID = Instance.new("TextBox")
  44.  
  45. RadioGui.Name = "RadioGui"
  46. RadioGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  47. RadioGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  48.  
  49. Frame.Parent = RadioGui
  50. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  51. Frame.BorderColor3 = Color3.new(0, 0, 0)
  52. Frame.BorderSizePixel = 0
  53. Frame.Position = UDim2.new(0.00642201817, 0, 0.61403507, 0)
  54. Frame.Size = UDim2.new(0.343119264, 0, 0.369005859, 0)
  55.  
  56. Title.Name = "Title"
  57. Title.Parent = Frame
  58. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  59. Title.BackgroundTransparency = 1
  60. Title.BorderColor3 = Color3.new(0, 0, 0)
  61. Title.BorderSizePixel = 0
  62. Title.Selectable = true
  63. Title.Size = UDim2.new(1, 0, 0.205652446, 0)
  64. Title.Font = Enum.Font.SourceSans
  65. Title.Text = "Radio GUI"
  66. Title.TextColor3 = Color3.new(0, 0, 0)
  67. Title.TextScaled = true
  68. Title.TextSize = 14
  69. Title.TextWrapped = true
  70.  
  71. PlayButton.Name = "PlayButton"
  72. PlayButton.Parent = Frame
  73. PlayButton.BackgroundColor3 = Color3.new(0.333333, 1, 0)
  74. PlayButton.BorderColor3 = Color3.new(0, 0, 0)
  75. PlayButton.BorderSizePixel = 0
  76. PlayButton.Position = UDim2.new(0, 0, 0.734284222, 0)
  77. PlayButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0)
  78. PlayButton.Font = Enum.Font.SourceSans
  79. PlayButton.Text = "PLAY"
  80. PlayButton.TextColor3 = Color3.new(1, 1, 1)
  81. PlayButton.TextScaled = true
  82. PlayButton.TextSize = 14
  83. PlayButton.TextWrapped = true
  84.  
  85. PauseButton.Name = "PauseButton"
  86. PauseButton.Parent = Frame
  87. PauseButton.BackgroundColor3 = Color3.new(1, 0.666667, 0)
  88. PauseButton.BorderColor3 = Color3.new(0, 0, 0)
  89. PauseButton.BorderSizePixel = 0
  90. PauseButton.Position = UDim2.new(0.334224582, 0, 0.734284222, 0)
  91. PauseButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0)
  92. PauseButton.Font = Enum.Font.SourceSans
  93. PauseButton.Text = "PAUSE"
  94. PauseButton.TextColor3 = Color3.new(1, 1, 1)
  95. PauseButton.TextScaled = true
  96. PauseButton.TextSize = 14
  97. PauseButton.TextWrapped = true
  98.  
  99. StopButton.Name = "StopButton"
  100. StopButton.Parent = Frame
  101. StopButton.BackgroundColor3 = Color3.new(1, 0, 0)
  102. StopButton.BorderColor3 = Color3.new(0, 0, 0)
  103. StopButton.BorderSizePixel = 0
  104. StopButton.Position = UDim2.new(0.671122968, 0, 0.734284222, 0)
  105. StopButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0)
  106. StopButton.Font = Enum.Font.SourceSans
  107. StopButton.Text = "STOP"
  108. StopButton.TextColor3 = Color3.new(1, 1, 1)
  109. StopButton.TextScaled = true
  110. StopButton.TextSize = 14
  111. StopButton.TextWrapped = true
  112.  
  113. SoundID.Name = "SoundID"
  114. SoundID.Parent = Frame
  115. SoundID.BackgroundColor3 = Color3.new(0.333333, 0.666667, 1)
  116. SoundID.BorderColor3 = Color3.new(0, 0, 0)
  117. SoundID.BorderSizePixel = 3
  118. SoundID.Position = UDim2.new(0.213903725, 0, 0.364500791, 0)
  119. SoundID.Size = UDim2.new(0.566310227, 0, 0.269043893, 0)
  120. SoundID.Font = Enum.Font.SourceSans
  121. SoundID.PlaceholderColor3 = Color3.new(1, 1, 1)
  122. SoundID.PlaceholderText = "Sound ID"
  123. SoundID.Text = ""
  124. SoundID.TextColor3 = Color3.new(1, 1, 1)
  125. SoundID.TextScaled = true
  126. SoundID.TextSize = 14
  127. SoundID.TextWrapped = true
  128.  
  129. local radio_billboard_gui = Instance.new("BillboardGui", character.Head)
  130. radio_billboard_gui.Name = "RadioBillboardGUI"
  131. radio_billboard_gui.Adornee = character.Head
  132. radio_billboard_gui.AlwaysOnTop = true
  133. radio_billboard_gui.ExtentsOffsetWorldSpace = Vector3.new(0, 9, 0)
  134. radio_billboard_gui.Size = UDim2.new(8, 0, 6, 0)
  135. local radio_billboard_gui_textlabel = Instance.new("TextLabel", radio_billboard_gui)
  136. radio_billboard_gui_textlabel.BackgroundTransparency = 1
  137. radio_billboard_gui_textlabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  138. radio_billboard_gui_textlabel.BorderSizePixel = 0
  139. radio_billboard_gui_textlabel.Size = UDim2.new(1, 0, 1, 0)
  140. radio_billboard_gui_textlabel.Text = "Right now playing: "
  141. radio_billboard_gui_textlabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  142. radio_billboard_gui_textlabel.TextSize = 18
  143. radio_billboard_gui_textlabel.TextWrapped = true
  144.  
  145. function zigzag(x)
  146.     return math.acos(math.cos(x * math.pi)) / math.pi
  147. end
  148.    
  149. PlayButton.MouseButton1Click:Connect(function()
  150.     if sound.IsPaused == true then
  151.         sound:Resume()
  152.     else
  153.         sound.SoundId = "rbxassetid://"..tonumber(SoundID.Text)
  154.         sound:Play()
  155.         local info = market_place_service:GetProductInfo(tonumber(SoundID.Text))
  156.         radio_billboard_gui_textlabel.Text = "Right now playing: "..info.Name
  157.     end
  158. end)
  159.    
  160. PauseButton.MouseButton1Click:Connect(function()
  161.     sound:Pause()
  162. end)
  163.  
  164. StopButton.MouseButton1Click:Connect(function()
  165.     sound:Stop()
  166. end)
  167.  
  168. local while_wait_do1 = coroutine.create(function()
  169.     local counter = 0
  170.     while wait(0.1) do
  171.         Frame.BackgroundColor3 = Color3.fromHSV(zigzag(counter), 1, 1)
  172.         counter = counter + 0.01
  173.     end
  174. end)
  175. coroutine.resume(while_wait_do1)
  176.  
  177. local while_wait_do2 = coroutine.create(function()
  178.     local counter = 0
  179.     while wait(0.1) do
  180.         radio_billboard_gui_textlabel.TextColor3 = Color3.fromHSV(zigzag(counter), 1, 1)
  181.         counter = counter + 0.01
  182.     end
  183. end)
  184. coroutine.resume(while_wait_do2)
  185.  
  186. local while_wait_do3 = coroutine.create(function()
  187.     while true do
  188.         wait(0.005)
  189.         radio_billboard_gui_textlabel.Rotation = radio_billboard_gui_textlabel.Rotation + 0.07
  190.     end
  191. end)
  192. coroutine.resume(while_wait_do3)
Advertisement
Add Comment
Please, Sign In to add comment