Advertisement
ERROR_CODE

Untitled

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