Advertisement
13242

Untitled

Dec 17th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.69 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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. wait(0)
  8. local Parts = {
  9. game.Players.LocalPlayer.Character.Torso
  10. }
  11. local w = {}
  12. for i = 2, 24 do
  13. Parts[i] = Instance.new("Part", game.Players.LocalPlayer.Character)
  14. Parts[i].BrickColor = BrickColor.Black()
  15. Parts[i].Material = "Granite"
  16. Parts[i].CanCollide = false
  17. Parts[i].Locked = false
  18. Parts[i].formFactor = "Symmetric"
  19. Parts[i].Size = Vector3.new(1.5, 3, 3)
  20. function onTouched(part)
  21. local h = Parts[i].Parent:findFirstChild("Humanoid")
  22. if h ~= nil then
  23. h.Health = h.Health - 0
  24. wait(0)
  25. end
  26. end
  27. Parts[i].Touched:connect(onTouched)
  28. Mesh = Instance.new("BlockMesh", Parts[i])
  29. Mesh.Name = "Mesh"
  30. if i > 75 then
  31. mult = (i - 25) / 1
  32. else
  33. mult = 0
  34. end
  35. Mesh.Scale = Vector3.new(math.abs(0.5 - (i - 0) / 50) + 0 + mult, 0.3 - (i - 0.15) / 69, 0.6)
  36. w[i - 1] = Instance.new("Weld", Parts[i])
  37. w[i - 1].Part0 = Parts[i - 1]
  38. w[i - 1].Part1 = Parts[i]
  39. w[i - 1].C0 = CFrame.new(0, 0, 0.75)
  40. w[i - 1].C1 = CFrame.new(0, 0, -0.75)
  41. end
  42. w[1].C0 = CFrame.new(0, -0.35, 0)
  43. function Smooth(WhereTo0, Welds)
  44. local CR0 = CFrame.new(Welds[1].C1:toEulerAnglesXYZ()).p
  45. local CR1 = CFrame.new(WhereTo0).p
  46. local AddTo0 = (CR1 - CR0) / 6.9
  47. for a = 1, #Welds do
  48. Welds[a].C1 = Welds[a].C1 * CFrame.fromEulerAnglesXYZ(AddTo0.x, AddTo0.y, AddTo0.z)
  49. end
  50. end
  51. local scr = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
  52. local absx = scr.AbsoluteSize.X
  53. local absy = scr.AbsoluteSize.Y
  54. scr:Destroy()
  55. local mouse = game.Players.LocalPlayer:GetMouse()
  56. game:GetService("RunService").RenderStepped:connect(function()
  57. local r = CFrame.new(Vector3.new((mouse.Y - absy / 2) / absy, (mouse.X - absx / 2) / absx, 0.025)).p
  58. local y = r.y
  59. local x = r.x
  60. local z = r.z
  61. Smooth(Vector3.new(y, x, -z), w)
  62. end)
  63. wait(0)
  64. local Parts = {
  65. game.Players.LocalPlayer.Character.Torso
  66. }
  67. local w = {}
  68. for i = 2, 24 do
  69. Parts[i] = Instance.new("Part", game.Players.LocalPlayer.Character)
  70. Parts[i].BrickColor = BrickColor.Black()
  71. Parts[i].Material = "Granite"
  72. Parts[i].CanCollide = false
  73. Parts[i].Locked = false
  74. Parts[i].formFactor = "Symmetric"
  75. Parts[i].Size = Vector3.new(1.1, 0.9, 2.5)
  76. function onTouched(part)
  77. local h = Parts[i].Parent:findFirstChild("Humanoid")
  78. if h ~= nil then
  79. h.Health = h.Health - 0
  80. wait(0)
  81. end
  82. end
  83. Parts[i].Touched:connect(onTouched)
  84. Mesh = Instance.new("BlockMesh", Parts[i])
  85. Mesh.Name = "Mesh"
  86. if i > 75 then
  87. mult = (i - 25) / 1
  88. else
  89. mult = 0
  90. end
  91. Mesh.Scale = Vector3.new(math.abs(0.5 - (i - 0) / 50) + 0 + mult, 0.3 - (i - 0.15) / 99, 0.6)
  92. w[i - 1] = Instance.new("Weld", Parts[i])
  93. w[i - 1].Part0 = Parts[i - 1]
  94. w[i - 1].Part1 = Parts[i]
  95. w[i - 1].C0 = CFrame.new(0, 0, 0.69)
  96. w[i - 1].C1 = CFrame.new(0, 0, -0.69)
  97. end
  98. w[1].C0 = CFrame.new(0, -0.35, 0)
  99. function Smooth(WhereTo0, Welds)
  100. local CR0 = CFrame.new(Welds[1].C1:toEulerAnglesXYZ()).p
  101. local CR1 = CFrame.new(WhereTo0).p
  102. local AddTo0 = (CR1 - CR0) / 6.9
  103. for a = 1, #Welds do
  104. Welds[a].C1 = Welds[a].C1 * CFrame.fromEulerAnglesXYZ(AddTo0.x, AddTo0.y, AddTo0.z)
  105. end
  106. end
  107. local scr = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
  108. local absx = scr.AbsoluteSize.X
  109. local absy = scr.AbsoluteSize.Y
  110. scr:Destroy()
  111. local mouse = game.Players.LocalPlayer:GetMouse()
  112. game:GetService("RunService").RenderStepped:connect(function()
  113. local r = CFrame.new(Vector3.new((mouse.Y - absy / 2) / absy, (mouse.X - absx / 2) / absx, 0.025)).p
  114. local y = r.y
  115. local x = r.x
  116. local z = r.z
  117. Smooth(Vector3.new(y, x, -z), w)
  118. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement