Advertisement
ghostteen14

Untitled

Jun 9th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.88 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. print(time'')
  153. if script then if game.PlaceId~=0 then script.Parent=a end end
  154. waitingFor=function(instance,stuff)
  155. while not instance[stuff]do
  156. instance.Changed:wait''
  157. end
  158. return instance[stuff]
  159. end
  160.  
  161. Removes={'Hat','Pants','Shirt','ShirtGraphic','BodyColors'}
  162.  
  163. WaitingForObjectum=function(instance,p,name)
  164. if p:lower''=='name'then
  165. p='Name'
  166. elseif p:lower''=='class'then
  167. p='ClassName'
  168. end
  169. if p~='ClassName'and p~='Name'then return nil end
  170. while 0 do
  171. for i,v in pairs(instance:children'')do
  172. if v[p]:lower''==name:lower''then
  173. return v
  174. end
  175. end
  176. wait''
  177. end
  178. end
  179.  
  180. GetAll=function(Start)
  181. local AllObj={}
  182. InsertObjectToList=function(obj)
  183. pcall(function()
  184. for lol,child in pairs(obj:children())do
  185. if script~=nil then
  186. if child~=script then
  187. InsertObjectToList(child)
  188. table.insert(AllObj,child)
  189. end
  190. else
  191. InsertObjectToList(child)
  192. table.insert(AllObj,child)
  193. end
  194. end
  195. end)
  196. end
  197. InsertObjectToList(Start)
  198. return AllObj
  199. end
  200.  
  201. X=function(f)
  202. local CreatedFunction=coroutine.create(f)
  203. coroutine.resume(CreatedFunction)
  204. end
  205.  
  206. Rot=CFrame.fromEulerAnglesXYZ
  207.  
  208. Player=game.Players.LocalPlayer
  209.  
  210. Status='None'
  211.  
  212. CreatePart=function(Size,Parent)
  213. local Part=Instance.new'Part'
  214. Part.formFactor=3
  215. Part.BottomSurface=0
  216. Part.TopSurface=0
  217. Part.Size=Size
  218. Part.Parent=Parent
  219. return Part
  220. end
  221. LoadCheck=function(Character)
  222. for i,v in pairs(Character:children'')do
  223. if v.Name=='Black Metal Set'or v:IsA'Hat'then
  224. v:remove''
  225. end
  226. end
  227. local BlackMetalSet=Instance.new'Model'
  228. BlackMetalSet.Name='Black Metal Set'
  229. BlackMetalSet.Parent=Character
  230. end
  231. LoadBlackMetalSetAnimate=function(Character)
  232. local Humanoid=WaitingForObjectum(Character,'class','Humanoid')
  233. Humanoid.Died:connect(onDied)
  234. Humanoid.Running:connect(function()Status='run'end)
  235. Humanoid.Jumping:connect(function()Status='jump'end)
  236. Humanoid.Climbing:connect(function()Status='climb'end)
  237. Humanoid.GettingUp:connect(function()Status='getup'end)
  238. Humanoid.FreeFalling:connect(function()Status='freefall'end)
  239. Humanoid.FallingDown:connect(function()Status='falldown'end)
  240. Humanoid.Seated:connect(function()Status='sit'end)
  241. Humanoid.PlatformStanding:connect(function()Status='stand'end)
  242. end
  243. LoadHeadSet=function(Character)
  244. for i,v in pairs(Head:children'')do
  245. if v.Name=='face'then
  246. v.Texture='rbxassetid://55668987'
  247. end
  248. end
  249. local HeadSet=Instance.new'Model'
  250. HeadSet.Name='Head Set'
  251. HeadSet.Parent=WaitingForObjectum(Character,'Name','Black Metal Set')
  252.  
  253. local Horn=Instance.new'Part'
  254. Horn.formFactor=0
  255. Horn.Size=Vector3.new(1,1,1)
  256. Horn.CFrame=Head.CFrame
  257. Horn.CanCollide=false
  258. Horn.Parent=HeadSet
  259. local HornWeld=Instance.new'Motor'
  260. HornWeld.Parent=Head
  261. HornWeld.Part0=Head
  262. HornWeld.Part1=Horn
  263. HornWeld.C0=Rot(-.3,0,0)+Vector3.new(0,.3,-.2)
  264. local HornMesh=Instance.new'SpecialMesh'
  265. HornMesh.MeshId='http://www.roblox.com/asset/?id=2264333'
  266. HornMesh.TextureId='http://www.roblox.com/asset/?id=2264330'
  267. HornMesh.VertexColor=Vector3.new(.3,0,0)
  268. HornMesh.Scale=Vector3.new(.3,.3,.3)
  269. HornMesh.Parent=Horn
  270.  
  271. local Hood=Instance.new'Part'
  272. Hood.formFactor=0
  273. Hood.Size=Vector3.new(2,2,1)
  274. Hood.CFrame=Head.CFrame
  275. Hood.CanCollide=false
  276. Hood.BrickColor=BrickColor.new'1003'
  277. Hood.Parent=HeadSet
  278. local HoodMesh=Instance.new'SpecialMesh'
  279. HoodMesh.Scale=Vector3.new(1.05,1.05,1.05)
  280. HoodMesh.VertexColor=Vector3.new(.2,0,0)
  281. HoodMesh.MeshId='http://www.roblox.com/asset/?id=16952952'
  282. HoodMesh.TextureId='http://www.roblox.com/asset/?id=34495525'
  283. HoodMesh.Parent=Hood
  284. local HoodWeld=Instance.new'Motor'
  285. HoodWeld.Parent=Head
  286. HoodWeld.Part0=Head
  287. HoodWeld.Part1=Hood
  288. HoodWeld.C0=CFrame.new(0,.25,-.12)
  289.  
  290. local Mask=Instance.new'Part'
  291. Mask.formFactor=3
  292. Mask.Size=Vector3.new(2,.4,1)
  293. Mask.CFrame=Head.CFrame
  294. Mask.CanCollide=false
  295. Mask.BrickColor=BrickColor.new'1003'
  296. Mask.Parent=HeadSet
  297. local MaskMesh=Instance.new'SpecialMesh'
  298. MaskMesh.Scale=Vector3.new(.13,.15,.09)
  299. MaskMesh.MeshId='http://www.roblox.com/asset/?id=5158270'
  300. MaskMesh.TextureId='http://www.roblox.com/asset/?id=43098386'
  301. MaskMesh.Parent=Mask
  302. local MaskWeld=Instance.new'Motor'
  303. MaskWeld.Parent=Head
  304. MaskWeld.Part0=Head
  305. MaskWeld.Part1=Mask
  306. MaskWeld.C0=Rot(-math.rad(100),0,0)+Vector3.new(0,-.08,-.6)
  307. X(function()
  308. while MaskMesh do
  309. for i=1,10 do
  310. MaskMesh.VertexColor=Vector3.new(i/10,0,0)
  311. wait'.1'
  312. end
  313. for i=1,9 do
  314. MaskMesh.VertexColor=Vector3.new(1-i/10,0,0)
  315. wait'.1'
  316. end
  317. end
  318. end)
  319. local Eye1=Instance.new'Part'
  320. Eye1.formFactor=3
  321. Eye1.Size=Vector3.new(1,.4,1)
  322. Eye1.CFrame=Head.CFrame
  323. Eye1.CanCollide=false
  324. Eye1.BrickColor=BrickColor.new'1003'
  325. Eye1.Parent=HeadSet
  326. local Eye1Mesh=Instance.new'SpecialMesh'
  327. Eye1Mesh.Scale=Vector3.new(.8,.7,.5)
  328. Eye1Mesh.MeshId='http://www.roblox.com/asset/?id=1185246'
  329. Eye1Mesh.TextureId='http://www.roblox.com/asset/?id=32763014'
  330. Eye1Mesh.Parent=Eye1
  331. local Eye1Weld=Instance.new'Motor'
  332. Eye1Weld.Parent=Head
  333. Eye1Weld.Part0=Head
  334. Eye1Weld.Part1=Eye1
  335. Eye1Weld.C0=CFrame.new(.2,0,-.5)
  336. local Eye2=Instance.new'Part'
  337. Eye2.formFactor=3
  338. Eye2.Size=Vector3.new(1,.4,1)
  339. Eye2.CFrame=Head.CFrame
  340. Eye2.CanCollide=false
  341. Eye2.BrickColor=BrickColor.new'1003'
  342. Eye2.Parent=HeadSet
  343. local Eye2Mesh=Instance.new'SpecialMesh'
  344. Eye2Mesh.Scale=Vector3.new(.8,.7,.5)
  345. Eye2Mesh.MeshId='http://www.roblox.com/asset/?id=1185246'
  346. Eye2Mesh.TextureId='http://www.roblox.com/asset/?id=32763014'
  347. Eye2Mesh.Parent=Eye2
  348. local Eye2Weld=Instance.new'Motor'
  349. Eye2Weld.Parent=Head
  350. Eye2Weld.Part0=Head
  351. Eye2Weld.Part1=Eye2
  352. Eye2Weld.C0=CFrame.new(-.2,0,-.5)
  353. X(function()
  354. while 0 do
  355. wait(math.random(1,11))
  356. if Eye1Mesh then
  357. Eye1Mesh.VertexColor=Vector3.new(0,0,0)
  358. end
  359. if Eye2Mesh then
  360. Eye2Mesh.VertexColor=Vector3.new(0,0,0)
  361. end
  362. wait(math.random(1,5)/50)
  363. if Eye1Mesh then
  364. Eye1Mesh.VertexColor=Vector3.new(1,0,0)
  365. end
  366. if Eye2Mesh then
  367. Eye2Mesh.VertexColor=Vector3.new(1,0,0)
  368. end
  369. end
  370. end)
  371. end
  372. LoadArmSet=function(Character)
  373. wait'.2'
  374. local RS,LR,RightArm,LeftArm
  375. --RS=waitingFor(Torso,'Right Shoulder')
  376. --LS=waitingFor(Torso,'Left Shoulder')
  377. RightArm=WaitingForObjectum(Character,'Name','Right Arm')
  378. LeftArm=WaitingForObjectum(Character,'Name','Left Arm')
  379.  
  380. RightArm.BrickColor=BrickColor.new'1003'
  381. LeftArm.BrickColor=BrickColor.new'1003'
  382.  
  383. local ArmSet=Instance.new'Model'
  384. ArmSet.Name='Arm Set'
  385. ArmSet.Parent=WaitingForObjectum(Character,'name','Black Metal Set')
  386.  
  387. local RightArmArmor=Instance.new'CharacterMesh'
  388. RightArmArmor.Name='Black Metal Set'
  389. RightArmArmor.MeshId='33308774'
  390. RightArmArmor.BaseTextureId='50903886'
  391. RightArmArmor.OverlayTextureId='48610054'
  392. RightArmArmor.BodyPart='RightArm'
  393. RightArmArmor.Parent=Character
  394. local LeftArmArmor=Instance.new'CharacterMesh'
  395. LeftArmArmor.Name='Black Metal Set'
  396. LeftArmArmor.MeshId='33308496'
  397. LeftArmArmor.BaseTextureId='50903886'
  398. LeftArmArmor.OverlayTextureId='48610054'
  399. LeftArmArmor.BodyPart='LeftArm'
  400. LeftArmArmor.Parent=Character
  401. end
  402. LoadTorsoSet=function(Character,Stuff)
  403. for i,v in pairs(Character:children'')do
  404. if v:IsA'Pants'or v:IsA'Shirt'or v:IsA'ShirtGraphic'then
  405. v:remove''
  406. end
  407. if v:IsA'BasePart'then
  408. v.BrickColor=BrickColor.new'1003'
  409. end
  410. end
  411. for i,v in pairs(Torso:children'')do
  412. if v:IsA'Decal'then
  413. v:remove''
  414. end
  415. end
  416.  
  417. local TorsoSet=Instance.new'Model'
  418. TorsoSet.Name='Torso Set'
  419. TorsoSet.Parent=WaitingForObjectum(Character,'Name','Black Metal Set')
  420.  
  421. if Stuff:lower''=='cape'then
  422. local Cape=Instance.new'Part'
  423. Cape.formFactor=0
  424. Cape.Size=Vector3.new(1,1,1)
  425. Cape.CFrame=Torso.CFrame
  426. Cape.BrickColor=BrickColor.new'1003'
  427. Cape.Parent=TorsoSet
  428. local CapeMesh=Instance.new'SpecialMesh'
  429. CapeMesh.MeshId='http://www.roblox.com/asset/?id=57480731'
  430. CapeMesh.TextureId='rbxassetid://59662291'
  431. CapeMesh.Scale=Vector3.new(1.3,2.1,1)
  432. CapeMesh.Parent=Cape
  433. local CapeWeld=Instance.new'Motor'
  434. CapeWeld.Parent=Torso
  435. CapeWeld.Part0=Torso
  436. CapeWeld.Part1=Cape
  437. CapeWeld.C1=Rot(math.rad(90),math.rad(90),0)+Vector3.new(0,1.2,-.2)
  438. CapeWeld.C0=Rot(math.rad(90),math.rad(90),0)+Vector3.new(0,.4,.1)
  439. CapeWeld.MaxVelocity=.3
  440. CapeWeld.DesiredAngle=-.3
  441. X(function()
  442. while CapeWeld do
  443. wait''
  444. if Status=='run'then
  445. CapeWeld.MaxVelocity=.3
  446. CapeWeld.DesiredAngle=-.3
  447. elseif Status=='stand'then
  448. CapeWeld.MaxVelocity=.3
  449. CapeWeld.DesiredAngle=0
  450. end
  451. end
  452. end)
  453. elseif Stuff:lower''=='wings'then
  454. end
  455. end
  456. ReLoad=function(Character)
  457. Character=waitingFor(Player,'Character')
  458.  
  459. Head=WaitingForObjectum(Character,'Name','Head')
  460.  
  461. Torso=WaitingForObjectum(Character,'Name','Torso')
  462.  
  463. Character.ChildAdded:connect(function(Child)
  464. for i,v in pairs(Removes)do
  465. if Child:IsA(v)then
  466. Child:remove''
  467. end
  468. end
  469. end)
  470.  
  471. for ii,Child in pairs(Character:children'')do
  472. for i,v in pairs(Removes)do
  473. if Child:IsA(v)then
  474. Child:remove''
  475. end
  476. end
  477. X(function()
  478. if not Child:IsA'BasePart'then return end
  479. Child.BrickColor=BrickColor.new'1003'
  480. Child.Changed:connect(function()
  481. Child.BrickColor=BrickColor.new'1003'
  482. end)
  483. end)
  484. end
  485.  
  486. Head.Transparency=1
  487.  
  488. LoadCheck(Character)
  489. LoadHeadSet(Character)
  490. LoadTorsoSet(Character,'cape')
  491. LoadArmSet(Character)
  492. LoadBlackMetalSetAnimate(Character)
  493. end
  494.  
  495. Player.CharacterAdded:connect(ReLoad)
  496.  
  497. ReLoad(waitingFor(Player,'Character'))
  498.  
  499. print(time'')
  500.  
  501. --lego
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement