Advertisement
DarkScriptZEditors

Untitled

Jan 9th, 2019
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.91 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  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. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. --By Rufus14
  137. --ears: 391268255
  138. --bamalam: 720451528
  139. --columb: 1202637744
  140. --[[music = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  141. music.Volume = 10
  142. music.SoundId = "rbxassetid://1202637744"
  143. music.Looped = true
  144. music:Play()]]
  145. mouse = game.Players.LocalPlayer:GetMouse()
  146. gun = Instance.new("Part", game.Players.LocalPlayer.Character)
  147. gun:BreakJoints()
  148. gun.CanCollide = false
  149. gun.Name = "Shotgun"
  150. mesh = Instance.new("SpecialMesh", gun)
  151. mesh.MeshId = "rbxassetid://477037714"
  152. mesh.TextureId = "rbxassetid://477037796"
  153. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  154. weld = Instance.new("Weld", gun)
  155. weld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  156. weld.Part1 = gun
  157. weld.C0 = weld.C0 * CFrame.Angles(-1.5,0,0) * CFrame.new(0,0,-2.5)
  158. local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  159. rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  160. rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  161. rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  162. local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  163. lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  164. lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
  165. lhandweld.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  166. shot = Instance.new("Sound", gun)
  167. shot.Volume = 10
  168. shot.SoundId = "rbxassetid://185044507"
  169. pump = Instance.new("Sound", gun)
  170. pump.Volume = 10
  171. pump.SoundId = "rbxassetid://255061173"
  172. pump.PlaybackSpeed = 0.7
  173. --[[function owtheedge()
  174. workspace.CurrentCamera.FieldOfView = 70 + music.PlaybackLoudness / 80
  175. end
  176. game:GetService("RunService").RenderStepped:connect(owtheedge)]]
  177. for i = 0,0.7 , 0.01 do
  178. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  179. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.399175882, -0.578536987, 0.978147507, 0.204753578, -0.0361040607, -0.0289359875, -0.0378959738, -0.998862624, -0.205888897, 0.978079677, -0.0311431047),i)
  180. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.472423553, 0.409558296, -1.4746933, 0.939692736, -0.342019886, -2.0985492e-06, 0.0238559935, 0.0655499771, -0.997564137, 0.341186911, 0.937403619, 0.0697560608),i)
  181. game:GetService("RunService").RenderStepped:wait()
  182. end
  183. using = false
  184. ammo = 5
  185. function shoot()
  186. if not using then
  187. using = true
  188. shot:Play()
  189. for i = 1,5 do
  190. local missle = Instance.new("Part", workspace)
  191. missle:BreakJoints()
  192. missle.Name = "bullet"
  193. missle.BrickColor = BrickColor.Yellow()
  194. missle.CanCollide = false
  195. missle.Material = "Neon"
  196. missle.Size = Vector3.new(0.1,0.1,0.1)
  197. missle.CFrame = gun.CFrame * CFrame.new(0,0,2)
  198. missle.Transparency = 0
  199. local vel = Instance.new("BodyVelocity", missle)
  200. vel.Velocity = mouse.Hit.lookVector * math.random(500,500) + Vector3.new(math.random(-20,20),math.random(-20,20),0)
  201. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  202. local function hit(part)
  203. local hitval = math.random(99,99)
  204. local humanoid = part.Parent:findFirstChildOfClass("Humanoid")
  205. if humanoid then
  206. if humanoid.Health == math.huge or humanoid.Health >= 600 then
  207. humanoid.Health = 100
  208. end
  209. if humanoid.MaxHealth == math.huge or humanoid.MaxHealth >= 600 then
  210. humanoid.MaxHealth = 100
  211. end
  212. if humanoid.Parent.Name == game.Players.LocalPlayer.Name then
  213.  
  214. else
  215. if humanoid.Health < hitval then
  216. humanoid.JumpPower = 0
  217. humanoid.PlatformStand = true
  218. humanoid.WalkSpeed = 0
  219. local findlefthip = humanoid.Parent.Torso:findFirstChild("Left Hip")
  220. if findlefthip then
  221. findlefthip:Remove()
  222. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  223. glue.Part0 = humanoid.Parent.Torso
  224. glue.Part1 = humanoid.Parent["Left Leg"]
  225. glue.Name = "Left leg"
  226. local collider = Instance.new("Part", humanoid.Parent["Left Leg"])
  227. collider.Position = Vector3.new(0,999,0)
  228. collider.Size = Vector3.new(1.5, 1, 1)
  229. collider.Shape = "Cylinder"
  230. local weld = Instance.new("Weld", collider)
  231. weld.Part0 = humanoid.Parent["Left Leg"]
  232. weld.Part1 = collider
  233. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  234. collider.TopSurface = "Smooth"
  235. collider.BottomSurface = "Smooth"
  236. collider.formFactor = "Symmetric"
  237. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  238. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  239. collider.Transparency = 1
  240. end
  241. --
  242. local findrighthip = humanoid.Parent.Torso:findFirstChild("Right Hip")
  243. if findrighthip then
  244. findrighthip:Remove()
  245. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  246. glue.Part0 = humanoid.Parent.Torso
  247. glue.Part1 = humanoid.Parent["Right Leg"]
  248. glue.Name = "Right leg"
  249. local collider = Instance.new("Part", humanoid.Parent["Right Leg"])
  250. collider.Position = Vector3.new(0,999,0)
  251. collider.Size = Vector3.new(1.5, 1, 1)
  252. collider.Shape = "Cylinder"
  253. local weld = Instance.new("Weld", collider)
  254. weld.Part0 = humanoid.Parent["Right Leg"]
  255. weld.Part1 = collider
  256. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  257. collider.TopSurface = "Smooth"
  258. collider.BottomSurface = "Smooth"
  259. collider.formFactor = "Symmetric"
  260. glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  261. glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  262. collider.Transparency = 1
  263. end
  264. --
  265. local findrightshoulder = humanoid.Parent.Torso:findFirstChild("Right Shoulder")
  266. if findrightshoulder then
  267. findrightshoulder:Remove()
  268. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  269. glue.Part0 = humanoid.Parent.Torso
  270. glue.Part1 = humanoid.Parent["Right Arm"]
  271. glue.Name = "Right arm"
  272. local collider = Instance.new("Part", humanoid.Parent["Right Arm"])
  273. collider.Position = Vector3.new(0,999,0)
  274. collider.Size = Vector3.new(1.5, 1, 1)
  275. collider.Shape = "Cylinder"
  276. local weld = Instance.new("Weld", collider)
  277. weld.Part0 = humanoid.Parent["Right Arm"]
  278. weld.Part1 = collider
  279. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  280. collider.TopSurface = "Smooth"
  281. collider.BottomSurface = "Smooth"
  282. collider.formFactor = "Symmetric"
  283. glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  284. glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  285. collider.Transparency = 1
  286. end
  287. --
  288. local findleftshoulder = humanoid.Parent.Torso:findFirstChild("Left Shoulder")
  289. if findleftshoulder then
  290. findleftshoulder:Remove()
  291. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  292. glue.Part0 = humanoid.Parent.Torso
  293. glue.Part1 = humanoid.Parent["Left Arm"]
  294. glue.Name = "Left arm"
  295. local collider = Instance.new("Part", humanoid.Parent["Left Arm"])
  296. collider.Position = Vector3.new(0,999,0)
  297. collider.Size = Vector3.new(1.5, 1, 1)
  298. collider.Shape = "Cylinder"
  299. local weld = Instance.new("Weld", collider)
  300. weld.Part0 = humanoid.Parent["Left Arm"]
  301. weld.Part1 = collider
  302. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  303. collider.TopSurface = "Smooth"
  304. collider.BottomSurface = "Smooth"
  305. collider.formFactor = "Symmetric"
  306. glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  307. glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  308. collider.Transparency = 1
  309. end
  310. local findhead = humanoid.Parent:findFirstChild("Head")
  311. if findhead then
  312. local attachment = Instance.new("Attachment", humanoid.Parent.Head)
  313. attachment.Position = Vector3.new(0, -0.5, 0)
  314. attachment.Name = "lol"
  315. attachment.Visible = false
  316. humanoid.Parent.Torso.NeckAttachment.Visible = false
  317. humanoid.Parent.Torso.NeckAttachment.Position = humanoid.Parent.Torso.NeckAttachment.Position + Vector3.new(0,0,0)
  318. local ball = Instance.new("BallSocketConstraint", humanoid.Parent)
  319. ball.Attachment0 = humanoid.Parent.Torso.NeckAttachment
  320. ball.Attachment1 = attachment
  321. ball.LimitsEnabled = true
  322. ball.TwistLimitsEnabled = true
  323. ball.UpperAngle = 90
  324. ball.Restitution = 0.5
  325. ball.TwistUpperAngle = 90
  326. ball.TwistLowerAngle = -90
  327. local collidepartofleftleg = Instance.new("Part", humanoid.Parent.Torso)
  328. collidepartofleftleg.Name = "Bone"
  329. collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7)
  330. collidepartofleftleg.Transparency = 1
  331. collidepartofleftleg:BreakJoints()
  332. local weeld = Instance.new("Weld", collidepartofleftleg)
  333. weeld.Part0 = collidepartofleftleg
  334. weeld.Part1 = humanoid.Parent["Head"]
  335. if humanoid.Parent.Torso:findFirstChild("Neck") then
  336. humanoid.Parent.Torso.Neck:destroy()
  337. end
  338. end
  339. wait(10)
  340. humanoid.Health = 0
  341. else
  342. humanoid.Health = humanoid.Health - hitval
  343. end
  344. end
  345. else
  346. if part.Name == "Shotgun" or "bullet" then
  347.  
  348. else
  349. missle:destroy()
  350. end
  351. end
  352. end
  353. missle.Touched:connect(hit)
  354. end
  355. for i = 0,1 , 0.07 do
  356. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  357. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  358. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.472423553, 0.748803854, -1.02752113, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  359. game:GetService("RunService").RenderStepped:wait()
  360. end
  361. for i = 0,1 , 0.05 do
  362. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  363. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  364. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.201648712, 0.903478384, -1.75520706, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  365. game:GetService("RunService").RenderStepped:wait()
  366. end
  367. pump:Play()
  368. for i = 0,1 , 0.05 do
  369. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  370. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  371. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.44393158, 0.765078783, -1.10408783, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  372. game:GetService("RunService").RenderStepped:wait()
  373. end
  374. for i = 0,1 , 0.05 do
  375. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  376. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  377. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.201648712, 0.903478384, -1.75520706, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  378. game:GetService("RunService").RenderStepped:wait()
  379. end
  380. for i = 0,0.7 , 0.04 do
  381. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  382. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.399175882, -0.578536987, 0.978147507, 0.204753578, -0.0361040607, -0.0289359875, -0.0378959738, -0.998862624, -0.205888897, 0.978079677, -0.0311431047),i)
  383. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.472423553, 0.409558296, -1.4746933, 0.939692736, -0.342019886, -2.0985492e-06, 0.0238559935, 0.0655499771, -0.997564137, 0.341186911, 0.937403619, 0.0697560608),i)
  384. game:GetService("RunService").RenderStepped:wait()
  385. end
  386. using = false
  387. end
  388. end
  389. mouse.Button1Down:connect(shoot)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement