Advertisement
antgame11

Untitled

Mar 24th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.59 KB | None | 0 0
  1. -- This script has convert to FE by who i don't know?
  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,game,owner = owner,game
  6. local RealPlayer = Player
  7. do
  8. print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
  9. local rp = RealPlayer
  10. script.Parent = rp.Character
  11.  
  12. --RemoteEvent for communicating
  13. local Event = Instance.new("RemoteEvent")
  14. Event.Name = "UserInput_Event"
  15.  
  16. --Fake event to make stuff like Mouse.KeyDown work
  17. local function fakeEvent()
  18. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  19. t.connect = t.Connect
  20. return t
  21. end
  22.  
  23. --Creating fake input objects with fake variables
  24. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  25. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  26. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  27. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  28. end}
  29. --Merged 2 functions into one by checking amount of arguments
  30. CAS.UnbindAction = CAS.BindAction
  31.  
  32. --This function will trigger the events that have been :Connect()'ed
  33. local function te(self,ev,...)
  34. local t = m[ev]
  35. if t and t._fakeEvent then
  36. for _,f in pairs(t.Functions) do
  37. f(...)
  38. end
  39. end
  40. end
  41. m.TrigEvent = te
  42. UIS.TrigEvent = te
  43.  
  44. Event.OnServerEvent:Connect(function(plr,io)
  45. if plr~=rp then return end
  46. m.Target = io.Target
  47. m.Hit = io.Hit
  48. if not io.isMouse then
  49. local b = io.UserInputState == Enum.UserInputState.Begin
  50. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  51. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67.  
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77.  
  78. local h,t
  79. --Give the server mouse data 30 times every second, but only if the values changed
  80. --If player is not moving their mouse, client won't fire events
  81. while wait(1/30) do
  82. if h~=Mouse.Hit or t~=Mouse.Target then
  83. h,t=Mouse.Hit,Mouse.Target
  84. Event:FireServer({isMouse=true,Target=t,Hit=h})
  85. end
  86. end]==],Player.Character)
  87.  
  88. ----Sandboxed game object that allows the usage of client-side methods and services
  89. --Real game object
  90. local _rg = game
  91.  
  92. --Metatable for fake service
  93. local fsmt = {
  94. __index = function(self,k)
  95. local s = rawget(self,"_RealService")
  96. if s then return s[k] end
  97. end,
  98. __newindex = function(self,k,v)
  99. local s = rawget(self,"_RealService")
  100. if s then s[k]=v end
  101. end,
  102. __call = function(self,...)
  103. local s = rawget(self,"_RealService")
  104. if s then return s(...) end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return self[s]
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. }
  123. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  124. g.service = g.GetService
  125.  
  126. g.RunService = FakeService({
  127. RenderStepped = _rg:GetService("RunService").Heartbeat,
  128. BindToRenderStep = function(self,name,_,fun)
  129.  
  130. end,
  131. UnbindFromRenderStep = function(self,name)
  132. self._btrs[name]:Disconnect()
  133. end,
  134. },"RunService")
  135.  
  136. setmetatable(g,{
  137. __index=function(self,s)
  138. return _rg:GetService(s) or typeof(_rg[s])=="function"
  139. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  140. end,
  141. __newindex = fsmt.__newindex,
  142. __call = fsmt.__call
  143. })
  144. --Changing owner to fake player object to support owner:GetMouse()
  145. game,owner = g,g.Players.LocalPlayer
  146. end
  147.  
  148.  
  149. -- GPlayr by ModernLukest. Made for v3rmillion, , etc.
  150. -- Note that anyone can hear the music that you play. Just a clarification for what LocalScripts can do.
  151.  
  152. local char = game.Players.LocalPlayer.Character
  153.  
  154.  
  155.  
  156. -- CREATING BUTTONS, LABELS, FRAMES, ETC.
  157. local gui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui) -- CoreGui is buggy, since GPlayr is designed for PlayerGuis, not CoreGuis.
  158. local openbtn = Instance.new("TextButton", gui)
  159. local closebtn = Instance.new("TextButton", gui)
  160. local openguibtn = Instance.new("TextButton", gui)
  161. local playmusicint = Instance.new("Frame", gui)
  162. local playmusicbtn = Instance.new("ImageButton", playmusicint)
  163. local stopmusicbtn = Instance.new("ImageButton", playmusicint)
  164. local musicidbox = Instance.new("TextBox", playmusicint)
  165. local credit = Instance.new("TextLabel", playmusicint)
  166. local title = Instance.new("TextLabel", playmusicint)
  167.  
  168. -- SIZING --
  169.  
  170. openbtn.Size = UDim2.new(0, 100, 0, 50)
  171. closebtn.Size = UDim2.new(0, 100, 0, 50)
  172. openguibtn.Size = UDim2.new(0, 100, 0, 50)
  173. playmusicbtn.Size = UDim2.new(0, 50, 0, 50)
  174. stopmusicbtn.Size = UDim2.new(0, 57, 0, 57)
  175. musicidbox.Size = UDim2.new(0, 300, 0, 50)
  176. credit.Size = UDim2.new(0, 300, 0, 20)
  177. title.Size = UDim2.new(0, 300, 0, 30)
  178. playmusicint.Size = UDim2.new(0, 300, 0, 500)
  179.  
  180. -- POSITIONING --
  181.  
  182. openbtn.Position = UDim2.new(0, 0, 0, 510)
  183. closebtn.Position = UDim2.new(0, 0, 0, 510)
  184. openguibtn.Position = UDim2.new(0, 0, 0, 590)
  185. playmusicbtn.Position = UDim2.new(0, 50, 0, 200)
  186. stopmusicbtn.Position = UDim2.new(0, 175, 0, 197)
  187. musicidbox.Position = UDim2.new(0, 0, 0, 100)
  188. credit.Position = UDim2.new(0, 0, 0, 470)
  189. title.Position = UDim2.new(0, 0, 0, 0)
  190. playmusicint.Position = UDim2.new(0, 200, 0, 100)
  191.  
  192. -- SET TEXT --
  193.  
  194. title.Text = "GPlayr (BETA)"
  195. credit.Text = "GPlayr & radio scripting by Developer / ModernLukest"
  196. musicidbox.Text = "Enter Sound ID Here"
  197. openbtn.Text = "Take Out Radio"
  198. closebtn.Text = "Put Away Radio"
  199. openguibtn.Text = "Open/Close Music GUI"
  200.  
  201. -- SET IMAGE IDS --
  202. playmusicbtn.Image = "rbxassetid://499381047"
  203. stopmusicbtn.Image = "rbxassetid://499381006"
  204.  
  205. -- BACKGROUND COLOR3 --
  206.  
  207. playmusicint.BackgroundColor3 = Color3.new(136, 136, 136)
  208. openbtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  209. closebtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  210. openguibtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  211. musicidbox.BackgroundColor3 = Color3.fromRGB(109, 109, 109)
  212.  
  213. -- BACKGROUND TRANSPARENCY --
  214.  
  215. playmusicint.BackgroundTransparency = 0.9
  216. playmusicbtn.BackgroundTransparency = 1
  217. stopmusicbtn.BackgroundTransparency = 1
  218. musicidbox.BackgroundTransparency = 0.43
  219. credit.BackgroundTransparency = 1
  220. title.BackgroundTransparency = 1
  221.  
  222. -- BORDER SIZE PIXEL --
  223.  
  224. musicidbox.BorderSizePixel = 0
  225. openbtn.BorderSizePixel = 3
  226. closebtn.BorderSizePixel = 3
  227. openguibtn.BorderSizePixel = 3
  228.  
  229. -- FONTS --
  230. musicidbox.Font = "SourceSansLight"
  231. credit.Font = "SourceSansLight"
  232. title.Font = "SourceSansLight"
  233.  
  234.  
  235. -- TEXT SCALED --
  236. credit.TextScaled = true
  237. title.TextScaled = true
  238.  
  239. -- TEXT WRAPPED --
  240. musicidbox.TextWrapped = true
  241. credit.TextWrapped = true
  242. title.TextWrapped = true
  243. openguibtn.TextWrapped = true
  244.  
  245. -- FONT SIZE --
  246. musicidbox.FontSize = "Size28"
  247.  
  248. -- ACTIVE --
  249. playmusicint.Active = true
  250.  
  251. -- DRAGGABLE --
  252. playmusicint.Draggable = true
  253.  
  254. -- GUI FUNCTIONS (MAIN) --
  255.  
  256. -- set up the stuff --
  257. isGuiOpen = false
  258. closebtn.Visible = false
  259. playmusicint.Visible = false
  260. openguibtn.Visible = false
  261.  
  262. openbtn.MouseButton1Click:connect(function()
  263. openbtn.Visible = false
  264. closebtn.Visible = true
  265.  
  266. local radio = Instance.new("Part", char)
  267. radio.Name = "Radio"
  268. local mesh = Instance.new("FileMesh", radio)
  269. mesh.MeshId = "http://www.roblox.com/asset/?id=212302951"
  270. mesh.TextureId = "http://www.roblox.com/asset/?id=212303049"
  271. mesh.Scale = Vector3.new(4, 4, 4)
  272. mesh.VertexColor = Vector3.new(1, 1, 1)
  273. mesh.Offset = Vector3.new(0, 0, 0)
  274.  
  275.  
  276. local function weldBetween(a, b)
  277. local weld = Instance.new("ManualWeld")
  278. weld.Part0 = a
  279. weld.Part1 = b
  280. weld.C0 = CFrame.new()
  281. weld.C1 = b.CFrame:inverse() * a.CFrame
  282. weld.Parent = a
  283. return weld;
  284. end
  285. local hand = radio:clone()
  286. hand.Parent=char
  287. hand.CFrame=char:WaitForChild("Torso").CFrame*CFrame.new(Vector3.new(0,0,0.9))*CFrame.Angles(0,math.rad(180),math.rad(45))
  288. weldBetween(char:WaitForChild("Torso"), hand)
  289. hand.CanCollide=true
  290. hand.Anchored=false
  291.  
  292. sound = Instance.new("Sound", hand) -- we will now call the radio "hand"
  293. sound.Volume = 0.5
  294. sound.Pitch = 1
  295.  
  296. openguibtn.Visible = true
  297. char:FindFirstChild("Radio"):Destroy()
  298. end)
  299.  
  300.  
  301. closebtn.MouseButton1Click:connect(function()
  302. openbtn.Visible = true
  303. closebtn.Visible = false
  304. openguibtn.Visible = false
  305. playmusicint.Visible = false
  306. isGuiOpen = false
  307. char:WaitForChild("Radio"):Destroy()
  308. end)
  309.  
  310. playmusicbtn.MouseButton1Click:connect(function()
  311. sound:stop()
  312. wait(0.2)
  313. sound.SoundId = "rbxassetid://"..musicidbox.Text
  314. sound:play()
  315. end)
  316.  
  317. stopmusicbtn.MouseButton1Click:connect(function()
  318. sound:stop()
  319. end)
  320.  
  321.  
  322. openguibtn.MouseButton1Click:connect(function()
  323. if isGuiOpen == false then isGuiOpen = true
  324. playmusicint.Visible = true else isGuiOpen = false playmusicint.Visible = false
  325. end
  326. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement