Advertisement
therainbowcreeperRBX

Fe Boombox

Jan 11th, 2019
4,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.97 KB | None | 0 0
  1. --Script Builder Radio!
  2. -- This script has been converted to FE by iPxter
  3.  
  4.  
  5. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  6. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  7. do
  8. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  9. script.Parent = Player.Character
  10.  
  11. --RemoteEvent for communicating
  12. local Event = Instance.new("RemoteEvent")
  13. Event.Name = "UserInput_Event"
  14.  
  15. --Fake event to make stuff like Mouse.KeyDown work
  16. local function fakeEvent()
  17. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  18. t.connect = t.Connect
  19. return t
  20. end
  21.  
  22. --Creating fake input objects with fake variables
  23. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  24. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  25. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  26. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  27. end}
  28. --Merged 2 functions into one by checking amount of arguments
  29. CAS.UnbindAction = CAS.BindAction
  30.  
  31. --This function will trigger the events that have been :Connect()'ed
  32. local function te(self,ev,...)
  33. local t = m[ev]
  34. if t and t._fakeEvent and t.Function then
  35. t.Function(...)
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=Player then return end
  43. if io.isMouse then
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. else
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. for _,t in pairs(CAS.Actions) do
  52. for _,k in pairs(t.Keys) do
  53. if k==io.KeyCode then
  54. t.Function(t.Name,io.UserInputState,io)
  55. end
  56. end
  57. end
  58. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  59. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  60. end
  61. end)
  62. Event.Parent = NLS([==[
  63. local Player = game:GetService("Players").LocalPlayer
  64. local Event = script:WaitForChild("UserInput_Event")
  65.  
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local Mouse = Player:GetMouse()
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  86. end
  87.  
  88. local Player = owner
  89. local c = Player.Character
  90. if not c or not c.Parent then
  91. c = Player.CharacterAdded:wait()
  92. end
  93.  
  94. wait(1)
  95.  
  96. local radio = Instance.new("Part",c)
  97. radio.Name = "Radio"
  98. radio.CanCollide = false
  99. radio.Anchored = true
  100. radio.FormFactor = "Custom"
  101. radio.Size = Vector3.new(3.2, 1.43, 0.8)
  102. radio.CFrame = c.Torso.CFrame * CFrame.new(0,0,.8)
  103. radio.CFrame = radio.CFrame * CFrame.fromEulerAnglesXYZ(0,3.15,0)
  104. radio.CFrame = radio.CFrame * CFrame.fromEulerAnglesXYZ(0,0,-.7)
  105.  
  106. local mesh = Instance.new("SpecialMesh",radio)
  107. mesh.MeshId = "http://www.roblox.com/asset/?id=151760030"
  108. mesh.TextureId = "https://www.roblox.com/Sweg-item?id=156708131"
  109.  
  110. local weld = Instance.new("Weld",radio)
  111. weld.Part0 = c.Torso
  112. weld.Part1 = radio
  113. weld.C0 = c.Torso.CFrame:inverse()
  114. weld.C1 = radio.CFrame:inverse()
  115. radio.Anchored = false
  116.  
  117. local sound = Instance.new("Sound",radio)
  118. sound.Name = "Music"
  119. sound.Looped = true
  120. sound.Volume = 1
  121.  
  122. local gui = Instance.new("ScreenGui",Player.PlayerGui)
  123.  
  124. local frame = Instance.new("Frame",gui)
  125. frame.BackgroundColor3 = Color3.new(58/255,58/255,58/255)
  126. frame.BorderColor3 = Color3.new(0,0,0)
  127. frame.BorderSizePixel = 2
  128. frame.Size = UDim2.new(0,300,0,200)
  129. frame.Position = UDim2.new(0,20,.5,-100)
  130.  
  131. local playb = Instance.new("TextButton",frame)
  132. playb.BackgroundColor3 = Color3.new(0,85/255,0)
  133. playb.BorderColor3 = Color3.new(0,0,0)
  134. playb.BorderSizePixel = 2
  135. playb.Size = UDim2.new(.3,0,.2,0)
  136. playb.Position = UDim2.new(.1,0,.7,0)
  137. playb.Text = "Play"
  138. playb.TextColor3 = Color3.new(255,255,255)
  139. playb.TextScaled = true
  140.  
  141. local stopb = Instance.new("TextButton",frame)
  142. stopb.BackgroundColor3 = Color3.new(170/255,0,0)
  143. stopb.BorderColor3 = Color3.new(0,0,0)
  144. stopb.BorderSizePixel = 2
  145. stopb.Size = UDim2.new(.3,0,.2,0)
  146. stopb.Position = UDim2.new(.6,0,.7,0)
  147. stopb.Text = "Stop"
  148. stopb.TextColor3 = Color3.new(255,255,255)
  149. stopb.TextScaled = true
  150.  
  151. local stipb = Instance.new("TextBox",frame)
  152. stipb.BackgroundColor3 = Color3.new(0,0,127/255)
  153. stipb.BorderColor3 = Color3.new(0,0,0)
  154. stipb.BorderSizePixel = 2
  155. stipb:TweenSize(UDim2.new(.5,0,.25,0),"Out","Quad",1,true)
  156. stipb.Position = UDim2.new(.25,0,.3,0)
  157. stipb.Text = "SoundId"
  158. stipb.TextColor3 = Color3.new(255,255,255)
  159. stipb.TextScaled = true
  160.  
  161. local label = Instance.new("TextLabel",frame)
  162. label.Text = "Made By naser2018!"
  163. label.TextScaled = true
  164. label:TweenSize(UDim2.new(1,0,.2,0))
  165. label.TextColor3 = Color3.new(255,255,255)
  166. label.BackgroundTransparency = 1
  167. --stipb.Size = UDim2.new(1,0,.2,0)
  168.  
  169. local Playing = false
  170.  
  171. stipb.Changed:connect(function()
  172. sound.SoundId = "rbxassetid://" .. stipb.Text
  173. end)
  174.  
  175. playb.MouseButton1Click:connect(function()
  176. sound:Play()
  177. Playing = true
  178. end)
  179.  
  180. stopb.MouseButton1Click:connect(function()
  181. sound:Stop()
  182. Playing = false
  183. end)
  184.  
  185. while true do
  186. if Playing then
  187. mesh.Scale = Vector3.new(1.1,1.1,1.1)
  188. wait(.2)
  189. mesh.Scale = Vector3.new(1,1,1)
  190. end
  191. wait(.2)
  192. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement