Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.99 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. --[[ vegetto music player 1.0
  88.  
  89. https://www.roblox.com/users/58288186/profile
  90. http://pastebin.com/u/memesbruh03
  91.  
  92. ]]
  93.  
  94. --[[
  95.  
  96. what's new?
  97.  
  98. - 1.1.0
  99. · prints starting message
  100. · you can now choose what colour (cyan by default) you want it to be if you want to post this as a new script/paste
  101. · clicking the play button now shows bgm info on top
  102. · main frame is now draggable (might not work but could be fixed soon)
  103.  
  104. - 1.2.0
  105. · now you can set the font for the music player itself
  106. · dragging the gui still doesn't work
  107. · new bgm info appears above character
  108.  
  109. - 1.3.0
  110. · bgm info appears above screen again
  111. · GUI now has sounds
  112. · default appearance changed
  113.  
  114. - 1.3.1
  115. · sounds work correctly
  116. · default appearance changed
  117. · I'm not actually gonna work on the draggable frame, as it's 2hard4me
  118.  
  119. - 1.4.0
  120. · users can now play audio from hash codes (i.e. 7b509300b5bed2c924d6a0bda990d33b)
  121. · not only that, but the music player itself is also larger
  122. · it's also pretty rare to find working songs like these.
  123. · you can now set the style of title when it disappears, but only when you save post this as a new paste
  124. · custom() now works properly
  125.  
  126. ]]
  127.  
  128. print("vegetto music player version 1.0")
  129.  
  130. -- define player variable
  131. local Player= owner
  132.  
  133. -- appearance
  134. col=Color3.fromRGB(255, 255, 0) -- blue color
  135. font=Enum.Font.SciFi
  136. style="Fade"
  137.  
  138. -- creation of gui
  139. local scrg=Instance.new("ScreenGui",Player.PlayerGui)
  140. local credit=Instance.new("TextLabel",scrg)
  141. credit.BackgroundColor3=Color3.fromRGB(255, 170, 0)
  142. credit.BackgroundTransparency=1
  143. credit.Position=UDim2.new(0,0,1,-18)
  144. credit.Size=UDim2.new(1,0,0,18)
  145. credit.Font=font
  146. credit.FontSize=Enum.FontSize.Size18
  147. credit.Text="More SCRIPTS by adchand2 available at: http://pastebin.com/u/memesbruh03"
  148. credit.TextColor3=Color3.fromRGB(255,255,255)
  149. credit.TextScaled=true
  150. credit.TextStrokeTransparency=0.5
  151. credit.TextWrapped=true
  152. credit.TextXAlignment=Enum.TextXAlignment.Left
  153. local title=Instance.new("TextLabel",scrg)
  154. title.BackgroundTransparency=1
  155. title.FontSize=Enum.FontSize.Size60
  156. title.Font=font
  157. title.Size=UDim2.new(1,0,0.25)
  158. title.TextColor3=col
  159. title.TextStrokeTransparency=0.5
  160. title.Text="adchand2's Music Player GUI v1.4.0"
  161. local main=Instance.new("Frame",scrg)
  162. main.BackgroundColor3=Color3.fromRGB(0,0,0)
  163. main.BackgroundTransparency=0.5
  164. main.BorderColor3=col
  165. main.BorderSizePixel=5
  166. main.Position=UDim2.new(0,0,0.5,-100)
  167. main.Size=UDim2.new(0,400,0,90)
  168. main.Selectable=true
  169. main.Draggable=true
  170. local loopcol=Instance.new("Frame",main)
  171. loopcol.BackgroundTransparency=1
  172. loopcol.Size=UDim2.new(1,0,0.2,0)
  173. local ltitle=Instance.new("TextLabel",loopcol)
  174. ltitle.BackgroundColor3=Color3.fromRGB(255,255,255)
  175. ltitle.BackgroundTransparency=1
  176. ltitle.Size=UDim2.new(1,0,1,0)
  177. ltitle.Font=font
  178. ltitle.FontSize=Enum.FontSize.Size18
  179. ltitle.Text="Looped"
  180. ltitle.TextColor3=col
  181. ltitle.TextXAlignment=Enum.TextXAlignment.Left
  182. ltitle.Active=false
  183. local ltrue=Instance.new("TextButton",loopcol)
  184. ltrue.BackgroundColor3=Color3.fromRGB(0,0,0)
  185. ltrue.BackgroundTransparency=0.5
  186. ltrue.BorderSizePixel=0
  187. ltrue.Position=UDim2.new(0.5,0,0,0)
  188. ltrue.Size=UDim2.new(0.25,0,1,0)
  189. ltrue.Font=font
  190. ltrue.FontSize=Enum.FontSize.Size18
  191. ltrue.Text="true"
  192. ltrue.TextColor3=Color3.fromRGB(255,255,255)
  193. local lfalse=Instance.new("TextButton",loopcol)
  194. lfalse.Name="TextButton2"
  195. lfalse.BackgroundColor3=Color3.fromRGB(0,0,0)
  196. lfalse.BackgroundTransparency=0.5
  197. lfalse.BorderSizePixel=0
  198. lfalse.Position=UDim2.new(0.75,0,0,0)
  199. lfalse.Size=UDim2.new(0.25,0,1,0)
  200. lfalse.Font=font
  201. lfalse.FontSize=Enum.FontSize.Size18
  202. lfalse.Text="false"
  203. lfalse.TextColor3=Color3.fromRGB(255,255,255)
  204. local pscol=Instance.new("Frame",main)
  205. pscol.Name="Frame2"
  206. pscol.BackgroundTransparency=1
  207. pscol.Position=UDim2.new(0,0,0.2,0)
  208. pscol.Size=UDim2.new(1,0,0.2,0)
  209. local pstitle=Instance.new("TextLabel",pscol)
  210. pstitle.BackgroundTransparency=1
  211. pstitle.Size=UDim2.new(1,0,1,0)
  212. pstitle.Font=font
  213. pstitle.FontSize=Enum.FontSize.Size18
  214. pstitle.Text="PlaybackSpeed"
  215. pstitle.TextColor3=col
  216. pstitle.TextXAlignment=Enum.TextXAlignment.Left
  217. pstitle.Active=false
  218. local psfield=Instance.new("TextBox",pscol)
  219. psfield.BackgroundColor3=Color3.fromRGB(0,0,0)
  220. psfield.BackgroundTransparency=0.5
  221. psfield.BorderSizePixel=0
  222. psfield.Position=UDim2.new(0.5,0,0,0)
  223. psfield.Size=UDim2.new(0.5,0,1,0)
  224. psfield.Font=font
  225. psfield.FontSize=Enum.FontSize.Size18
  226. psfield.Text="Input Here"
  227. psfield.TextColor3=Color3.fromRGB(255,255,255)
  228. psfield.TextScaled=true
  229. local sidcol=Instance.new("Frame",main)
  230. sidcol.Name="Frame3"
  231. sidcol.BackgroundTransparency=1
  232. sidcol.Position=UDim2.new(0,0,0.4,0)
  233. sidcol.Size=UDim2.new(1,0,0.2,0)
  234. local sidtitle=Instance.new("TextLabel",sidcol)
  235. sidtitle.BackgroundColor3=Color3.fromRGB(255,255,255)
  236. sidtitle.BackgroundTransparency=1
  237. sidtitle.Size=UDim2.new(1,0,1,0)
  238. sidtitle.Font=font
  239. sidtitle.FontSize=Enum.FontSize.Size18
  240. sidtitle.Text="SoundId"
  241. sidtitle.TextColor3=col
  242. sidtitle.TextXAlignment=Enum.TextXAlignment.Left
  243. sidtitle.Active=false
  244. local sidfield=Instance.new("TextBox",sidcol)
  245. sidfield.BackgroundColor3=Color3.fromRGB(0,0,0)
  246. sidfield.BackgroundTransparency=0.5
  247. sidfield.BorderSizePixel=0
  248. sidfield.Position=UDim2.new(0.5,0,0,0)
  249. sidfield.Size=UDim2.new(0.5,0,1,0)
  250. sidfield.Font=font
  251. sidfield.FontSize=Enum.FontSize.Size18
  252. sidfield.Text="Input Here"
  253. sidfield.TextColor3=Color3.fromRGB(255,255,255)
  254. sidfield.TextScaled=true
  255. local volucol=Instance.new("Frame",main)
  256. volucol.Name="Frame4"
  257. volucol.BackgroundColor3=Color3.new(1,1,1)
  258. volucol.BackgroundTransparency=1
  259. volucol.Position=UDim2.new(0,0,0.6,0)
  260. volucol.Size=UDim2.new(1,0,0.2,0)
  261. local volutitle=Instance.new("TextLabel",volucol)
  262. volutitle.BackgroundColor3=Color3.fromRGB(255,255,255)
  263. volutitle.BackgroundTransparency=1
  264. volutitle.Size=UDim2.new(1,0,1,0)
  265. volutitle.Font=font
  266. volutitle.FontSize=Enum.FontSize.Size18
  267. volutitle.Text="Volume"
  268. volutitle.TextColor3=col
  269. volutitle.TextXAlignment=Enum.TextXAlignment.Left
  270. volutitle.Active=false
  271. local volufield= Instance.new("TextBox",volucol)
  272. volufield.BackgroundColor3=Color3.fromRGB(0,0,0)
  273. volufield.BackgroundTransparency=0.5
  274. volufield.BorderSizePixel=0
  275. volufield.Position=UDim2.new(0.5,0,0,0)
  276. volufield.Size=UDim2.new(0.5,0,1,0)
  277. volufield.Font=font
  278. volufield.FontSize=Enum.FontSize.Size18
  279. volufield.Text="Input Here"
  280. volufield.TextColor3=Color3.fromRGB(255,255,255)
  281. volufield.TextScaled=true
  282. local control=Instance.new("Frame",main)
  283. control.Name="Frame5"
  284. control.BackgroundColor3=Color3.fromRGB(255,255,255)
  285. control.BackgroundTransparency=1
  286. control.Position=UDim2.new(0,0,0.8,0)
  287. control.Size=UDim2.new(1,0,0.2,0)
  288. local pleh1=Instance.new("TextButton",control)
  289. pleh1.BackgroundColor3=Color3.fromRGB(0,0,0)
  290. pleh1.BackgroundTransparency=0.5
  291. pleh1.BorderSizePixel=0
  292. pleh1.Size=UDim2.new(0.25,0,1,0)
  293. pleh1.Font=font
  294. pleh1.FontSize=Enum.FontSize.Size18
  295. pleh1.Text="Play Music"
  296. pleh1.TextColor3=Color3.fromRGB(255,255,255)
  297. local pleh2=Instance.new("TextButton",control)
  298. pleh2.BackgroundColor3=Color3.fromRGB(0,0,0)
  299. pleh2.BackgroundTransparency=0.5
  300. pleh2.BorderSizePixel=0
  301. pleh2.Position=UDim2.new(0.25,0,0,0)
  302. pleh2.Size=UDim2.new(0.25,0,1,0)
  303. pleh2.Font=font
  304. pleh2.FontSize=Enum.FontSize.Size18
  305. pleh2.Text="Play # Music"
  306. pleh2.TextColor3=Color3.fromRGB(255,255,255)
  307. local stahp=Instance.new("TextButton",control)
  308. stahp.Name="TextButton2"
  309. stahp.BackgroundColor3=Color3.fromRGB(0,0,0)
  310. stahp.BackgroundTransparency=0.5
  311. stahp.BorderSizePixel=0
  312. stahp.Position=UDim2.new(0.5, 0, 0, 0)
  313. stahp.Size=UDim2.new(0.5, 0, 1, 0)
  314. stahp.Font=font
  315. stahp.FontSize=Enum.FontSize.Size18
  316. stahp.Text="Stop Music"
  317. stahp.TextColor3=Color3.fromRGB(255,255,255)
  318. -- yay! creation is finished!
  319. -- but wait... ...there's more...
  320.  
  321.  
  322. -- this is the fun part...
  323.  
  324. -- define looped variable
  325. looped=true
  326.  
  327. function create()
  328. local sound=Instance.new("Sound",workspace)
  329. sound.Name="MusicGUIsong"
  330. end
  331.  
  332. function del()
  333. if workspace.MusicGUIsong.IsPlaying==true then
  334. workspace.MusicGUIsong:Destroy()
  335. end
  336. end
  337.  
  338. function informii()
  339. --[[local doublecheckplayer= owner
  340. local wp=workspace:findFirstChild(doublecheckplayer)
  341. local hed=wp.Head
  342. local b=Instance.new("BillboardGui",hed)
  343. b.StudsOffset=Vector3.new(0,4,0)
  344. b.Size=UDim2.new(18,0,4,0)
  345. b.Adornee=hed
  346. local t=Instance.new("TextLabel",b)
  347. t.BackgroundTransparency=1
  348. t.TextColor3=col]]
  349. --t.Text=[[SoundId playing: ]]..sidfield.Text..[[
  350. --PlaybackSpeed: ]]..psfield.Text..[[
  351. --Volume: ]]..volufield.Text
  352. --[[t.Font=font
  353. t.Size=UDim2.new(1,0,1,0) -- keeping this here in case I want to use it again
  354. t.TextScaled=true
  355. wait(5)
  356. t:Destroy()]]
  357. local h=Instance.new("Hint",workspace)
  358. h.Text="SoundId playing: "..sidfield.Text.." - PlaybackSpeed: "..psfield.Text.." - Volume: "..volufield.Text
  359. wait(5)
  360. h:Destroy()
  361. end
  362.  
  363. function custom(texts) -- custom notification
  364. local wp=workspace:FindFirstChild(Player.Name)
  365. local hed=wp.Head
  366. local b=Instance.new("BillboardGui",hed)
  367. b.StudsOffset=Vector3.new(0,4,0)
  368. b.Size=UDim2.new(18,0,6,0)
  369. b.Adornee=hed
  370. local t=Instance.new("TextLabel",b)
  371. t.BackgroundTransparency=1
  372. t.TextColor3=col
  373. t.Text=texts
  374. t.Font=font
  375. t.Size=UDim2.new(1,0,1,0)
  376. t.TextScaled=true
  377. wait(5)
  378. repeat
  379. wait(0.05)
  380. t.TextTransparency=t.TextTransparency+0.1
  381. until
  382. t.TextTransparency==1
  383. t:Destroy()
  384. end
  385.  
  386. function makesound(id)
  387. local s=Instance.new("Sound",main)
  388. s.SoundId=id
  389. s.Volume=1
  390. s.PlaybackSpeed=1
  391. s:Play()
  392. end
  393.  
  394. ltrue.MouseButton1Click:connect(function()
  395. looped=true
  396. end)
  397. lfalse.MouseButton1Click:connect(function()
  398. looped=false
  399. end)
  400. pleh1.MouseButton1Click:connect(function()
  401. create()
  402. workspace.MusicGUIsong.Looped=looped
  403. workspace.MusicGUIsong.PlaybackSpeed=psfield.Text
  404. workspace.MusicGUIsong.SoundId="rbxassetid://"..sidfield.Text
  405. workspace.MusicGUIsong.Volume=volufield.Text
  406. workspace.MusicGUIsong:Play()
  407. informii()
  408. end)
  409. pleh2.MouseButton1Click:connect(function()
  410. create()
  411. workspace.MusicGUIsong.Looped=looped
  412. workspace.MusicGUIsong.PlaybackSpeed=psfield.Text
  413. workspace.MusicGUIsong.SoundId="http://www.roblox.com/asset/?hash="..sidfield.Text
  414. workspace.MusicGUIsong.Volume=volufield.Text
  415. workspace.MusicGUIsong:Play()
  416. informii()
  417. end)
  418. stahp.MouseButton1Click:connect(function()
  419. del()
  420. end)
  421.  
  422. -- sounds
  423.  
  424. ltrue.MouseButton1Click:connect(function()
  425. makesound("rbxassetid://156785206")
  426. end)
  427.  
  428. lfalse.MouseButton1Click:connect(function()
  429. makesound("rbxassetid://156785206")
  430. end)
  431.  
  432. psfield.SelectionGained:connect(function()
  433. makesound("rbxassetid://156785206")
  434. end)
  435.  
  436. psfield.Changed:connect(function()
  437. makesound("rbxassetid://215658476")
  438. end)
  439.  
  440. sidfield.SelectionGained:connect(function()
  441. makesound("rbxassetid://156785206")
  442. end)
  443.  
  444. sidfield.Changed:connect(function()
  445. makesound("rbxassetid://215658476")
  446. end)
  447.  
  448. volufield.SelectionGained:connect(function()
  449. makesound("rbxassetid://156785206")
  450. end)
  451.  
  452. volufield.Changed:connect(function()
  453. makesound("rbxassetid://215658476")
  454. end)
  455.  
  456. pleh1.MouseButton1Click:connect(function()
  457. makesound("rbxassetid://156785206")
  458. end)
  459.  
  460. pleh2.MouseButton1Click:connect(function()
  461. makesound("rbxassetid://156785206")
  462. end)
  463.  
  464. stahp.MouseButton1Click:connect(function()
  465. makesound("rbxassetid://156785206")
  466. end)
  467.  
  468. -- title fade after 3 seconds
  469.  
  470. wait(3)
  471. if style=="Fade" then
  472. repeat
  473. wait(0.05)
  474. title.TextTransparency=title.TextTransparency+0.01
  475. title.TextStrokeTransparency=title.TextStrokeTransparency+0.005
  476. until
  477. title.TextTransparency>=1 and title.TextStrokeTransparency>=1
  478. title:Destroy()
  479. elseif style=="Shrink" then
  480. repeat
  481. wait(0.05)
  482. title.TextSize=title.TextSize-1
  483. until
  484. title.TextSize==1
  485. title:Destroy()
  486. elseif style=="Hide" then
  487. title:TweenPosition(UDim2.new(0,0,-1,0),"In","Back",1)
  488. wait(1)
  489. title:Destroy()
  490. else
  491. print([[style "]]..style..[[" is invalid, returning "Fade"]])
  492. repeat
  493. wait(0.05)
  494. title.TextTransparency=title.TextTransparency+0.01
  495. title.TextStrokeTransparency=title.TextStrokeTransparency+0.005
  496. until
  497. title.TextTransparency>=1 and title.TextStrokeTransparency>=1
  498. title:Destroy()
  499. end
  500.  
  501. custom("refrop music player 1.4.0 is now prepared")
  502. print("refrop music player 1.4.0 is at the end!")
  503. print(_vegetto.." vegetto version!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement