zachhy

Untitled

Apr 18th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. local char = game.Players.LocalPlayer.Character
  2.  
  3.  
  4.  
  5. -- CREATING BUTTONS, LABELS, FRAMES, ETC.
  6. local gui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui) -- CoreGui is buggy, since GPlayr is designed for PlayerGuis, not CoreGuis.
  7. local openbtn = Instance.new("TextButton", gui)
  8. local closebtn = Instance.new("TextButton", gui)
  9. local openguibtn = Instance.new("TextButton", gui)
  10. local playmusicint = Instance.new("Frame", gui)
  11. local playmusicbtn = Instance.new("ImageButton", playmusicint)
  12. local stopmusicbtn = Instance.new("ImageButton", playmusicint)
  13. local musicidbox = Instance.new("TextBox", playmusicint)
  14. local credit = Instance.new("TextLabel", playmusicint)
  15. local title = Instance.new("TextLabel", playmusicint)
  16.  
  17.  
  18. -- SIZING --
  19.  
  20. openbtn.Size = UDim2.new(0, 100, 0, 20)
  21. closebtn.Size = UDim2.new(0, 100, 0, 20)
  22. openguibtn.Size = UDim2.new(0, 100, 0, 20)
  23. playmusicbtn.Size = UDim2.new(0, 50, 0, 50)
  24. stopmusicbtn.Size = UDim2.new(0, 57, 0, 57)
  25. musicidbox.Size = UDim2.new(0, 300, 0, 20)
  26. credit.Size = UDim2.new(0, 300, 0, 20)
  27. title.Size = UDim2.new(0, 300, 0, 30)
  28. playmusicint.Size = UDim2.new(0, 300, 0, 250)
  29.  
  30. -- POSITIONING --
  31.  
  32. openbtn.Position = UDim2.new(0, 0, 0, 510)
  33. closebtn.Position = UDim2.new(0, 0, 0, 510)
  34. openguibtn.Position = UDim2.new(0, 0, 0, 590)
  35. playmusicbtn.Position = UDim2.new(0, 50, 0, 200)
  36. stopmusicbtn.Position = UDim2.new(0, 175, 0, 197)
  37. musicidbox.Position = UDim2.new(0, 0, 0, 100)
  38. credit.Position = UDim2.new(0, 0, 0, 470)
  39. title.Position = UDim2.new(0, 0, 0, 0)
  40. playmusicint.Position = UDim2.new(0, 200, 0, 100)
  41.  
  42. -- SET TEXT --
  43.  
  44. title.Text = "Ev0Lve radio (BETA)"
  45. credit.Text = "Ev0lve radio by Cliqqaphonk"
  46. musicidbox.Text = "Enter Sound ID Here"
  47. openbtn.Text = "Take Out Radio"
  48. closebtn.Text = "Put Away Radio"
  49. openguibtn.Text = "Open/Close Music GUI"
  50.  
  51. -- SET IMAGE IDS --
  52. playmusicbtn.Image = "rbxassetid://499381047"
  53. stopmusicbtn.Image = "rbxassetid://499381006"
  54.  
  55. -- BACKGROUND COLOR3 --
  56.  
  57. playmusicint.BackgroundColor3 = Color3.new(18, 66, 89)
  58. openbtn.BackgroundColor3 = Color3.fromRGB(18, 66, 89)
  59. closebtn.BackgroundColor3 = Color3.fromRGB(18, 66, 89)
  60. openguibtn.BackgroundColor3 = Color3.fromRGB(18, 66, 89)
  61. musicidbox.BackgroundColor3 = Color3.fromRGB(18, 66, 89)
  62.  
  63. -- BACKGROUND TRANSPARENCY --
  64.  
  65. playmusicint.BackgroundTransparency = 0.9
  66. playmusicbtn.BackgroundTransparency = 1
  67. stopmusicbtn.BackgroundTransparency = 1
  68. musicidbox.BackgroundTransparency = 0.43
  69. credit.BackgroundTransparency = 1
  70. title.BackgroundTransparency = 1
  71.  
  72. -- BORDER SIZE PIXEL --
  73.  
  74. musicidbox.BorderSizePixel = 0
  75. openbtn.BorderSizePixel = 3
  76. closebtn.BorderSizePixel = 3
  77. openguibtn.BorderSizePixel = 3
  78.  
  79. -- FONTS --
  80. musicidbox.Font = "SourceSansLight"
  81. credit.Font = "SourceSansLight"
  82. title.Font = "SourceSansLight"
  83.  
  84.  
  85. -- TEXT SCALED --
  86. credit.TextScaled = true
  87. title.TextScaled = true
  88.  
  89. -- TEXT WRAPPED --
  90. musicidbox.TextWrapped = true
  91. credit.TextWrapped = true
  92. title.TextWrapped = true
  93. openguibtn.TextWrapped = true
  94.  
  95. -- FONT SIZE --
  96. musicidbox.FontSize = "Size28"
  97.  
  98. -- ACTIVE --
  99. playmusicint.Active = true
  100.  
  101. -- DRAGGABLE --
  102. playmusicint.Draggable = true
  103. -- RESETONSPAWN --
  104.  
  105.  
  106. -- GUI FUNCTIONS (MAIN) --
  107.  
  108. -- set up the stuff --
  109. isGuiOpen = false
  110. closebtn.Visible = false
  111. playmusicint.Visible = false
  112. openguibtn.Visible = false
  113.  
  114. openbtn.MouseButton1Click:connect(function()
  115. openbtn.Visible = false
  116. closebtn.Visible = true
  117.  
  118. local radio = Instance.new("Part", char)
  119. radio.Name = "Radio"
  120. local mesh = Instance.new("FileMesh", radio)
  121. mesh.MeshId = "http://www.roblox.com/asset/?id=212302951"
  122. mesh.TextureId = "http://www.roblox.com/asset/?id=212303049"
  123. mesh.Scale = Vector3.new(4, 4, 4)
  124. mesh.VertexColor = Vector3.new(1, 1, 1)
  125. mesh.Offset = Vector3.new(0, 0, 0)
  126.  
  127.  
  128. local function weldBetween(a, b)
  129. local weld = Instance.new("ManualWeld")
  130. weld.Part0 = a
  131. weld.Part1 = b
  132. weld.C0 = CFrame.new()
  133. weld.C1 = b.CFrame:inverse() * a.CFrame
  134. weld.Parent = a
  135. return weld;
  136. end
  137. local hand = radio:clone()
  138. hand.Parent=char
  139. hand.CFrame=char:WaitForChild("Torso").CFrame*CFrame.new(Vector3.new(0,0,0.9))*CFrame.Angles(0,math.rad(180),math.rad(45))
  140. weldBetween(char:WaitForChild("Torso"), hand)
  141. hand.CanCollide=true
  142. hand.Anchored=false
  143.  
  144. sound = Instance.new("Sound", hand) -- we will now call the radio "hand"
  145. sound.Volume = 0.5
  146. sound.Pitch = 1
  147.  
  148. openguibtn.Visible = true
  149. char:FindFirstChild("Radio"):Destroy()
  150. end)
  151.  
  152.  
  153. closebtn.MouseButton1Click:connect(function()
  154. openbtn.Visible = true
  155. closebtn.Visible = false
  156. openguibtn.Visible = false
  157. playmusicint.Visible = false
  158. isGuiOpen = false
  159. char:WaitForChild("Radio"):Destroy()
  160. end)
  161.  
  162. playmusicbtn.MouseButton1Click:connect(function()
  163. sound:stop()
  164. wait(0.2)
  165. sound.SoundId = "rbxassetid://"..musicidbox.Text
  166. sound:play()
  167. end)
  168.  
  169. stopmusicbtn.MouseButton1Click:connect(function()
  170. sound:stop()
  171. end)
  172.  
  173.  
  174. openguibtn.MouseButton1Click:connect(function()
  175. if isGuiOpen == false then isGuiOpen = true
  176. playmusicint.Visible = true else isGuiOpen = false playmusicint.Visible = false
  177. end
  178. end)
Add Comment
Please, Sign In to add comment