memberhero

Fixed Nebula FE Converter

Jan 10th, 2021 (edited)
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.59 KB | None | 0 0
  1. -- FE template created by MintyLatios (V3rm) aka Drahazar (ROBLOX)
  2. --Fixed by basstracker1970
  3. local ownerval = Instance.new("ObjectValue")
  4. ownerval.Name = "Owner"
  5. ownerval.Value = owner
  6. ownerval.Parent = script
  7.  
  8. local username = "basstracker1970"
  9.  
  10. if(script:FindFirstChild'Owner')then
  11. repeat wait() until script.Owner.Value
  12. end
  13. function GetPlr(user)
  14. for _,v in next, game:service'Players':players() do
  15. if(v.Name==user)then
  16. return v
  17. end
  18. end
  19. return nil
  20. end
  21. local owner = script:WaitForChild'Owner'.Value
  22. repeat wait() until script:WaitForChild'Owner'.Value
  23. local Player = script:WaitForChild'Owner'.Value
  24. local Mouse,mouse,UserInputService,ContextActionService
  25. script.Owner:destroy()
  26. local scriptName = "Aprins"
  27. do
  28. local GUID = {}
  29. do
  30. GUID.IDs = {};
  31. function GUID:new(len)
  32. local id;
  33. if(not len)then
  34. id = (tostring(function() end))
  35. id = id:gsub("function: ","")
  36. else
  37. local function genID(len)
  38. local newID = ""
  39. for i = 1,len do
  40. newID = newID..string.char(math.random(48,90))
  41. end
  42. return newID
  43. end
  44. repeat id = genID(len) until not GUID.IDs[id]
  45. local oid = id;
  46. id = {Trash=function() GUID.IDs[oid]=nil; end;Get=function() return oid; end}
  47. GUID.IDs[oid]=true;
  48. end
  49. return id
  50. end
  51. end
  52.  
  53. local AHB = Instance.new("BindableEvent")
  54.  
  55. local FPS = 30
  56.  
  57. local TimeFrame = 0
  58.  
  59. local LastFrame = tick()
  60. local Frame = 1/FPS
  61.  
  62. game:service'RunService'.Heartbeat:connect(function(s,p)
  63. TimeFrame = TimeFrame + s
  64. if(TimeFrame >= Frame)then
  65. for i = 1,math.floor(TimeFrame/Frame) do
  66. AHB:Fire()
  67. end
  68. LastFrame=tick()
  69. TimeFrame=TimeFrame-Frame*math.floor(TimeFrame/Frame)
  70. end
  71. end)
  72.  
  73.  
  74. function swait(dur)
  75. if(dur == 0 or typeof(dur) ~= 'number')then
  76. AHB.Event:wait()
  77. else
  78. for i = 1, dur*FPS do
  79. AHB.Event:wait()
  80. end
  81. end
  82. end
  83.  
  84. oPlayer = Player
  85. Player = oPlayer
  86.  
  87. local loudnesses={}
  88. script.Parent = Player.Character
  89. CoAS = {Actions={}}
  90. local Event = Instance.new("RemoteEvent")
  91. Event.Name = "UserInputEvent"
  92. Event.Parent = Player.Character
  93. local Func = Instance.new("RemoteFunction")
  94. Func.Name = "GetClientProperty"
  95. Func.Parent = Player.Character
  96. local fakeEvent = function()
  97. local t = {_fakeEvent=true,Waited={},Connected={}}
  98. t.Connect = function(self,f)
  99. local ft={}
  100. ft={Disconnected=false;disconnect=function(s) if(self.Function==ft)then self.Function=nil end s.Disconnected=true end}
  101. ft.Disconnect=ft.disconnect
  102.  
  103. ft.Func=function(...)
  104. for id,_ in next, t.Waited do
  105. t.Waited[id] = true
  106. end
  107. return f(...)
  108. end;
  109.  
  110. table.insert(self.Connected,ft)
  111. return ft;
  112. end
  113. t.connect = t.Connect
  114. t.Wait = function()
  115. local guid = GUID:new(25)
  116. local waitingId = guid:Get()
  117. t.Waited[waitingId]=false
  118. repeat swait() until t.Waited[waitingId]==true
  119. t.Waited[waitingId]=nil;
  120. guid:Trash()
  121. end
  122. t.wait = t.Wait
  123. return t
  124. end
  125. m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  126. UsIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  127. Run = {RenderStepped=fakeEvent()}
  128.  
  129. function CoAS:BindAction(name,fun,touch,...)
  130. CoAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  131. end
  132. function CoAS:UnbindAction(name)
  133. CoAS.Actions[name] = nil
  134. end
  135. local function te(self,ev,...)
  136. local t = self[ev]
  137. if t and t._fakeEvent and t.Connected then
  138. for i,v in next, t.Connected do
  139. if(v.Func and not v.Disconnected)then
  140. v.Func(...)
  141. else
  142. t.Connected[i]=nil
  143. end
  144. end
  145. end
  146. end
  147. m.TrigEvent = te
  148. UsIS.TrigEvent = te
  149. Run.TrigEvent = te
  150. Event.OnServerEvent:Connect(function(plr,io,...)
  151. if io.Mouse then
  152. m.Target = io.Target
  153. m.Hit = io.Hit
  154. elseif io.KeyEvent then
  155. m:TrigEvent('Key'..io.KeyEvent,io.Key)
  156. elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  157. if io.UserInputState == Enum.UserInputState.Begin then
  158. m:TrigEvent("Button1Down")
  159. else
  160. m:TrigEvent("Button1Up")
  161. end
  162. end
  163. if(not io.KeyEvent and not io.Mouse)then
  164.  
  165. for n,t in pairs(CoAS.Actions) do
  166. for _,k in pairs(t.Keys) do
  167. if k==io.KeyCode then
  168. t.Function(t.Name,io.UserInputState,io)
  169. end
  170. end
  171. end
  172. if io.UserInputState == Enum.UserInputState.Begin then
  173. UsIS:TrigEvent("InputBegan",io,false)
  174. else
  175. UsIS:TrigEvent("InputEnded",io,false)
  176. end
  177. end
  178. local varargs={...}
  179. --remote:FireServer("MouseEventCall",event,...)
  180. if(type=='MouseEventCall')then
  181. local event = table.remove(varargs,1)
  182. if(m[event])then
  183. Event:FireAllClients(event,unpack(varargs))
  184. m:TrigEvent(event,unpack(varargs))
  185. end
  186.  
  187. elseif(type=='MouseUpdate')then
  188. m.Target = varargs[1].Target
  189. m.Hit = varargs[1].Hit
  190. Event:FireAllClients("UpdatePos",m.Target,m.Hit)
  191. end
  192.  
  193.  
  194. end)
  195.  
  196. Func.OnServerInvoke = function(plr,inst,play)
  197. if plr~=Player then return end
  198. if(inst and typeof(inst) == 'Instance' and inst:IsA'Sound')then
  199. loudnesses[inst]=play
  200. end
  201. end
  202.  
  203. function GetClientProperty(inst,prop)
  204. if(prop == 'PlaybackLoudness' and loudnesses[inst])then
  205. return loudnesses[inst]
  206. elseif(prop == 'PlaybackLoudness')then
  207. return Func:InvokeClient(Player,'RegSound',inst)
  208. end
  209. return Func:InvokeClient(Player,inst,prop)
  210. end
  211. NLS ([=[
  212.  
  213.  
  214. local me = game:service'Players'.localPlayer;
  215. local mouse = me:GetMouse();
  216. local UIS = game:service'UserInputService'
  217. local ch = me.Character;
  218.  
  219. local UserEvent = ch:WaitForChild('UserInputEvent',30)
  220.  
  221. UIS.InputChanged:connect(function(io,gpe)
  222. if(io.UserInputType == Enum.UserInputType.MouseMovement)then
  223. UserEvent:FireServer{Mouse=true,Target=mouse.Target,Hit=mouse.Hit}
  224. end
  225. end)
  226.  
  227. mouse.Changed:connect(function(o)
  228. if(o == 'Target' or o == 'Hit')then
  229. UserEvent:FireServer{Mouse=true,Target=mouse.Target,Hit=mouse.Hit}
  230. end
  231. end)
  232.  
  233. UIS.InputBegan:connect(function(io,gpe)
  234. if(gpe)then return end
  235. UserEvent:FireServer{InputObject=true,KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
  236. end)
  237.  
  238. UIS.InputEnded:connect(function(io,gpe)
  239. if(gpe)then return end
  240. UserEvent:FireServer{InputObject=true,KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
  241. end)
  242.  
  243. mouse.KeyDown:connect(function(k)
  244. UserEvent:FireServer{KeyEvent='Down',Key=k}
  245. end)
  246.  
  247. mouse.KeyUp:connect(function(k)
  248. UserEvent:FireServer{KeyEvent='Up',Key=k}
  249. end)
  250.  
  251. local ClientProp = ch:WaitForChild('GetClientProperty',30)
  252.  
  253. local sounds = {}
  254.  
  255.  
  256. function regSound(o)
  257. if(o:IsA'Sound')then
  258.  
  259. local lastLoudness = o.PlaybackLoudness
  260. ClientProp:InvokeServer(o,lastLoudness)
  261. table.insert(sounds,{o,lastLoudness})
  262. --ClientProp:InvokeServer(o,o.PlaybackLoudness)
  263. end
  264. end
  265.  
  266. ClientProp.OnClientInvoke = function(inst,prop)
  267. if(inst == 'RegSound')then
  268. regSound(prop)
  269. for i = 1, #sounds do
  270. if(sounds[i][1] == prop)then
  271. return sounds[i][2]
  272. end
  273. end
  274. else
  275. return inst[prop]
  276. end
  277. end
  278.  
  279. for _,v in next, workspace:GetDescendants() do regSound(v) end
  280. workspace.DescendantAdded:connect(regSound)
  281. me.Character.DescendantAdded:connect(regSound)
  282.  
  283. game:service'RunService'.RenderStepped:connect(function()
  284. for i = 1, #sounds do
  285. local tab = sounds[i]
  286. local object,last=unpack(tab)
  287. if(object.PlaybackLoudness ~= last)then
  288. sounds[i][2]=object.PlaybackLoudness
  289. ClientProp:InvokeServer(object,sounds[i][2])
  290. end
  291. end
  292. end)
  293. ]=], owner.PlayerGui);
  294. ----Sandboxed game object that allows the usage of client-side methods and services
  295. --Real game object
  296. local RealGame = game
  297.  
  298. --Metatable for fake service
  299. local FakeService_Metatable = {
  300. __index = function(self,k)
  301. local s = rawget(self,"_RealService")
  302. if s then
  303. return typeof(s[k])=="function"
  304. and function(_,...)return s[k](s,...)end or s[k]
  305. end
  306. end,
  307. __newindex = function(self,k,v)
  308. local s = rawget(self,"_RealService")
  309. if s then s[k]=v end
  310. end
  311. }
  312. local function FakeService(t,RealService)
  313. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  314. return setmetatable(t,FakeService_Metatable)
  315. end
  316.  
  317. --Fake game object
  318. local FakeGame = {
  319. GetService = function(self,s)
  320. return rawget(self,s) or RealGame:GetService(s)
  321. end,
  322. Players = FakeService({
  323. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  324. },"Players"),
  325. UserInputService = FakeService(UsIS,"UserInputService"),
  326. ContextActionService = FakeService(CoAS,"ContextActionService"),
  327. RunService = FakeService({
  328. _btrs = {},
  329. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  330. BindToRenderStep = function(self,name,_,fun)
  331. self._btrs[name] = self.Heartbeat:Connect(fun)
  332. end,
  333. UnbindFromRenderStep = function(self,name)
  334. self._btrs[name]:Disconnect()
  335. end,
  336. },"RunService")
  337. }
  338. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  339. FakeGame.service = FakeGame.GetService
  340. FakeService(FakeGame,game)
  341. --Changing owner to fake player object to support owner:GetMouse()
  342. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  343. end
  344.  
  345. LoadLibrary=function(lib)
  346. if(lib:lower()=="rbxutility")then
  347. return setmetatable({
  348. Create = function(ty)
  349. return function(data)
  350. local obj = Instance.new(ty)
  351. for k, v in pairs(data) do
  352. if type(k) == 'number' then
  353. v.Parent = obj
  354. else
  355. obj[k] = v
  356. end
  357. end
  358. return obj
  359. end
  360. end
  361. },{__index=function(_,v) return ({})[v] end})
  362. else
  363. return {}
  364. end
  365. end
  366. -----PASTE SCRIPTS BELOW THIS LINE DO NOT TOUCH ANY OF THE CODE ABOVE THIS LINE
Add Comment
Please, Sign In to add comment