Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.00 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 | Showcase by Bacon Hair!")
  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()}
  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. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) 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 self[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. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145. wait(1) --For running in rbx studio lol
  146. mee = game.Players.LocalPlayer
  147. pistol = Instance.new("Tool", mee.Backpack)
  148. pistol.GripForward = Vector3.new(-0.149, 0.984, -0.099)
  149. pistol.GripPos = Vector3.new(0.1, -0.55, -0.2)
  150. pistol.GripRight = Vector3.new(0.989, 0.148, -0.015)
  151. pistol.GripUp = Vector3.new(0, 0.1, 0.995)
  152. pistol.ToolTip = "Umm... where did you get that?"
  153. pistol.Name = "Pistol"
  154. pistolpart = Instance.new("Part", pistol)
  155. pistolpart.Name = "Handle"
  156. pistolpart.BrickColor = BrickColor.new("Black")
  157. pistolpart.Material = "SmoothPlastic"
  158. pistolpart.Orientation = Vector3.new(-88.99, 152.78, 135.7)
  159. pistolpart.Size = Vector3.new(0.2, 1.12, 0.6)
  160. pistolmesh = Instance.new("SpecialMesh", pistolpart)
  161. pistolmesh.MeshId = "rbxassetid://430060386"
  162. pistolmesh.Scale = Vector3.new(1.7, 1.7, 1.7)
  163. pistolmesh.TextureId = "rbxassetid://430060404"
  164. pistolmesh.VertexColor = Vector3.new(2, 2, 2)
  165. gunshotsound = Instance.new("Sound", pistolpart)
  166. gunshotsound.SoundId = "rbxassetid://213603013"
  167. mouserotatecharacter = true
  168.  
  169.  
  170. pistol.Equipped:connect(function(mouse)
  171. mouserotatecharacter = true
  172. local torso = mee.Character.HumanoidRootPart
  173. local mouseturning = mee:GetMouse()
  174. mee.Character.Humanoid.AutoRotate = false
  175. mouseturning.Move:connect(function()
  176. if mouserotatecharacter == true then
  177. torso.CFrame = CFrame.new(torso.Position, mouseturning.Hit.p*Vector3.new(1,0,1) + torso.Position*Vector3.new(0, 1, 0))
  178.  
  179. end
  180. end)
  181. mouse.Button1Down:connect(function()
  182. gunshotsound:Play()
  183. MakeShell()
  184. local ray = Ray.new(pistol.Handle.CFrame.p, (mouse.Hit.p - pistol.Handle.CFrame.p).unit * 300)
  185. local part, position = workspace:FindPartOnRay(ray, mee.Character, false, true)
  186.  
  187. local beam = Instance.new("Part", workspace)
  188. beam.BrickColor = BrickColor.new("White")
  189. beam.FormFactor = "Custom"
  190. beam.Material = "Neon"
  191. beam.Transparency = 0.7
  192. beam.Anchored = true
  193. beam.Locked = true
  194. beam.CanCollide = false
  195.  
  196. local distance = (pistol.Handle.CFrame.p - position).magnitude
  197. beam.Size = Vector3.new(0.3, 0.3, distance)
  198. beam.CFrame = CFrame.new(pistol.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  199.  
  200. game:GetService("Debris"):AddItem(beam, 0.1)
  201.  
  202. if part then
  203. local humanoid = part.Parent:FindFirstChild("Humanoid")
  204.  
  205. if not humanoid then
  206. humanoid = part.Parent.Parent:FindFirstChild("Humanoid")
  207. end
  208.  
  209. if humanoid then
  210. plrmodel = humanoid.Parent
  211. if plrmodel.Humanoid.Health ~= 0 then
  212. --blood
  213. plrmodel.Archivable = true
  214. local Char = plrmodel
  215. local Hum = Char:FindFirstChild("Humanoid")
  216. local Tor = Char:FindFirstChild("Torso") or Char:FindFirstChild("UpperTorso")
  217. local Health = Hum.Health
  218.  
  219. local M = math.random
  220. local R = math.rad
  221. local rates = {.05, .075, .1, .15}
  222.  
  223. local smooth = function(P)
  224. local SM = Enum.SurfaceType.SmoothNoOutlines
  225. P.TopSurface = SM
  226. P.BottomSurface = SM
  227. P.RightSurface = SM
  228. P.LeftSurface = SM
  229. P.FrontSurface = SM
  230. P.BackSurface = SM
  231. end
  232.  
  233. local function BloodPool(Part,Size)
  234. local Pool = Instance.new("Part",game.Workspace)
  235. Pool.TopSurface = 0
  236. Pool.CanCollide = false
  237. Pool.BrickColor = BrickColor.new("Crimson")
  238. Pool.Transparency = 1
  239. Instance.new("CylinderMesh",Pool)
  240. Pool.Anchored = true
  241. Pool.Name = "BloodPoolPart"
  242. smooth(Pool)
  243. Pool.FormFactor = Enum.FormFactor.Custom
  244. Pool.Size = Size
  245. local c = Part.CFrame*CFrame.new(M(-3.01,3.01),-2.9,M(-3.01,3.01))
  246. coroutine.resume(coroutine.create(function()
  247. local rate = rates[M(1,#rates)]
  248. game.Debris:AddItem(Pool,15)
  249. for i = 1,M(25,70) do
  250. wait()
  251. Pool.CFrame = c
  252. Pool.Size = Pool.Size+Vector3.new(rate,0,rate)
  253. end
  254. wait(5)
  255. Pool:Destroy()
  256. end))
  257. end
  258.  
  259. local function BloodDrops(Size,Area)
  260. local Blood = Instance.new("Part",game.Workspace)
  261. Blood.BrickColor = BrickColor.new("Crimson")
  262. Blood.Parent = plrmodel
  263. Blood.TopSurface = 0
  264. Blood.CanCollide = false
  265. Blood.Anchored = false
  266. Blood.Transparency = 1
  267. Blood.FormFactor = Enum.FormFactor.Custom
  268. Blood.Size = Size
  269. Blood.CFrame = Area*CFrame.new(M(-1.00,1.00),M(-1.00,1.00),M(-1.00,1.00))
  270. return Blood
  271. end
  272.  
  273.  
  274.  
  275. Hum.Changed:connect(function()
  276. if Hum.Health < Health then
  277.  
  278. Health = Hum.Health
  279. for i = 1, math.random(4,10)do
  280. local Size = Vector3.new(M(-0.25,0.25),.2,M(-.25,.25))
  281. local Blood = BloodDrops(Size,Tor.CFrame)
  282. local Stopper = false
  283. local Size2 = Vector3.new(M(-0.25,0.25),.2,M(-.25,.25))
  284. BloodPool(Tor,Size2)
  285. end
  286. end
  287. end)
  288. end
  289. --Ragdoll
  290. wait()
  291. function getAttachment0(attachmentName)
  292. for _,child in next,plrmodel:GetChildren() do
  293. local attachment = child:FindFirstChild(attachmentName)
  294. if attachment then
  295. return attachment
  296. end
  297. end
  298. end
  299. plrmodel.Humanoid.Died:Connect(function(var)
  300. local removeHRP = true
  301. local head = plrmodel["Head"]
  302. local leftarm = plrmodel["Left Arm"]
  303. local leftleg = plrmodel["Left Leg"]
  304. local rightleg = plrmodel["Right Leg"]
  305. local rightarm = plrmodel["Right Arm"]
  306. local torso = plrmodel.Torso
  307. local root = plrmodel.HumanoidRootPart
  308. if removeHRP == true then
  309. root:Destroy()
  310. end
  311. local rootA =Instance.new("Attachment")
  312. local HeadA = Instance.new("Attachment")
  313. local LeftArmA = Instance.new("Attachment")
  314. local LeftLegA = Instance.new("Attachment")
  315. local RightArmA = Instance.new("Attachment")
  316. local RightLegA = Instance.new("Attachment")
  317. local TorsoA = Instance.new("Attachment")
  318. local TorsoA1 = Instance.new("Attachment")
  319. local TorsoA2 = Instance.new("Attachment")
  320. local TorsoA3 = Instance.new("Attachment")
  321. local TorsoA4 = Instance.new("Attachment")
  322. local TorsoA5 = Instance.new("Attachment")
  323. local function set1()
  324. HeadA.Name = "HeadA"
  325. HeadA.Parent = head
  326. HeadA.Position = Vector3.new(0, -0.5, 0)
  327. HeadA.Rotation = Vector3.new(0, 0, 0)
  328. HeadA.Axis = Vector3.new(1, 0, 0)
  329. HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
  330. LeftArmA.Name = "LeftArmA"
  331. LeftArmA.Parent = leftarm
  332. LeftArmA.Position = Vector3.new(0.5, 1, 0)
  333. LeftArmA.Rotation = Vector3.new(0, 0, 0)
  334. LeftArmA.Axis = Vector3.new(1, 0, 0)
  335. LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)
  336. LeftLegA.Name = "LeftLegA"
  337. LeftLegA.Parent = leftleg
  338. LeftLegA.Position = Vector3.new(0, 1, 0)
  339. LeftLegA.Rotation = Vector3.new(0, 0, 0)
  340. LeftLegA.Axis = Vector3.new(1, 0, 0)
  341. LeftLegA.SecondaryAxis = Vector3.new(0, 1, 0)
  342. RightArmA.Name = "RightArmA"
  343. RightArmA.Parent = rightarm
  344. RightArmA.Position = Vector3.new(-0.5, 1, 0)
  345. RightArmA.Rotation = Vector3.new(0, 0, 0)
  346. RightArmA.Axis = Vector3.new(1, 0, 0)
  347. RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)
  348. RightLegA.Name = "RightLegA"
  349. RightLegA.Parent = rightleg
  350. RightLegA.Position = Vector3.new(0, 1, 0)
  351. RightLegA.Rotation = Vector3.new(0, 0, 0)
  352. RightLegA.Axis = Vector3.new(1, 0, 0)
  353. RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)
  354. rootA.Name= "rootA"
  355. rootA.Parent = root
  356. rootA.Position = Vector3.new(0, 0, 0)
  357. rootA.Rotation = Vector3.new(0, 90, 0)
  358. rootA.Axis = Vector3.new(0, 0, -1)
  359. rootA.SecondaryAxis = Vector3.new(0, 1, 0)
  360. end
  361. local function set2()
  362. TorsoA.Name = "TorsoA"
  363. TorsoA.Parent = torso
  364. TorsoA.Position = Vector3.new(0.5, -1, 0)
  365. TorsoA.Rotation = Vector3.new(0, 0, 0)
  366. TorsoA.Axis = Vector3.new(1, 0, 0)
  367. TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)
  368. TorsoA1.Name = "TorsoA1"
  369. TorsoA1.Parent = torso
  370. TorsoA1.Position = Vector3.new(-0.5, -1, 0)
  371. TorsoA1.Rotation = Vector3.new(0, 0, 0)
  372. TorsoA1.Axis = Vector3.new(1, 0, 0)
  373. TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)
  374. TorsoA2.Name = "TorsoA2"
  375. TorsoA2.Parent = torso
  376. TorsoA2.Position = Vector3.new(-1, 1, 0)
  377. TorsoA2.Rotation = Vector3.new(0, 0, 0)
  378. TorsoA2.Axis = Vector3.new(1, 0, 0)
  379. TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)
  380. TorsoA3.Name = "TorsoA3"
  381. TorsoA3.Parent = torso
  382. TorsoA3.Position = Vector3.new(1, 1, 0)
  383. TorsoA3.Rotation = Vector3.new(0, 0, 0)
  384. TorsoA3.Axis = Vector3.new(1, 0, 0)
  385. TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)
  386. TorsoA4.Name = "TorsoA4"
  387. TorsoA4.Parent = torso
  388. TorsoA4.Position = Vector3.new(0, 1, 0)
  389. TorsoA4.Rotation = Vector3.new(0, 0, 0)
  390. TorsoA4.Axis = Vector3.new(1, 0, 0)
  391. TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
  392. TorsoA5.Name = "TorsoA5"
  393. TorsoA5.Parent = torso
  394. TorsoA5.Position = Vector3.new(0, 0, 0)
  395. TorsoA5.Rotation = Vector3.new(0, 90, 0)
  396. TorsoA5.Axis = Vector3.new(0, 0, -1)
  397. TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
  398. end
  399. local function set3()
  400. end
  401. spawn(set1);
  402. spawn(set2);
  403. local HA = Instance.new("HingeConstraint")
  404. HA.Parent = head
  405. HA.Attachment0 = HeadA
  406. HA.Attachment1 = TorsoA4
  407. HA.Enabled = true
  408. HA.LimitsEnabled=true
  409. HA.LowerAngle=0
  410. HA.UpperAngle=0
  411. local LAT = Instance.new("BallSocketConstraint")
  412. LAT.Parent = leftarm
  413. LAT.Attachment0 = LeftArmA
  414. LAT.Attachment1 = TorsoA2
  415. LAT.Enabled = true
  416. LAT.LimitsEnabled=true
  417. LAT.UpperAngle=90
  418. local RAT = Instance.new("BallSocketConstraint")
  419. RAT.Parent = rightarm
  420. RAT.Attachment0 = RightArmA
  421. RAT.Attachment1 = TorsoA3
  422. RAT.Enabled = true
  423. RAT.LimitsEnabled=true
  424. RAT.UpperAngle=90
  425. local HA = Instance.new("BallSocketConstraint")
  426. HA.Parent = head
  427. HA.Attachment0 = HeadA
  428. HA.Attachment1 = TorsoA4
  429. HA.Enabled = true
  430. local TLL = Instance.new("BallSocketConstraint")
  431. TLL.Parent = torso
  432. TLL.Attachment0 = TorsoA1
  433. TLL.Attachment1 = LeftLegA
  434. TLL.Enabled = true
  435. TLL.LimitsEnabled=true
  436. TLL.UpperAngle=90
  437. local TRL = Instance.new("BallSocketConstraint")
  438. TRL.Parent = torso
  439. TRL.Attachment0 = TorsoA
  440. TRL.Attachment1 = RightLegA
  441. TRL.Enabled = true
  442. TRL.LimitsEnabled=true
  443. TRL.UpperAngle=90
  444. local RTA = Instance.new("BallSocketConstraint")
  445. RTA.Parent = root
  446. RTA.Attachment0 = rootA
  447. RTA.Attachment1 = TorsoA5
  448. RTA.Enabled = true
  449. RTA.LimitsEnabled=true
  450. RTA.UpperAngle=0
  451. head.Velocity = head.CFrame.lookVector*30
  452.  
  453. for _,child in next,plrmodel:GetChildren() do
  454. if child:IsA("Accoutrement") then
  455. for _,part in next,child:GetChildren() do
  456. if part:IsA("BasePart") then
  457. part.Parent = plrmodel
  458. child:remove()
  459. local attachment1 = part:FindFirstChildOfClass("Attachment")
  460. local attachment0 = getAttachment0(attachment1.Name)
  461. if attachment0 and attachment1 then
  462. local constraint = Instance.new("HingeConstraint")
  463. constraint.Attachment0 = attachment0
  464. constraint.Attachment1 = attachment1
  465. constraint.LimitsEnabled = true
  466. constraint.UpperAngle = 0
  467. constraint.LowerAngle = 0
  468. constraint.Parent = plrmodel
  469. end
  470. end
  471. end
  472. end
  473. end
  474. end)
  475.  
  476. end
  477. if humanoid.Health ~= 0 then
  478. humanoid.Health = 0
  479. wait(3)
  480. while true do
  481. if humanoid.Health ~= 0 then
  482. 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
  483. else
  484. break
  485. end
  486. wait(0.3)
  487. end
  488. end
  489. end
  490. end)
  491. end)
  492.  
  493. pistol.Unequipped:connect(function()
  494. wait(0.2)
  495. mouserotatecharacter = false
  496. mee.Character.Humanoid.AutoRotate = true
  497. end)
  498. function MakeShell()
  499. Shell = Instance.new("Part", workspace)
  500. Shell.Size = Vector3.new(0.2, 0.2, 0.6)
  501. ShellMesh = Instance.new("SpecialMesh", Shell)
  502. ShellMesh.MeshId = "http://www.roblox.com/asset/?id=94295100"
  503. ShellMesh.Scale = Vector3.new(4, 4, 4)
  504. ShellMesh.TextureId = "http://www.roblox.com/asset/?id=94287792"
  505. Shell.Position = pistolpart.Position
  506. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement