Advertisement
naser2345

Ragdoll Pistol

May 3rd, 2017
4,933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.11 KB | None | 0 0
  1. --By naser2018
  2. mouse = game.Players.LocalPlayer:GetMouse()
  3. gun = Instance.new("Part", game.Players.LocalPlayer.Character)
  4. gun.Size = Vector3.new(0.5, 1, 2)
  5. gun.CanCollide = false
  6. gun:BreakJoints()
  7. weld = Instance.new("Weld", gun)
  8. weld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  9. weld.Part1 = gun
  10. weld.C0 = weld.C0 * CFrame.new(-0.2,-1.7,-0.25) * CFrame.Angles(0,1.6,-1.53)
  11. mesh = Instance.new("SpecialMesh", gun)
  12. mesh.MeshId = "rbxassetid://623102664"
  13. mesh.TextureId = "rbxassetid://623102879"
  14. mesh.Scale = Vector3.new(0.01,0.01,0.01)
  15. local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  16. rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  17. rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  18. rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  19. rhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  20. shooting = false
  21. for i = 1,2 do
  22. wait()
  23. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.03)
  24. end
  25. for i = 1,2 do
  26. wait()
  27. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.07)
  28. end
  29. for i = 1,7 do
  30. wait()
  31. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.17)
  32. end
  33. for i = 1,2 do
  34. wait()
  35. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.07)
  36. end
  37. for i = 1,2 do
  38. wait()
  39. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.03)
  40. end
  41. function shoot()
  42. if not shooting then
  43. shooting = true
  44. local shotsound = Instance.new("Sound", gun)
  45. shotsound.EmitterSize = 1
  46. shotsound.SoundId = "rbxassetid://139593133"
  47. shotsound.Volume = 3
  48. shotsound:Play()
  49. local missle = Instance.new("Part", workspace)
  50. missle.Size = Vector3.new(0.05,0.05,0.05)
  51. missle.CanCollide = false
  52. missle.BrickColor = BrickColor.new("New Yeller")
  53. missle.Shape = "Ball"
  54. missle.CFrame = gun.CFrame
  55. missle:BreakJoints()
  56. local velo = Instance.new("BodyVelocity", missle)
  57. velo.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  58. velo.Velocity = mouse.Hit.lookVector * 190
  59. for i = 1,2 do
  60. weld.C0 = weld.C0 * CFrame.Angles(0,0,0.14)
  61. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.14)
  62. end
  63. for i = 1,2 do
  64. wait()
  65. weld.C0 = weld.C0 * CFrame.Angles(0,0,-0.07)
  66. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.07)
  67. end
  68. local function kill(part)
  69. local hum = part.Parent:findFirstChild("Humanoid")
  70. local torso = part.Parent:findFirstChild("Torso")
  71. local larm = part.Parent:findFirstChild("Left Arm")
  72. local rarm = part.Parent:findFirstChild("Right Arm")
  73. local lleg = part.Parent:findFirstChild("Left Leg")
  74. local rleg = part.Parent:findFirstChild("Right Leg")
  75. missle:destroy()
  76. if hum ~= nil then
  77. if torso then
  78. hum.Health = hum.Health - math.random(25,68)
  79. local shotsound1 = Instance.new("Sound", torso)
  80. shotsound1:Play()
  81. shotsound1.EmitterSize = 2
  82. shotsound1.SoundId = "rbxassetid://144884872"
  83. shotsound1.Volume = 8
  84. shotsound1:Play()
  85. local shotsound1 = Instance.new("Sound", torso)
  86. shotsound1:Play()
  87. shotsound1.EmitterSize = 2
  88. shotsound1.SoundId = "rbxassetid://175272131"
  89. shotsound1.Volume = 8
  90. shotsound1:Play()
  91. using = false
  92. hit = Instance.new("Sound", torso)
  93. hit.SoundId = "rbxassetid://260430060"
  94. hit.Volume = 5
  95. hit1 = Instance.new("Sound", torso)
  96. hit1.SoundId = "rbxassetid://138087186"
  97. hit1.Volume = 5
  98. hit2 = Instance.new("Sound", torso)
  99. hit2.SoundId = "rbxassetid://131237241"
  100. hit2.Volume = 5
  101. hit3 = Instance.new("Sound", torso)
  102. hit3.SoundId = "rbxassetid://278062209"
  103. hit3.Volume = 5
  104. hit3.TimePosition = 0.33
  105. print("You killed "..hum.Parent.Name)
  106. hum.PlatformStand = true
  107. ----------
  108. local lhip = torso:findFirstChild("Left Hip")
  109. if lhip then
  110. ---
  111. torso["Left Hip"]:destroy()
  112. local head = game.Players.LocalPlayer.Character.Head
  113. local glue = Instance.new("Glue", torso)
  114. glue.Part0 = torso
  115. glue.Part1 = torso.Parent["Left Leg"]
  116. glue.Name = "Left leg"
  117. local collider = Instance.new("Part", torso.Parent["Left Leg"])
  118. collider.Position = Vector3.new(0,999,0)
  119. collider.Size = Vector3.new(1.7, 1, 1)
  120. collider.Shape = "Cylinder"
  121. local weld = Instance.new("Weld", collider)
  122. weld.Part0 = torso.Parent["Left Leg"]
  123. weld.Part1 = collider
  124. weld.C0 = CFrame.Angles(0, 0, 80)
  125. collider.TopSurface = "Smooth"
  126. collider.BottomSurface = "Smooth"
  127. collider.formFactor = "Symmetric"
  128. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  129. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  130. collider.Transparency = 1
  131. end
  132. local rhip = torso:findFirstChild("Right Hip")
  133. if rhip then
  134. ------------
  135. torso["Right Hip"]:destroy()
  136. local glue1 = Instance.new("Glue", torso)
  137. glue1.Part0 = torso
  138. glue1.Part1 = torso.Parent["Right Leg"]
  139. glue1.Name = "Right leg"
  140. local collider1 = Instance.new("Part", torso.Parent["Right Leg"])
  141. collider1.Position = Vector3.new(0,9999,0)
  142. collider1.Size = Vector3.new(1.7, 1, 1)
  143. collider1.Shape = "Cylinder"
  144. local weld1 = Instance.new("Weld", collider1)
  145. weld1.Part0 = torso.Parent["Right Leg"]
  146. weld1.Part1 = collider1
  147. weld1.C0 = CFrame.Angles(0, 0, 80)
  148. collider1.TopSurface = "Smooth"
  149. collider1.BottomSurface = "Smooth"
  150. collider1.formFactor = "Symmetric"
  151. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  152. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  153. collider1.Transparency = 1
  154. end
  155. ------------
  156. local rshoulder = torso:findFirstChild("Right Shoulder")
  157. if rshoulder then
  158. torso["Right Shoulder"]:destroy()
  159. local glue11 = Instance.new("Glue", torso)
  160. glue11.Part0 = torso
  161. glue11.Part1 = torso.Parent["Right Arm"]
  162. glue11.Name = "Right shoulder"
  163. local collider11 = Instance.new("Part", torso.Parent["Right Arm"])
  164. collider11.Position = Vector3.new(0,9999,0)
  165. collider11.Size = Vector3.new(1.8,1,1)
  166. collider11.Shape = "Cylinder"
  167. local weld11 = Instance.new("Weld", collider11)
  168. weld11.Part0 = torso.Parent["Right Arm"]
  169. weld11.Part1 = collider11
  170. weld11.C0 = CFrame.Angles(0, 0, 80)
  171. collider11.TopSurface = "Smooth"
  172. collider11.BottomSurface = "Smooth"
  173. collider11.formFactor = "Symmetric"
  174. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  175. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  176. collider11.Transparency = 1
  177. end
  178. ------------
  179. local lshoulder = torso:findFirstChild("Left Shoulder")
  180. if lshoulder then
  181. torso["Left Shoulder"]:destroy()
  182. local glue111 = Instance.new("Glue", torso)
  183. glue111.Part0 = torso
  184. glue111.Part1 = torso.Parent["Left Arm"]
  185. glue111.Name = "Left shoulder"
  186. local collider111 = Instance.new("Part", torso.Parent["Left Arm"])
  187. collider111.Position = Vector3.new(0,9999,0)
  188. collider111.Size = Vector3.new(1.8,1,1)
  189. collider111.Shape = "Cylinder"
  190. local weld111 = Instance.new("Weld", collider111)
  191. weld111.Part0 = torso.Parent["Left Arm"]
  192. weld111.Part1 = collider111
  193. weld111.C0 = CFrame.Angles(0, 0, 80)
  194. collider111.TopSurface = "Smooth"
  195. collider111.BottomSurface = "Smooth"
  196. collider111.formFactor = "Symmetric"
  197. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  198. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  199. collider111.Transparency = 1
  200. end
  201. -----------------
  202. local sensoring = Instance.new("Part", torso)
  203. sensoring.Size = Vector3.new(1.2,1.1,0.8)
  204. sensoring.CanCollide = false
  205. sensoring.Position = torso.Position
  206. local welder = Instance.new("Weld", sensoring)
  207. welder.Part0 = torso
  208. welder.Part1 = sensoring
  209. welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  210. sensoring.Transparency = 1
  211. -----------------
  212. local sensoring1 = Instance.new("Part", torso)
  213. sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  214. sensoring1.CanCollide = false
  215. sensoring1.Position = torso.Position
  216. local welder1 = Instance.new("Weld", sensoring)
  217. welder1.Part0 = torso
  218. welder1.Part1 = sensoring1
  219. welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  220. sensoring1.Transparency = 1
  221. local function touch()
  222. if not using then
  223. using = true
  224. local Math = math.random(1,4)
  225. if Math == 1 then
  226. hit:Play()
  227. end
  228. if Math == 2 then
  229. hit1:Play()
  230. end
  231. if Math == 3 then
  232. hit2:Play()
  233. end
  234. if Math == 4 then
  235. hit3:Play()
  236. end
  237. wait(0.1)
  238. using = false
  239. end
  240. end
  241. sensoring.Touched:connect(touch)
  242. sensoring1.Touched:connect(touch)
  243. if part.Name == "Head" then
  244. local hed = Instance.new("Sound", torso)
  245. hed.SoundId = "rbxassetid://147936251"
  246. hed.Volume = 5
  247. hed:Play()
  248. hum.Health = 0.00001
  249. for i,v in pairs(torso.Parent:GetChildren()) do
  250. if v.ClassName == "Hat" or v.ClassName == "Accessory" then
  251. v:destroy()
  252. end
  253. end
  254. for i,v in pairs(torso.Parent.Head:GetChildren()) do
  255. if v.ClassName == "Decal" then
  256. v:destroy()
  257. end
  258. end
  259. torso.Parent.Head.Transparency = 1
  260. wait(3)
  261. hum.Health = 0
  262. end
  263. while true do
  264. wait(0.3)
  265. hum.PlatformStand = true
  266. end
  267.  
  268. --di ent
  269. end
  270. end
  271. end
  272. missle.Touched:connect(kill)
  273. for i = 1,2 do
  274. wait()
  275. weld.C0 = weld.C0 * CFrame.Angles(0,0,-0.07)
  276. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.07)
  277. end
  278. shooting = false
  279. wait(3)
  280. shotsound:destroy()
  281. end
  282. end
  283. mouse.Button1Down:connect(shoot)
  284. function ragdoll()
  285. game.Players.LocalPlayer.Character.Archivable = true
  286. clone = game.Players.LocalPlayer.Character:Clone()
  287. clone.Parent = workspace
  288. for i,v in pairs(clone:GetChildren()) do
  289. if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  290. v:destroy()
  291. end
  292. for i,p in pairs(v:GetChildren()) do
  293. if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
  294. p:destroy()
  295. end
  296. end
  297. end
  298. for i,t in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  299. if t.ClassName == "Accessory" or t.ClassName == "ForceField" then
  300. t:destroy()
  301. end
  302. end
  303. vel = Instance.new("BodyVelocity", clone.Torso)
  304. vel.Velocity = clone.Torso.CFrame.lookVector * -5
  305. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  306. clone.Head.face.Texture = "http://www.roblox.com/asset/?id=161061608"
  307. using = false
  308. hit = Instance.new("Sound", clone.Torso)
  309. hit.SoundId = "rbxassetid://260430060"
  310. hit.Volume = 5
  311. hit1 = Instance.new("Sound", clone.Torso)
  312. hit1.SoundId = "rbxassetid://138087186"
  313. hit1.Volume = 5
  314. hit2 = Instance.new("Sound", clone.Torso)
  315. hit2.SoundId = "rbxassetid://131237241"
  316. hit2.Volume = 5
  317. hit3 = Instance.new("Sound", clone.Torso)
  318. hit3.SoundId = "rbxassetid://278062209"
  319. hit3.Volume = 5
  320. hit3.TimePosition = 0.33
  321. ded = Instance.new("Sound", clone.Torso)
  322. ded.SoundId = "rbxassetid://418892870"
  323. ded.Volume = 5
  324. local leftarm = clone:findFirstChild("Left Arm")
  325. local rightrm = clone:findFirstChild("Right Arm")
  326. local leftleg = clone:findFirstChild("Left Leg")
  327. local rightleg = clone:findFirstChild("Right Leg")
  328. local head = clone:findFirstChild("Head")
  329. local welding = Instance.new("Weld", clone.Torso)
  330. welding.Part0 = clone.Torso
  331. welding.Part1 = head
  332. welding.C0 = welding.C0 * CFrame.new(0,1.5,0)
  333. for i, g in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  334. if g.ClassName == "Part" then
  335. g:destroy()
  336. end
  337. end
  338. for i, h in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  339. if h.ClassName == "Accesory" then
  340. h:destroy()
  341. end
  342. end
  343. game.Workspace.CurrentCamera.CameraSubject = head
  344. if leftleg ~= nil then
  345. local glue = Instance.new("Glue", clone.Torso)
  346. glue.Part0 = clone.Torso
  347. glue.Part1 = leftleg
  348. glue.Name = "Left leg"
  349. local collider = Instance.new("Part", leftleg)
  350. collider.Position = Vector3.new(0,999,0)
  351. collider.Size = Vector3.new(1.7, 1, 1)
  352. collider.Shape = "Cylinder"
  353. local weld = Instance.new("Weld", collider)
  354. weld.Part0 = leftleg
  355. weld.Part1 = collider
  356. weld.C0 = CFrame.Angles(0, 0, 80)
  357. collider.TopSurface = "Smooth"
  358. collider.BottomSurface = "Smooth"
  359. collider.formFactor = "Symmetric"
  360. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  361. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  362. collider.Transparency = 1
  363. end
  364. ------------
  365. if rightleg ~= nil then
  366. local glue1 = Instance.new("Glue", clone.Torso)
  367. glue1.Part0 = clone.Torso
  368. glue1.Part1 = rightleg
  369. glue1.Name = "Right leg"
  370. local collider1 = Instance.new("Part", rightleg)
  371. collider1.Position = Vector3.new(0,999,0)
  372. collider1.Size = Vector3.new(1.7, 1, 1)
  373. collider1.Shape = "Cylinder"
  374. local weld1 = Instance.new("Weld", collider1)
  375. weld1.Part0 = rightleg
  376. weld1.Part1 = collider1
  377. weld1.C0 = CFrame.Angles(0, 0, 80)
  378. collider1.TopSurface = "Smooth"
  379. collider1.BottomSurface = "Smooth"
  380. collider1.formFactor = "Symmetric"
  381. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  382. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  383. collider1.Transparency = 1
  384. end
  385. ------------
  386. if rightrm ~= nil then
  387. local glue11 = Instance.new("Glue", clone.Torso)
  388. glue11.Part0 = clone.Torso
  389. glue11.Part1 = rightrm
  390. glue11.Name = "Right shoulder"
  391. local collider11 = Instance.new("Part", rightrm)
  392. collider11.Position = Vector3.new(0,9999,0)
  393. collider11.Size = Vector3.new(1.8,1,1)
  394. collider11.Shape = "Cylinder"
  395. local weld11 = Instance.new("Weld", collider11)
  396. weld11.Part0 = rightrm
  397. weld11.Part1 = collider11
  398. weld11.C0 = CFrame.Angles(0, 0, 80)
  399. collider11.TopSurface = "Smooth"
  400. collider11.BottomSurface = "Smooth"
  401. collider11.formFactor = "Symmetric"
  402. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  403. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  404. collider11.Transparency = 1
  405. end
  406. ------------
  407. if leftarm ~= nil then
  408. local glue111 = Instance.new("Glue", clone.Torso)
  409. glue111.Part0 = clone.Torso
  410. glue111.Part1 = leftarm
  411. glue111.Name = "Left shoulder"
  412. local collider111 = Instance.new("Part", leftarm)
  413. collider111.Position = Vector3.new(0,9999,0)
  414. collider111.Size = Vector3.new(1.8,1,1)
  415. collider111.Shape = "Cylinder"
  416. local weld111 = Instance.new("Weld", collider111)
  417. weld111.Part0 = leftarm
  418. weld111.Part1 = collider111
  419. weld111.C0 = CFrame.Angles(0, 0, 80)
  420. collider111.TopSurface = "Smooth"
  421. collider111.BottomSurface = "Smooth"
  422. collider111.formFactor = "Symmetric"
  423. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  424. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  425. collider111.Transparency = 1
  426. ----------------
  427. sensoring = Instance.new("Part", clone.Torso)
  428. sensoring.Size = Vector3.new(1.2,1.1,0.8)
  429. sensoring.CanCollide = false
  430. sensoring.Position = clone.Torso.Position
  431. local welder = Instance.new("Weld", sensoring)
  432. welder.Part0 = clone.Torso
  433. welder.Part1 = sensoring
  434. welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  435. sensoring.Transparency = 1
  436. -----------------
  437. sensoring1 = Instance.new("Part", clone.Torso)
  438. sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  439. sensoring1.CanCollide = false
  440. sensoring1.Position = clone.Torso.Position
  441. local welder1 = Instance.new("Weld", sensoring)
  442. welder1.Part0 = clone.Torso
  443. welder1.Part1 = sensoring1
  444. welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  445. sensoring1.Transparency = 1
  446. end
  447. clone.Name = game.Players.LocalPlayer.Character.Name.." (DEAD)"
  448. ded:Play()
  449. vel:destroy()
  450. wait(0.5)
  451. local function touch()
  452. if not using then
  453. using = true
  454. local Math = math.random(1,4)
  455. if Math == 1 then
  456. hit:Play()
  457. end
  458. if Math == 2 then
  459. hit1:Play()
  460. end
  461. if Math == 3 then
  462. hit2:Play()
  463. end
  464. if Math == 4 then
  465. hit3:Play()
  466. end
  467. wait(0.1)
  468. using = false
  469. end
  470. end
  471. sensoring.Touched:connect(touch)
  472. sensoring1.Touched:connect(touch)
  473. wait(4.47)
  474. hit1.Volume = 0
  475. hit2.Volume = 0
  476. hit3.Volume = 0
  477. hit.Volume = 0
  478. end
  479.  
  480. game.Players.LocalPlayer.Character.Humanoid.Died:connect(ragdoll)
  481.  
  482. --di ent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement