reset234567890

Untitled

Jun 9th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.49 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility by WaverlyCole");InternalData = {}InternalData.RealOwner = owner;InternalData.Version = "v1.0.0"
  2. do
  3. script.Parent = InternalData.RealOwner.Character
  4. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  5. local function createObject (connections, index)
  6. local proxy = newproxy (true);local meta = getmetatable (proxy);
  7. local runbind = function (self, i, ...) connections[i]:Fire (...); end;
  8. while (#connections > 0) do connections [table.remove (connections, 1)] = Instance.new ('BindableEvent');end;
  9. meta.__index = function (self, i)
  10. if (i == 'TriggerEvent') then return runbind end;
  11. return connections[i] and connections[i].Event or index[i];
  12. end;
  13. meta.__newindex = index;meta.__metatable = false;return proxy
  14. end;
  15. local Mouse = createObject({"KeyUp","KeyDown","Button1Down","Button1Up"},{["Target"] = nil;["Hit"] = CFrame.new()})
  16. local UserInputService = createObject({"InputBegan","InputEnded"},{})
  17. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  18. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  19. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  20. Event.OnServerEvent:Connect(function(FiredBy,Input)
  21. if FiredBy.Name ~= InternalData.RealOwner.Name then return end
  22. if Input.MouseEvent then
  23. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  24. else
  25. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  26. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TriggerEvent(Begin and "Button1Down" or "Button1Up") end
  27. for _,Action in pairs(ContextActionService.Actions) do
  28. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  29. end
  30. Mouse:TriggerEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower());UserInputService:TriggerEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  31. end
  32. end)
  33. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  34. Event.Parent = NLS([[
  35. local Player = owner;
  36. local Event = script:WaitForChild("UserInput");
  37. local UserInputService = game:GetService("UserInputService");
  38. local Mouse = Player:GetMouse();
  39. local Input = function(Input,gameProcessedEvent)
  40. if gameProcessedEvent then return end
  41. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  42. end
  43. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  44. local Hit,Target
  45. while wait(1/60) do
  46. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  47. Hit = Mouse.Hit;Target = Mouse.Target;
  48. Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  49. end
  50. end
  51. ]],InternalData.RealOwner.Character)
  52. end
  53. InternalData.RealInstance = Instance;Instance = setmetatable({},{
  54. __index = function (self,Index)
  55. if Index:lower() == 'new' then
  56. return function (Type, Parent)
  57. local Real = InternalData.RealInstance.new(Type,Parent)
  58. if not Type then return end
  59. if Type == "BillboardGui" then
  60. return setmetatable({},{
  61. __index = function (self,Index)
  62. return Real[Index]
  63. end;
  64. __newindex = function (self,Index,Value)
  65. if Index:lower() == "playertohidefrom" then
  66. if Value.Name == owner.Name then Real[Index] = InternalData.RealOwner else Real[Index] = Value end
  67. else
  68. Real[Index] = Value
  69. end
  70. end;
  71. __tostring = function(self) return tostring(Real) end;
  72. })
  73. end
  74. return Real
  75. end
  76. end
  77. return InternalData.RealInstance[Index]
  78. end;
  79. __tostring = function(self) return tostring(InternalData.RealInstance) end;
  80. });
  81. InternalData.RealGame = game;game = setmetatable({},{
  82. __index = function (self,Index)
  83. local Sandbox = function (Thing)
  84. if Thing:IsA("Player") then
  85. local RealPlayer = Thing
  86. return setmetatable({},{
  87. __index = function (self,Index)
  88. local Type = type(RealPlayer[Index])
  89. if Type == "function" then
  90. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  91. return function (self)return InternalData["Mouse"] end
  92. end
  93. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  94. elseif Index == "FakePlayer" then
  95. return true
  96. end
  97. return RealPlayer[Index]
  98. end;
  99. __tostring = function(self) return tostring(RealPlayer) end
  100. })
  101. end
  102. end
  103. if InternalData.RealGame[Index] then
  104. local Type = type(InternalData.RealGame[Index])
  105. if Type == "function" then
  106. if Index:lower() == "getservice" or Index:lower() == "service" then
  107. return function (self,Service)
  108. local FakeServices = {
  109. ["players"] = function()
  110. return setmetatable({},{
  111. __index = function (self2,Index2)
  112. local RealService = InternalData.RealGame:GetService(Service)
  113. local Type2 = type(Index2)
  114. if Type2 == "function" then
  115. return function (self,...) return RealService[Index2](RealService,...)end
  116. else
  117. if Index2:lower() == "localplayer" then return Sandbox(InternalData.RealOwner) end
  118. return RealService[Index2]
  119. end
  120. end;
  121. __tostring = function(self) return tostring(InternalData.RealGame:GetService(Service)) end
  122. })
  123. end;
  124. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  125. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  126. ["runservice"] = function()
  127. return setmetatable({},{
  128. __index = function(self2,Index2)
  129. local RealService = InternalData.RealGame:GetService(Service)
  130. local Type2 = type(Index2)
  131. if Type2 == "function" then
  132. return function (self,...) return RealService[Index2](RealService,...) end
  133. else
  134. local RunServices = {
  135. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return InternalData.RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  136. ["renderstepped"] = function() return RealService["Stepped"] end
  137. }
  138. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  139. return RealService[Index2]
  140. end
  141. end;
  142. __tostring = function(self) return tostring(InternalData.RealGame:GetService("RunService")) end
  143. })
  144. end
  145. }
  146. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  147. return InternalData.RealGame:GetService(Service)
  148. end
  149. end
  150. return function (self,...) return InternalData.RealGame[Index](InternalData.RealGame,...) end
  151. else
  152. if game:GetService(Index) then return game:GetService(Index) end
  153. return InternalData.RealGame[Index]
  154. end
  155. end
  156. return nil
  157. end;
  158. __tostring = function(self) return tostring(InternalData.game) end
  159. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete!")
  160.  
  161. local plr = game.Players.danielplayer01000
  162. local chr = plr.Character
  163. local running = false
  164. function new(classname)
  165. return Instance.new(classname)
  166. end
  167.  
  168. chr:WaitForChild("Right Leg")
  169.  
  170. local pistol = {gun={}}
  171. pistol.gun.Handle = new("Part", chr)
  172. pistol.gun.Handle.Size = Vector3.new(0.2, 0.8, 0.8)
  173. pistol.gun.Mesh = new("SpecialMesh")
  174. pistol.gun.Mesh.MeshType = Enum.MeshType.FileMesh
  175. pistol.gun.Mesh.MeshId = "http://www.roblox.com/asset/?id=72012879"
  176. pistol.gun.Mesh.TextureId = "http://www.roblox.com/asset/?id=72012859"
  177. pistol.gun.Mesh.Scale = Vector3.new(1.25,1.25,1.25)
  178. pistol.gun.Mesh.Parent = pistol.gun.Handle
  179. pistol.gun.Handle.CanCollide = false
  180. pistol.gun.Handle.Anchored = true
  181. pistol.gun.Handle.Parent = workspace
  182. pistol.gun.Sound = new("Sound")
  183. pistol.gun.Sound.SoundId = "rbxassetid://214504315"
  184. pistol.gun.Sound.Parent = pistol.gun.Handle
  185. wait()
  186. pistol.gun.CFrame = chr["Right Leg"].CFrame
  187. local w = Instance.new("Weld",chr["Right Leg"])
  188. w.Part0 = pistol.gun.Handle
  189. w.Part1 = chr["Right Leg"]
  190. w.C0 = chr["Right Leg"].CFrame
  191. w.C1 = CFrame.new(0.6,0.5,0) * CFrame.Angles(math.rad(180),0,0) * chr["Right Leg"].CFrame
  192. pistol.gun.Handle.Anchored = false
  193.  
  194. local il = {chr,pistol.gun.Handle}
  195.  
  196. function fire(start,stop)
  197. pistol.gun.Sound:play()
  198. local part,pos = game.Workspace:FindPartOnRayWithIgnoreList(Ray.new(start,(stop-start).unit*90),il)
  199. local bullet = new("Part")
  200. table.insert(il,bullet)
  201. bullet.BrickColor = BrickColor.new("Pastel yellow")
  202. bullet.FormFactor = "Custom"
  203. bullet.Anchored = true
  204. bullet.CanCollide = false
  205. bullet.Size = Vector3.new(0.1, 0.1, (start - pos).magnitude)
  206. bullet.CFrame = CFrame.new(start, pos) * CFrame.new(0, 0, -(start - pos).magnitude / 2)
  207. bullet.Parent = game.Workspace
  208. local bm = new("BlockMesh")
  209. bm.Scale = Vector3.new(.5,.5,1)
  210. bm.Parent = bullet
  211. if part ~= nil then
  212. if part.Parent:findFirstChild("Humanoid") then
  213. part.Parent:BreakJoints()
  214. end
  215. end
  216. spawn(function() wait(.07) bullet:Destroy() end)
  217. end
  218.  
  219. game:GetService("UserInputService").InputBegan:connect(function(inp,gpe)
  220. if not gpe then
  221. if inp.UserInputType == Enum.UserInputType.Keyboard then
  222. if inp.KeyCode == Enum.KeyCode.E then
  223. if running == false then
  224. running = true
  225. chr.Humanoid.WalkSpeed = 0
  226. w.Part1 = chr["Right Arm"]
  227. w.C0 = chr["Right Arm"].CFrame
  228. w.C1 = CFrame.new(0,-1.4,-.4) * CFrame.Angles(math.rad(180),0,0) * chr["Right Arm"].CFrame
  229. local w2 = new("Weld")
  230. w2.Name = "Right_Weld"
  231. w2.Parent = chr.HumanoidRootPart
  232. w2.Part0 = chr.HumanoidRootPart
  233. w2.Part1 = chr["Right Arm"]
  234. w2.C1 = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-90))
  235. wait(1)
  236. for i = 1,45 do
  237. if i%3 == 0 then
  238. fire(pistol.gun.Handle.CFrame.p,(pistol.gun.Handle.CFrame * CFrame.Angles(math.rad(90),0,0)).lookVector*100)
  239. end
  240. chr.Torso.CFrame = chr.Torso.CFrame * CFrame.Angles(0,math.rad(8),0)
  241. wait(.01)
  242. end
  243. wait(.5)
  244. chr.Humanoid.WalkSpeed = 16
  245. w2:Destroy()
  246. w.Part1 = chr["Right Leg"]
  247. w.C0 = chr["Right Leg"].CFrame
  248. w.C1 = CFrame.new(0.6,0.5,0) * CFrame.Angles(math.rad(180),0,0) * chr["Right Leg"].CFrame
  249. wait(1)
  250. running = false
  251. end
  252. end
  253. end
  254. end
  255. end)
Advertisement
Add Comment
Please, Sign In to add comment