Advertisement
lafur

Untitled

Sep 9th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.81 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 --------AgentVK is a dick-----
  6. wait(1) --For running in rbx studio
  7. mee = game.Players.LocalPlayer
  8. pistol = Instance.new("Tool", mee.Backpack)
  9. pistol.GripForward = Vector3.new(-0.149, 0.984, -0.099)
  10. pistol.GripPos = Vector3.new(0.1, -0.55, -0.2)
  11. pistol.GripRight = Vector3.new(0.989, 0.148, -0.015)
  12. pistol.GripUp = Vector3.new(0, 0.1, 0.995)
  13. pistol.ToolTip = "Umm... where did you get that?"
  14. pistol.Name = "Pistol"
  15. pistolpart = Instance.new("Part", pistol)
  16. pistolpart.Name = "Handle"
  17. pistolpart.BrickColor = BrickColor.new("Black")
  18. pistolpart.Material = "SmoothPlastic"
  19. pistolpart.Orientation = Vector3.new(-88.99, 152.78, 135.7)
  20. pistolpart.Size = Vector3.new(0.2, 1.12, 0.6)
  21. pistolmesh = Instance.new("SpecialMesh", pistolpart)
  22. pistolmesh.MeshId = "rbxassetid://430060386"
  23. pistolmesh.Scale = Vector3.new(1.7, 1.7, 1.7)
  24. pistolmesh.TextureId = "rbxassetid://430060404"
  25. pistolmesh.VertexColor = Vector3.new(2, 2, 2)
  26. gunshotsound = Instance.new("Sound", pistolpart)
  27. gunshotsound.SoundId = "rbxassetid://213603013"
  28. mouserotatecharacter = true
  29.  
  30.  
  31. pistol.Equipped:connect(function(mouse)
  32. mouserotatecharacter = true
  33. local torso = mee.Character.HumanoidRootPart
  34. local mouseturning = mee:GetMouse()
  35. mee.Character.Humanoid.AutoRotate = false
  36. mouseturning.Move:connect(function()
  37. if mouserotatecharacter == true then
  38. torso.CFrame = CFrame.new(torso.Position, mouseturning.Hit.p*Vector3.new(1,0,1) + torso.Position*Vector3.new(0, 1, 0))
  39.  
  40. end
  41. end)
  42. mouse.Button1Down:connect(function()
  43. gunshotsound:Play()
  44. MakeShell()
  45. local ray = Ray.new(pistol.Handle.CFrame.p, (mouse.Hit.p - pistol.Handle.CFrame.p).unit * 300)
  46. local part, position = workspace:FindPartOnRay(ray, mee.Character, false, true)
  47.  
  48. local beam = Instance.new("Part", workspace)
  49. beam.BrickColor = BrickColor.new("White")
  50. beam.FormFactor = "Custom"
  51. beam.Material = "Neon"
  52. beam.Transparency = 0.7
  53. beam.Anchored = true
  54. beam.Locked = true
  55. beam.CanCollide = false
  56.  
  57. local distance = (pistol.Handle.CFrame.p - position).magnitude
  58. beam.Size = Vector3.new(0.3, 0.3, distance)
  59. beam.CFrame = CFrame.new(pistol.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  60.  
  61. game:GetService("Debris"):AddItem(beam, 0.1)
  62.  
  63. if part then
  64. local humanoid = part.Parent:FindFirstChild("Humanoid")
  65.  
  66. if not humanoid then
  67. humanoid = part.Parent.Parent:FindFirstChild("Humanoid")
  68. end
  69.  
  70. if humanoid then
  71. plrmodel = humanoid.Parent
  72. if plrmodel.Humanoid.Health ~= 0 then
  73. --blood
  74. plrmodel.Archivable = true
  75. local Char = plrmodel
  76. local Hum = Char:FindFirstChild("Humanoid")
  77. local Tor = Char:FindFirstChild("Torso") or Char:FindFirstChild("UpperTorso")
  78. local Health = Hum.Health
  79.  
  80. local M = math.random
  81. local R = math.rad
  82. local rates = {.05, .075, .1, .15}
  83.  
  84. local smooth = function(P)
  85. local SM = Enum.SurfaceType.SmoothNoOutlines
  86. P.TopSurface = SM
  87. P.BottomSurface = SM
  88. P.RightSurface = SM
  89. P.LeftSurface = SM
  90. P.FrontSurface = SM
  91. P.BackSurface = SM
  92. end
  93.  
  94. local function BloodPool(Part,Size)
  95. local Pool = Instance.new("Part",game.Workspace)
  96. Pool.TopSurface = 0
  97. Pool.CanCollide = false
  98. Pool.BrickColor = BrickColor.new("Crimson")
  99. Pool.Transparency = 0
  100. Instance.new("CylinderMesh",Pool)
  101. Pool.Anchored = true
  102. Pool.Name = "BloodPoolPart"
  103. smooth(Pool)
  104. Pool.FormFactor = Enum.FormFactor.Custom
  105. Pool.Size = Size
  106. local c = Part.CFrame*CFrame.new(M(-3.01,3.01),-2.9,M(-3.01,3.01))
  107. coroutine.resume(coroutine.create(function()
  108. local rate = rates[M(1,#rates)]
  109. game.Debris:AddItem(Pool,15)
  110. for i = 1,M(25,70) do
  111. wait()
  112. Pool.CFrame = c
  113. Pool.Size = Pool.Size+Vector3.new(rate,0,rate)
  114. end
  115. wait(5)
  116. Pool:Destroy()
  117. end))
  118. end
  119.  
  120. local function BloodDrops(Size,Area)
  121. local Blood = Instance.new("Part",game.Workspace)
  122. Blood.BrickColor = BrickColor.new("Crimson")
  123. Blood.Parent = plrmodel
  124. Blood.TopSurface = 0
  125. Blood.CanCollide = false
  126. Blood.Anchored = false
  127. Blood.FormFactor = Enum.FormFactor.Custom
  128. Blood.Size = Size
  129. Blood.CFrame = Area*CFrame.new(M(-1.00,1.00),M(-1.00,1.00),M(-1.00,1.00))
  130. return Blood
  131. end
  132.  
  133.  
  134.  
  135. Hum.Changed:connect(function()
  136. if Hum.Health < Health then
  137.  
  138. Health = Hum.Health
  139. for i = 1, math.random(4,10)do
  140. local Size = Vector3.new(M(-0.25,0.25),.2,M(-.25,.25))
  141. local Blood = BloodDrops(Size,Tor.CFrame)
  142. local Stopper = false
  143. local Size2 = Vector3.new(M(-0.25,0.25),.2,M(-.25,.25))
  144. BloodPool(Tor,Size2)
  145. end
  146. end
  147. end)
  148. end
  149. --Ragdoll
  150. wait()
  151. function getAttachment0(attachmentName)
  152. for _,child in next,plrmodel:GetChildren() do
  153. local attachment = child:FindFirstChild(attachmentName)
  154. if attachment then
  155. return attachment
  156. end
  157. end
  158. end
  159. plrmodel.Humanoid.Died:Connect(function(var)
  160. local removeHRP = true
  161. local head = plrmodel["Head"]
  162. local leftarm = plrmodel["Left Arm"]
  163. local leftleg = plrmodel["Left Leg"]
  164. local rightleg = plrmodel["Right Leg"]
  165. local rightarm = plrmodel["Right Arm"]
  166. local torso = plrmodel.Torso
  167. local root = plrmodel.HumanoidRootPart
  168. if removeHRP == true then
  169. root:Destroy()
  170. end
  171. local rootA =Instance.new("Attachment")
  172. local HeadA = Instance.new("Attachment")
  173. local LeftArmA = Instance.new("Attachment")
  174. local LeftLegA = Instance.new("Attachment")
  175. local RightArmA = Instance.new("Attachment")
  176. local RightLegA = Instance.new("Attachment")
  177. local TorsoA = Instance.new("Attachment")
  178. local TorsoA1 = Instance.new("Attachment")
  179. local TorsoA2 = Instance.new("Attachment")
  180. local TorsoA3 = Instance.new("Attachment")
  181. local TorsoA4 = Instance.new("Attachment")
  182. local TorsoA5 = Instance.new("Attachment")
  183. local function set1()
  184. HeadA.Name = "HeadA"
  185. HeadA.Parent = head
  186. HeadA.Position = Vector3.new(0, -0.5, 0)
  187. HeadA.Rotation = Vector3.new(0, 0, 0)
  188. HeadA.Axis = Vector3.new(1, 0, 0)
  189. HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
  190. LeftArmA.Name = "LeftArmA"
  191. LeftArmA.Parent = leftarm
  192. LeftArmA.Position = Vector3.new(0.5, 1, 0)
  193. LeftArmA.Rotation = Vector3.new(0, 0, 0)
  194. LeftArmA.Axis = Vector3.new(1, 0, 0)
  195. LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)
  196. LeftLegA.Name = "LeftLegA"
  197. LeftLegA.Parent = leftleg
  198. LeftLegA.Position = Vector3.new(0, 1, 0)
  199. LeftLegA.Rotation = Vector3.new(0, 0, 0)
  200. LeftLegA.Axis = Vector3.new(1, 0, 0)
  201. LeftLegA.SecondaryAxis = Vector3.new(0, 1, 0)
  202. RightArmA.Name = "RightArmA"
  203. RightArmA.Parent = rightarm
  204. RightArmA.Position = Vector3.new(-0.5, 1, 0)
  205. RightArmA.Rotation = Vector3.new(0, 0, 0)
  206. RightArmA.Axis = Vector3.new(1, 0, 0)
  207. RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)
  208. RightLegA.Name = "RightLegA"
  209. RightLegA.Parent = rightleg
  210. RightLegA.Position = Vector3.new(0, 1, 0)
  211. RightLegA.Rotation = Vector3.new(0, 0, 0)
  212. RightLegA.Axis = Vector3.new(1, 0, 0)
  213. RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)
  214. rootA.Name= "rootA"
  215. rootA.Parent = root
  216. rootA.Position = Vector3.new(0, 0, 0)
  217. rootA.Rotation = Vector3.new(0, 90, 0)
  218. rootA.Axis = Vector3.new(0, 0, -1)
  219. rootA.SecondaryAxis = Vector3.new(0, 1, 0)
  220. end
  221. local function set2()
  222. TorsoA.Name = "TorsoA"
  223. TorsoA.Parent = torso
  224. TorsoA.Position = Vector3.new(0.5, -1, 0)
  225. TorsoA.Rotation = Vector3.new(0, 0, 0)
  226. TorsoA.Axis = Vector3.new(1, 0, 0)
  227. TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)
  228. TorsoA1.Name = "TorsoA1"
  229. TorsoA1.Parent = torso
  230. TorsoA1.Position = Vector3.new(-0.5, -1, 0)
  231. TorsoA1.Rotation = Vector3.new(0, 0, 0)
  232. TorsoA1.Axis = Vector3.new(1, 0, 0)
  233. TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)
  234. TorsoA2.Name = "TorsoA2"
  235. TorsoA2.Parent = torso
  236. TorsoA2.Position = Vector3.new(-1, 1, 0)
  237. TorsoA2.Rotation = Vector3.new(0, 0, 0)
  238. TorsoA2.Axis = Vector3.new(1, 0, 0)
  239. TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)
  240. TorsoA3.Name = "TorsoA3"
  241. TorsoA3.Parent = torso
  242. TorsoA3.Position = Vector3.new(1, 1, 0)
  243. TorsoA3.Rotation = Vector3.new(0, 0, 0)
  244. TorsoA3.Axis = Vector3.new(1, 0, 0)
  245. TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)
  246. TorsoA4.Name = "TorsoA4"
  247. TorsoA4.Parent = torso
  248. TorsoA4.Position = Vector3.new(0, 1, 0)
  249. TorsoA4.Rotation = Vector3.new(0, 0, 0)
  250. TorsoA4.Axis = Vector3.new(1, 0, 0)
  251. TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
  252. TorsoA5.Name = "TorsoA5"
  253. TorsoA5.Parent = torso
  254. TorsoA5.Position = Vector3.new(0, 0, 0)
  255. TorsoA5.Rotation = Vector3.new(0, 90, 0)
  256. TorsoA5.Axis = Vector3.new(0, 0, -1)
  257. TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
  258. end
  259. local function set3()
  260. end
  261. spawn(set1);
  262. spawn(set2);
  263. local HA = Instance.new("HingeConstraint")
  264. HA.Parent = head
  265. HA.Attachment0 = HeadA
  266. HA.Attachment1 = TorsoA4
  267. HA.Enabled = true
  268. HA.LimitsEnabled=true
  269. HA.LowerAngle=0
  270. HA.UpperAngle=0
  271. local LAT = Instance.new("BallSocketConstraint")
  272. LAT.Parent = leftarm
  273. LAT.Attachment0 = LeftArmA
  274. LAT.Attachment1 = TorsoA2
  275. LAT.Enabled = true
  276. LAT.LimitsEnabled=true
  277. LAT.UpperAngle=90
  278. local RAT = Instance.new("BallSocketConstraint")
  279. RAT.Parent = rightarm
  280. RAT.Attachment0 = RightArmA
  281. RAT.Attachment1 = TorsoA3
  282. RAT.Enabled = true
  283. RAT.LimitsEnabled=true
  284. RAT.UpperAngle=90
  285. local HA = Instance.new("BallSocketConstraint")
  286. HA.Parent = head
  287. HA.Attachment0 = HeadA
  288. HA.Attachment1 = TorsoA4
  289. HA.Enabled = true
  290. local TLL = Instance.new("BallSocketConstraint")
  291. TLL.Parent = torso
  292. TLL.Attachment0 = TorsoA1
  293. TLL.Attachment1 = LeftLegA
  294. TLL.Enabled = true
  295. TLL.LimitsEnabled=true
  296. TLL.UpperAngle=90
  297. local TRL = Instance.new("BallSocketConstraint")
  298. TRL.Parent = torso
  299. TRL.Attachment0 = TorsoA
  300. TRL.Attachment1 = RightLegA
  301. TRL.Enabled = true
  302. TRL.LimitsEnabled=true
  303. TRL.UpperAngle=90
  304. local RTA = Instance.new("BallSocketConstraint")
  305. RTA.Parent = root
  306. RTA.Attachment0 = rootA
  307. RTA.Attachment1 = TorsoA5
  308. RTA.Enabled = true
  309. RTA.LimitsEnabled=true
  310. RTA.UpperAngle=0
  311. head.Velocity = head.CFrame.lookVector*30
  312.  
  313. for _,child in next,plrmodel:GetChildren() do
  314. if child:IsA("Accoutrement") then
  315. for _,part in next,child:GetChildren() do
  316. if part:IsA("BasePart") then
  317. part.Parent = plrmodel
  318. child:remove()
  319. local attachment1 = part:FindFirstChildOfClass("Attachment")
  320. local attachment0 = getAttachment0(attachment1.Name)
  321. if attachment0 and attachment1 then
  322. local constraint = Instance.new("HingeConstraint")
  323. constraint.Attachment0 = attachment0
  324. constraint.Attachment1 = attachment1
  325. constraint.LimitsEnabled = true
  326. constraint.UpperAngle = 0
  327. constraint.LowerAngle = 0
  328. constraint.Parent = plrmodel
  329. end
  330. end
  331. end
  332. end
  333. end
  334. end)
  335.  
  336. end
  337. if humanoid.Health ~= 0 then
  338. humanoid.Health = 0
  339. wait(3)
  340. while true do
  341. if humanoid.Health ~= 0 then
  342. humanoid.Health = 0 --This loop is a strange kill system I know, but this prevents doing 99 damage instead of 100 for some reason.s
  343. else
  344. break
  345. end
  346. wait(0.3)
  347. end
  348. end
  349. end
  350. end)
  351. end)
  352.  
  353. pistol.Unequipped:connect(function()
  354. wait(0.2)
  355. mouserotatecharacter = false
  356. mee.Character.Humanoid.AutoRotate = true
  357. end)
  358. function MakeShell()
  359. Shell = Instance.new("Part", workspace)
  360. Shell.Size = Vector3.new(0.2, 0.2, 0.6)
  361. ShellMesh = Instance.new("SpecialMesh", Shell)
  362. ShellMesh.MeshId = "http://www.roblox.com/asset/?id=94295100"
  363. ShellMesh.Scale = Vector3.new(4, 4, 4)
  364. ShellMesh.TextureId = "http://www.roblox.com/asset/?id=94287792"
  365. Shell.Position = pistolpart.Position
  366. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement