memberhero

Untitled

Aug 7th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.65 KB | None | 0 0
  1. --[[
  2. Poison Syringe
  3.  
  4. Syringe filled with a deadly poison that slowly kills its' host.
  5. Script by DarkShadow6
  6. --]]
  7.  
  8.  
  9. if script == nil then return end
  10.  
  11.  
  12. Player = game:GetService("Players").LocalPlayer
  13. Char = Player.Character
  14. animate = Char:findFirstChild("Animate")
  15. if animate then
  16. animate:Destroy()
  17. end
  18. Name = "Poison Syringe"
  19. selected = false
  20. Button1Down = false
  21. CanUse = true
  22.  
  23.  
  24. function makeParts(format)
  25. local model = Instance.new("Model")
  26. model.Name = Name
  27. local pm = Instance.new("Part")
  28. pm.Name = "Handle"
  29. pm.FormFactor = "Custom"
  30. pm.Size = Vector3.new(1, 1, 1)
  31. pm.BrickColor = BrickColor.new("Institutional white")
  32. pm.Locked = true
  33. pm.TopSurface = 0
  34. pm.BottomSurface = 0
  35. pm.Parent = model
  36. local m = Instance.new("CylinderMesh")
  37. m.Scale = Vector3.new(0.25, 1, 0.25)
  38. m.Parent = pm
  39. if format ~= nil then
  40. local w = Instance.new("Weld")
  41. w.Part0 = pm
  42. if format == "hand" then
  43. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  44. w.C0 = CFrame.new(0, 0.1, 1.1) * CFrame.fromEulerAnglesXYZ(math.rad(70), 0, 0)
  45. w.C1 = CFrame.new()
  46. elseif format == "holster" then
  47. w.Part1 = Player.Character:FindFirstChild("Right Leg")
  48. w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
  49. w.C1 = CFrame.new()
  50. w.Parent = pm
  51. model.Name = Name.. " (Holstered)"
  52. end
  53. w.Parent = pm
  54. model.Parent = Player.Character
  55. end
  56. local p = Instance.new("Part")
  57. p.Name = "Syringe Valve 1"
  58. p.FormFactor = "Custom"
  59. p.Size = Vector3.new(1, 1, 1)
  60. p.BrickColor = BrickColor.new("Institutional white")
  61. p.CanCollide = false
  62. p.Locked = true
  63. p.TopSurface = 0
  64. p.BottomSurface = 0
  65. p.Parent = model
  66. local m = Instance.new("CylinderMesh")
  67. m.Scale = Vector3.new(0.15, 0.5, 0.15)
  68. m.Parent = p
  69. local w = Instance.new("Weld")
  70. w.Part0 = p
  71. w.Part1 = pm
  72. w.C0 = CFrame.new(0, -0.75, 0)
  73. w.C1 = CFrame.new()
  74. w.Parent = p
  75. local p = Instance.new("Part")
  76. p.Name = "Syringe Valve 2"
  77. p.FormFactor = "Custom"
  78. p.Size = Vector3.new(1, 1, 1)
  79. p.BrickColor = BrickColor.new("Institutional white")
  80. p.CanCollide = false
  81. p.Locked = true
  82. p.TopSurface = 0
  83. p.BottomSurface = 0
  84. p.Parent = model
  85. local m = Instance.new("CylinderMesh")
  86. m.Scale = Vector3.new(0.3, 0.01, 0.3)
  87. m.Parent = p
  88. local w = Instance.new("Weld")
  89. w.Part0 = p
  90. w.Part1 = pm
  91. w.C0 = CFrame.new(0, -1, 0)
  92. w.C1 = CFrame.new()
  93. w.Parent = p
  94. local p = Instance.new("Part")
  95. p.Name = "Syringe Tip"
  96. p.FormFactor = "Custom"
  97. p.Size = Vector3.new(1, 1, 1)
  98. p.BrickColor = BrickColor.new("Institutional white")
  99. p.CanCollide = false
  100. p.Locked = true
  101. p.TopSurface = 0
  102. p.BottomSurface = 0
  103. p.Parent = model
  104. local m = Instance.new("CylinderMesh")
  105. m.Scale = Vector3.new(0.2, 0.1, 0.2)
  106. m.Parent = p
  107. local w = Instance.new("Weld")
  108. w.Part0 = p
  109. w.Part1 = pm
  110. w.C0 = CFrame.new(0, 0.5, 0)
  111. w.C1 = CFrame.new()
  112. w.Parent = p
  113. local p = Instance.new("Part")
  114. p.Name = "Syringe Needle"
  115. p.FormFactor = "Custom"
  116. p.Size = Vector3.new(1, 1, 1)
  117. p.BrickColor = BrickColor.new("Medium stone grey")
  118. p.CanCollide = false
  119. p.Locked = true
  120. p.TopSurface = 0
  121. p.BottomSurface = 0
  122. p.Parent = model
  123. local m = Instance.new("CylinderMesh")
  124. m.Scale = Vector3.new(0.01, 1, 0.01)
  125. m.Parent = p
  126. local w = Instance.new("Weld")
  127. w.Part0 = p
  128. w.Part1 = pm
  129. w.C0 = CFrame.new(0, 1, 0)
  130. w.C1 = CFrame.new()
  131. w.Parent = p
  132. return model
  133. end
  134.  
  135.  
  136. function removeParts(format)
  137. if format == "hand" then
  138. pcall(function() Player.Character[Name]:Remove() end)
  139. elseif format == "holster" then
  140. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  141. end
  142. end
  143.  
  144.  
  145. function SetAngle(Joint, Angle, Character)
  146. if Character == nil then return false end
  147. local Joints = {
  148. Character.Torso:FindFirstChild("Right Shoulder 2"),
  149. Character.Torso:FindFirstChild("Left Shoulder 2"),
  150. Character.Torso:FindFirstChild("Right Hip 2"),
  151. Character.Torso:FindFirstChild("Left Hip 2")
  152. }
  153. if Joints[Joint] == nil then return false end
  154. if Joint == 1 or Joint == 3 then
  155. Joints[Joint].DesiredAngle = Angle
  156. end
  157. if Joint == 2 or Joint == 4 then
  158. Joints[Joint].DesiredAngle = -Angle
  159. end
  160. end
  161.  
  162.  
  163. function ForceAngle(Joint, Angle, Character)
  164. if Character == nil then return false end
  165. local Joints = {
  166. Character.Torso:FindFirstChild("Right Shoulder 2"),
  167. Character.Torso:FindFirstChild("Left Shoulder 2"),
  168. Character.Torso:FindFirstChild("Right Hip 2"),
  169. Character.Torso:FindFirstChild("Left Hip 2")
  170. }
  171. if Joints[Joint] == nil then return false end
  172. if Joint == 1 or Joint == 3 then
  173. Joints[Joint].DesiredAngle = Angle
  174. Joints[Joint].CurrentAngle = Angle
  175. end
  176. if Joint == 2 or Joint == 4 then
  177. Joints[Joint].DesiredAngle = -Angle
  178. Joints[Joint].CurrentAngle = -Angle
  179. end
  180. end
  181.  
  182.  
  183. function SetSpeed(Joint, Speed, Character)
  184. if Character == nil then return false end
  185. local Joints = {
  186. Character.Torso:FindFirstChild("Right Shoulder 2"),
  187. Character.Torso:FindFirstChild("Left Shoulder 2"),
  188. Character.Torso:FindFirstChild("Right Hip 2"),
  189. Character.Torso:FindFirstChild("Left Hip 2")
  190. }
  191. if Joints[Joint] == nil then return false end
  192. Joints[Joint].MaxVelocity = Speed
  193. end
  194.  
  195.  
  196. function DisableLimb(Limb, Character)
  197. if Character == nil then return false end
  198. if Character:FindFirstChild("Torso") == nil then return false end
  199. local Joints = {
  200. Character.Torso:FindFirstChild("Right Shoulder"),
  201. Character.Torso:FindFirstChild("Left Shoulder"),
  202. Character.Torso:FindFirstChild("Right Hip"),
  203. Character.Torso:FindFirstChild("Left Hip")
  204. }
  205. local Limbs = {
  206. Character:FindFirstChild("Right Arm"),
  207. Character:FindFirstChild("Left Arm"),
  208. Character:FindFirstChild("Right Leg"),
  209. Character:FindFirstChild("Left Leg")
  210. }
  211. if Joints[Limb] == nil then return false end
  212. if Limbs[Limb] == nil then return false end
  213. local Joint = Instance.new("Motor")
  214. Joint.Parent = Character.Torso
  215. Joint.Part0 = Character.Torso
  216. Joint.Part1 = Limbs[Limb]
  217. if Limb == 1 then
  218. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  219. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  220. Joint.Name = "Right Shoulder 2"
  221. elseif Limb == 2 then
  222. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  223. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  224. Joint.Name = "Left Shoulder 2"
  225. elseif Limb == 3 then
  226. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  227. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  228. Joint.Name = "Right Hip 2"
  229. elseif Limb == 4 then
  230. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  231. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  232. Joint.Name = "Left Hip 2"
  233. end
  234. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  235. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  236. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  237. Joints[Limb]:Remove()
  238. end
  239.  
  240.  
  241. function ResetLimbCFrame(Limb, Character)
  242. if Character == nil then return false end
  243. if Character.Parent == nil then return false end
  244. if Character:FindFirstChild("Torso") == nil then return false end
  245. local Joints = {
  246. Character.Torso:FindFirstChild("Right Shoulder 2"),
  247. Character.Torso:FindFirstChild("Left Shoulder 2"),
  248. Character.Torso:FindFirstChild("Right Hip 2"),
  249. Character.Torso:FindFirstChild("Left Hip 2")
  250. }
  251. local Limbs = {
  252. Character:FindFirstChild("Right Arm"),
  253. Character:FindFirstChild("Left Arm"),
  254. Character:FindFirstChild("Right Leg"),
  255. Character:FindFirstChild("Left Leg")
  256. }
  257. if Joints[Limb] == nil then return false end
  258. if Limbs[Limb] == nil then return false end
  259. if Limb == 1 then
  260. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  261. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  262. elseif Limb == 2 then
  263. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  264. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  265. elseif Limb == 3 then
  266. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  267. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  268. elseif Limb == 4 then
  269. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  270. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  271. end
  272. end
  273.  
  274.  
  275. function EnableLimb(Limb, Character)
  276. if Character == nil then return false end
  277. if Character:FindFirstChild("Torso") == nil then return false end
  278. local Joints = {
  279. Character.Torso:FindFirstChild("Right Shoulder 2"),
  280. Character.Torso:FindFirstChild("Left Shoulder 2"),
  281. Character.Torso:FindFirstChild("Right Hip 2"),
  282. Character.Torso:FindFirstChild("Left Hip 2")
  283. }
  284. local Limbs = {
  285. Character:FindFirstChild("Right Arm"),
  286. Character:FindFirstChild("Left Arm"),
  287. Character:FindFirstChild("Right Leg"),
  288. Character:FindFirstChild("Left Leg")
  289. }
  290. if Joints[Limb] == nil then return false end
  291. if Limbs[Limb] == nil then return false end
  292. if Limb == 1 then
  293. Joints[Limb].Name = "Right Shoulder"
  294. elseif Limb == 2 then
  295. Joints[Limb].Name = "Left Shoulder"
  296. elseif Limb == 3 then
  297. Joints[Limb].Name = "Right Hip"
  298. elseif Limb == 4 then
  299. Joints[Limb].Name = "Left Hip"
  300. end
  301. Animate = Character:FindFirstChild("Animate")
  302. if Animate == nil then return false end
  303. Animate = Animate:Clone()
  304. Character.Animate:Remove()
  305. Animate.Parent = Character
  306. end
  307.  
  308.  
  309. function onButton1Down(mouse)
  310. if selected == false or CanUse == false then return end
  311. if Player.Character:FindFirstChild(Name) ~= nil then
  312. local Model = nil
  313. if mouse.Target ~= nil then
  314. if mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil and mouse.Target.Parent:FindFirstChild("Torso") ~= nil then
  315. Model = mouse.Target.Parent
  316. if (Model.Torso.Position - Player.Character[Name]["Syringe Needle"].Position).magnitude > 3 then return end
  317. end
  318. end
  319. if Model == nil then
  320. if Player.Character:FindFirstChild("Humanoid") ~= nil and Player.Character:FindFirstChild("Torso") ~= nil then
  321. Model = Player.Character
  322. end
  323. end
  324. if Model == nil then return end
  325. if Model:FindFirstChild("IsPoisoned") ~= nil then return end
  326. CanUse = false
  327. coroutine.wrap(function()
  328. Instance.new("Model", Model).Name = "IsPoisoned"
  329. for i = Model.Humanoid.Health, Model.Humanoid.MaxHealth, 5 do
  330. Model.Humanoid.Health = i
  331. wait()
  332. end
  333. Model.Humanoid.Health = Model.Humanoid.MaxHealth
  334. wait(1)
  335. local Player2 = game:GetService("Players"):GetPlayerFromCharacter(Model)
  336. if Player2 ~= nil then
  337. if Player2:FindFirstChild("PlayerGui") ~= nil then
  338. local Gui = Instance.new("ScreenGui")
  339. Gui.Name = "Poison"
  340. Gui.Parent = Player2.PlayerGui
  341. local Frame = Instance.new("Frame")
  342. Frame.Name = "Black"
  343. Frame.Size = UDim2.new(2, 0, 2, 0)
  344. Frame.Position = UDim2.new(-0.5, 0, -0.5, 0)
  345. Frame.BackgroundColor3 = Color3.new(0.05, 0, 0.1)
  346. Frame.BackgroundTransparency = 0
  347. Frame.Parent = Gui
  348. Gui.Parent = Player2.PlayerGui
  349. end
  350. end
  351. while Model.Humanoid.Health > 1 and Model:FindFirstChild("IsPoisoned") ~= nil do
  352. Model.Humanoid.Health = Model.Humanoid.Health - 0.25
  353. pcall(function() Player2.PlayerGui.Poison.Black.BackgroundTransparency = Model.Humanoid.Health / Model.Humanoid.MaxHealth end)
  354. Model.Humanoid.WalkSpeed = (Model.Humanoid.Health / Model.Humanoid.MaxHealth) * 16
  355. wait()
  356. end
  357. if Model:FindFirstChild("IsPoisoned") ~= nil then
  358. Model.Humanoid.Health = 0
  359. else
  360. for i = Player2.PlayerGui.Poison.Black.BackgroundTransparency, 1, 0.05 do
  361. pcall(function() Player2.PlayerGui.Poison.Black.BackgroundTransparency = i end)
  362. wait()
  363. end
  364. pcall(function() Player2.PlayerGui.Poison:Remove() end)
  365. end
  366. end)()
  367. if Model == Player.Character then
  368. SetSpeed(1, 0.1, Model)
  369. for i = 90, 0, -10 do
  370. SetAngle(1, math.rad(5), Model)
  371. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  372. wait()
  373. end
  374. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  375. end
  376. coroutine.wrap(function()
  377. for i = 0, 1, 0.1 do
  378. Player.Character[Name]["Syringe Valve 1"].Weld.C0 = CFrame.new(0, -0.75 + (0.5 * i), 0)
  379. Player.Character[Name]["Syringe Valve 2"].Weld.C0 = CFrame.new(0, -1 + (0.5 * i), 0)
  380. wait()
  381. end
  382. wait(0.25)
  383. for i = 1, 0, -0.05 do
  384. Player.Character[Name]["Syringe Valve 1"].Weld.C0 = CFrame.new(0, -0.75 + (0.5 * i), 0)
  385. Player.Character[Name]["Syringe Valve 2"].Weld.C0 = CFrame.new(0, -1 + (0.5 * i), 0)
  386. wait()
  387. end
  388. end)()
  389. if Model == Player.Character then
  390. wait(0.75)
  391. SetSpeed(1, 0.1, Model)
  392. for i = 0, 90, 15 do
  393. SetAngle(1, math.rad(90), Model)
  394. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  395. wait()
  396. end
  397. ResetLimbCFrame(1, Model)
  398. end
  399. CanUse = true
  400. end
  401. end
  402.  
  403.  
  404. function onKeyDown(key, mouse)
  405. if selected == false then return end
  406. key = key:lower()
  407. if key == "q" and CanUse == true then
  408. if mouse.Target == nil then return end
  409. if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
  410. onDeselected(mouse)
  411. removeParts("holster")
  412. script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
  413. end
  414. end
  415. end
  416.  
  417.  
  418. function onSelected(mouse)
  419. if selected == true then return end
  420. selected = true
  421. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  422. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  423. if Player.Character.WeaponActivated.Value == nil then break end
  424. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  425. wait()
  426. end
  427. local weapon = Instance.new("ObjectValue")
  428. weapon.Name = "WeaponActivated"
  429. weapon.Value = script.Parent
  430. weapon.Parent = Player.Character
  431. DisableLimb(1, Player.Character)
  432. SetAngle(1, math.rad(90), Player.Character)
  433. removeParts("holster")
  434. makeParts("hand")
  435. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  436. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  437. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  438. end
  439.  
  440.  
  441. function onDeselected(mouse)
  442. if selected == false then return end
  443. Button1Down = false
  444. while canFire == false do
  445. wait()
  446. end
  447. selected = false
  448. removeParts("hand")
  449. makeParts("holster")
  450. ForceAngle(1, 0, Player.Character)
  451. EnableLimb(1, Player.Character)
  452. if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
  453. if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
  454. if Player.Character.WeaponActivated.Value == script.Parent then
  455. Player.Character.WeaponActivated:Remove()
  456. end
  457. end
  458. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  459. if Player.Character.WeaponActivated.Value == nil then break end
  460. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  461. wait()
  462. end
  463. end
  464.  
  465.  
  466. if script.Parent.ClassName ~= "HopperBin" then
  467. if Player == nil then print("Error: Player not found!") return end
  468. Tool = Instance.new("HopperBin")
  469. Tool.Name = Name
  470. Tool.Parent = Player.Backpack
  471. script.Name = "Main"
  472. script.Parent = Tool
  473. elseif script.Parent.ClassName == "HopperBin" then
  474. end wait() if script.Parent.ClassName == "HopperBin" then
  475. while script.Parent.Parent.ClassName ~= "Backpack" do
  476. wait()
  477. end
  478. Player = script.Parent.Parent.Parent
  479. makeParts("holster")
  480. script.Parent.Selected:connect(onSelected)
  481. script.Parent.Deselected:connect(onDeselected)
  482. end
Add Comment
Please, Sign In to add comment