Advertisement
Robloxlover12445

Poison Syringe

Oct 20th, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.31 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--[[
  483. Poison Syringe
  484.  
  485. Syringe filled with a deadly poison that slowly kills its' host.
  486. Script by DarkShadow6
  487. --]]
  488.  
  489.  
  490. if script == nil then return end
  491.  
  492.  
  493. Player = game:GetService("Players").LocalPlayer
  494. Char = Player.Character
  495. animate = Char:findFirstChild("Animate")
  496. if animate then
  497. animate:Destroy()
  498. end
  499. Name = "Poison Syringe"
  500. selected = false
  501. Button1Down = false
  502. CanUse = true
  503.  
  504.  
  505. function makeParts(format)
  506. local model = Instance.new("Model")
  507. model.Name = Name
  508. local pm = Instance.new("Part")
  509. pm.Name = "Handle"
  510. pm.FormFactor = "Custom"
  511. pm.Size = Vector3.new(1, 1, 1)
  512. pm.BrickColor = BrickColor.new("Institutional white")
  513. pm.Locked = true
  514. pm.TopSurface = 0
  515. pm.BottomSurface = 0
  516. pm.Parent = model
  517. local m = Instance.new("CylinderMesh")
  518. m.Scale = Vector3.new(0.25, 1, 0.25)
  519. m.Parent = pm
  520. if format ~= nil then
  521. local w = Instance.new("Weld")
  522. w.Part0 = pm
  523. if format == "hand" then
  524. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  525. w.C0 = CFrame.new(0, 0.1, 1.1) * CFrame.fromEulerAnglesXYZ(math.rad(70), 0, 0)
  526. w.C1 = CFrame.new()
  527. elseif format == "holster" then
  528. w.Part1 = Player.Character:FindFirstChild("Right Leg")
  529. w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
  530. w.C1 = CFrame.new()
  531. w.Parent = pm
  532. model.Name = Name.. " (Holstered)"
  533. end
  534. w.Parent = pm
  535. model.Parent = Player.Character
  536. end
  537. local p = Instance.new("Part")
  538. p.Name = "Syringe Valve 1"
  539. p.FormFactor = "Custom"
  540. p.Size = Vector3.new(1, 1, 1)
  541. p.BrickColor = BrickColor.new("Institutional white")
  542. p.CanCollide = false
  543. p.Locked = true
  544. p.TopSurface = 0
  545. p.BottomSurface = 0
  546. p.Parent = model
  547. local m = Instance.new("CylinderMesh")
  548. m.Scale = Vector3.new(0.15, 0.5, 0.15)
  549. m.Parent = p
  550. local w = Instance.new("Weld")
  551. w.Part0 = p
  552. w.Part1 = pm
  553. w.C0 = CFrame.new(0, -0.75, 0)
  554. w.C1 = CFrame.new()
  555. w.Parent = p
  556. local p = Instance.new("Part")
  557. p.Name = "Syringe Valve 2"
  558. p.FormFactor = "Custom"
  559. p.Size = Vector3.new(1, 1, 1)
  560. p.BrickColor = BrickColor.new("Institutional white")
  561. p.CanCollide = false
  562. p.Locked = true
  563. p.TopSurface = 0
  564. p.BottomSurface = 0
  565. p.Parent = model
  566. local m = Instance.new("CylinderMesh")
  567. m.Scale = Vector3.new(0.3, 0.01, 0.3)
  568. m.Parent = p
  569. local w = Instance.new("Weld")
  570. w.Part0 = p
  571. w.Part1 = pm
  572. w.C0 = CFrame.new(0, -1, 0)
  573. w.C1 = CFrame.new()
  574. w.Parent = p
  575. local p = Instance.new("Part")
  576. p.Name = "Syringe Tip"
  577. p.FormFactor = "Custom"
  578. p.Size = Vector3.new(1, 1, 1)
  579. p.BrickColor = BrickColor.new("Institutional white")
  580. p.CanCollide = false
  581. p.Locked = true
  582. p.TopSurface = 0
  583. p.BottomSurface = 0
  584. p.Parent = model
  585. local m = Instance.new("CylinderMesh")
  586. m.Scale = Vector3.new(0.2, 0.1, 0.2)
  587. m.Parent = p
  588. local w = Instance.new("Weld")
  589. w.Part0 = p
  590. w.Part1 = pm
  591. w.C0 = CFrame.new(0, 0.5, 0)
  592. w.C1 = CFrame.new()
  593. w.Parent = p
  594. local p = Instance.new("Part")
  595. p.Name = "Syringe Needle"
  596. p.FormFactor = "Custom"
  597. p.Size = Vector3.new(1, 1, 1)
  598. p.BrickColor = BrickColor.new("Medium stone grey")
  599. p.CanCollide = false
  600. p.Locked = true
  601. p.TopSurface = 0
  602. p.BottomSurface = 0
  603. p.Parent = model
  604. local m = Instance.new("CylinderMesh")
  605. m.Scale = Vector3.new(0.01, 1, 0.01)
  606. m.Parent = p
  607. local w = Instance.new("Weld")
  608. w.Part0 = p
  609. w.Part1 = pm
  610. w.C0 = CFrame.new(0, 1, 0)
  611. w.C1 = CFrame.new()
  612. w.Parent = p
  613. return model
  614. end
  615.  
  616.  
  617. function removeParts(format)
  618. if format == "hand" then
  619. pcall(function() Player.Character[Name]:Remove() end)
  620. elseif format == "holster" then
  621. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  622. end
  623. end
  624.  
  625.  
  626. function SetAngle(Joint, Angle, Character)
  627. if Character == nil then return false end
  628. local Joints = {
  629. Character.Torso:FindFirstChild("Right Shoulder 2"),
  630. Character.Torso:FindFirstChild("Left Shoulder 2"),
  631. Character.Torso:FindFirstChild("Right Hip 2"),
  632. Character.Torso:FindFirstChild("Left Hip 2")
  633. }
  634. if Joints[Joint] == nil then return false end
  635. if Joint == 1 or Joint == 3 then
  636. Joints[Joint].DesiredAngle = Angle
  637. end
  638. if Joint == 2 or Joint == 4 then
  639. Joints[Joint].DesiredAngle = -Angle
  640. end
  641. end
  642.  
  643.  
  644. function ForceAngle(Joint, Angle, Character)
  645. if Character == nil then return false end
  646. local Joints = {
  647. Character.Torso:FindFirstChild("Right Shoulder 2"),
  648. Character.Torso:FindFirstChild("Left Shoulder 2"),
  649. Character.Torso:FindFirstChild("Right Hip 2"),
  650. Character.Torso:FindFirstChild("Left Hip 2")
  651. }
  652. if Joints[Joint] == nil then return false end
  653. if Joint == 1 or Joint == 3 then
  654. Joints[Joint].DesiredAngle = Angle
  655. Joints[Joint].CurrentAngle = Angle
  656. end
  657. if Joint == 2 or Joint == 4 then
  658. Joints[Joint].DesiredAngle = -Angle
  659. Joints[Joint].CurrentAngle = -Angle
  660. end
  661. end
  662.  
  663.  
  664. function SetSpeed(Joint, Speed, Character)
  665. if Character == nil then return false end
  666. local Joints = {
  667. Character.Torso:FindFirstChild("Right Shoulder 2"),
  668. Character.Torso:FindFirstChild("Left Shoulder 2"),
  669. Character.Torso:FindFirstChild("Right Hip 2"),
  670. Character.Torso:FindFirstChild("Left Hip 2")
  671. }
  672. if Joints[Joint] == nil then return false end
  673. Joints[Joint].MaxVelocity = Speed
  674. end
  675.  
  676.  
  677. function DisableLimb(Limb, Character)
  678. if Character == nil then return false end
  679. if Character:FindFirstChild("Torso") == nil then return false end
  680. local Joints = {
  681. Character.Torso:FindFirstChild("Right Shoulder"),
  682. Character.Torso:FindFirstChild("Left Shoulder"),
  683. Character.Torso:FindFirstChild("Right Hip"),
  684. Character.Torso:FindFirstChild("Left Hip")
  685. }
  686. local Limbs = {
  687. Character:FindFirstChild("Right Arm"),
  688. Character:FindFirstChild("Left Arm"),
  689. Character:FindFirstChild("Right Leg"),
  690. Character:FindFirstChild("Left Leg")
  691. }
  692. if Joints[Limb] == nil then return false end
  693. if Limbs[Limb] == nil then return false end
  694. local Joint = Instance.new("Motor")
  695. Joint.Parent = Character.Torso
  696. Joint.Part0 = Character.Torso
  697. Joint.Part1 = Limbs[Limb]
  698. if Limb == 1 then
  699. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  700. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  701. Joint.Name = "Right Shoulder 2"
  702. elseif Limb == 2 then
  703. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  704. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  705. Joint.Name = "Left Shoulder 2"
  706. elseif Limb == 3 then
  707. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  708. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  709. Joint.Name = "Right Hip 2"
  710. elseif Limb == 4 then
  711. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  712. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  713. Joint.Name = "Left Hip 2"
  714. end
  715. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  716. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  717. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  718. Joints[Limb]:Remove()
  719. end
  720.  
  721.  
  722. function ResetLimbCFrame(Limb, Character)
  723. if Character == nil then return false end
  724. if Character.Parent == nil then return false end
  725. if Character:FindFirstChild("Torso") == nil then return false end
  726. local Joints = {
  727. Character.Torso:FindFirstChild("Right Shoulder 2"),
  728. Character.Torso:FindFirstChild("Left Shoulder 2"),
  729. Character.Torso:FindFirstChild("Right Hip 2"),
  730. Character.Torso:FindFirstChild("Left Hip 2")
  731. }
  732. local Limbs = {
  733. Character:FindFirstChild("Right Arm"),
  734. Character:FindFirstChild("Left Arm"),
  735. Character:FindFirstChild("Right Leg"),
  736. Character:FindFirstChild("Left Leg")
  737. }
  738. if Joints[Limb] == nil then return false end
  739. if Limbs[Limb] == nil then return false end
  740. if Limb == 1 then
  741. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  742. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  743. elseif Limb == 2 then
  744. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  745. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  746. elseif Limb == 3 then
  747. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  748. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  749. elseif Limb == 4 then
  750. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  751. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  752. end
  753. end
  754.  
  755.  
  756. function EnableLimb(Limb, Character)
  757. if Character == nil then return false end
  758. if Character:FindFirstChild("Torso") == nil then return false end
  759. local Joints = {
  760. Character.Torso:FindFirstChild("Right Shoulder 2"),
  761. Character.Torso:FindFirstChild("Left Shoulder 2"),
  762. Character.Torso:FindFirstChild("Right Hip 2"),
  763. Character.Torso:FindFirstChild("Left Hip 2")
  764. }
  765. local Limbs = {
  766. Character:FindFirstChild("Right Arm"),
  767. Character:FindFirstChild("Left Arm"),
  768. Character:FindFirstChild("Right Leg"),
  769. Character:FindFirstChild("Left Leg")
  770. }
  771. if Joints[Limb] == nil then return false end
  772. if Limbs[Limb] == nil then return false end
  773. if Limb == 1 then
  774. Joints[Limb].Name = "Right Shoulder"
  775. elseif Limb == 2 then
  776. Joints[Limb].Name = "Left Shoulder"
  777. elseif Limb == 3 then
  778. Joints[Limb].Name = "Right Hip"
  779. elseif Limb == 4 then
  780. Joints[Limb].Name = "Left Hip"
  781. end
  782. Animate = Character:FindFirstChild("Animate")
  783. if Animate == nil then return false end
  784. Animate = Animate:Clone()
  785. Character.Animate:Remove()
  786. Animate.Parent = Character
  787. end
  788.  
  789.  
  790. function onButton1Down(mouse)
  791. if selected == false or CanUse == false then return end
  792. if Player.Character:FindFirstChild(Name) ~= nil then
  793. local Model = nil
  794. if mouse.Target ~= nil then
  795. if mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil and mouse.Target.Parent:FindFirstChild("Torso") ~= nil then
  796. Model = mouse.Target.Parent
  797. if (Model.Torso.Position - Player.Character[Name]["Syringe Needle"].Position).magnitude > 3 then return end
  798. end
  799. end
  800. if Model == nil then
  801. if Player.Character:FindFirstChild("Humanoid") ~= nil and Player.Character:FindFirstChild("Torso") ~= nil then
  802. Model = Player.Character
  803. end
  804. end
  805. if Model == nil then return end
  806. if Model:FindFirstChild("IsPoisoned") ~= nil then return end
  807. CanUse = false
  808. coroutine.wrap(function()
  809. Instance.new("Model", Model).Name = "IsPoisoned"
  810. for i = Model.Humanoid.Health, Model.Humanoid.MaxHealth, 5 do
  811. Model.Humanoid.Health = i
  812. wait()
  813. end
  814. Model.Humanoid.Health = Model.Humanoid.MaxHealth
  815. wait(1)
  816. local Player2 = game:GetService("Players"):GetPlayerFromCharacter(Model)
  817. if Player2 ~= nil then
  818. if Player2:FindFirstChild("PlayerGui") ~= nil then
  819. local Gui = Instance.new("ScreenGui")
  820. Gui.Name = "Poison"
  821. Gui.Parent = Player2.PlayerGui
  822. local Frame = Instance.new("Frame")
  823. Frame.Name = "Black"
  824. Frame.Size = UDim2.new(2, 0, 2, 0)
  825. Frame.Position = UDim2.new(-0.5, 0, -0.5, 0)
  826. Frame.BackgroundColor3 = Color3.new(0.05, 0, 0.1)
  827. Frame.BackgroundTransparency = 0
  828. Frame.Parent = Gui
  829. Gui.Parent = Player2.PlayerGui
  830. end
  831. end
  832. while Model.Humanoid.Health > 1 and Model:FindFirstChild("IsPoisoned") ~= nil do
  833. Model.Humanoid.Health = Model.Humanoid.Health - 0.25
  834. pcall(function() Player2.PlayerGui.Poison.Black.BackgroundTransparency = Model.Humanoid.Health / Model.Humanoid.MaxHealth end)
  835. Model.Humanoid.WalkSpeed = (Model.Humanoid.Health / Model.Humanoid.MaxHealth) * 16
  836. wait()
  837. end
  838. if Model:FindFirstChild("IsPoisoned") ~= nil then
  839. Model.Humanoid.Health = 0
  840. else
  841. for i = Player2.PlayerGui.Poison.Black.BackgroundTransparency, 1, 0.05 do
  842. pcall(function() Player2.PlayerGui.Poison.Black.BackgroundTransparency = i end)
  843. wait()
  844. end
  845. pcall(function() Player2.PlayerGui.Poison:Remove() end)
  846. end
  847. end)()
  848. if Model == Player.Character then
  849. SetSpeed(1, 0.1, Model)
  850. for i = 90, 0, -10 do
  851. SetAngle(1, math.rad(5), Model)
  852. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  853. wait()
  854. end
  855. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  856. end
  857. coroutine.wrap(function()
  858. for i = 0, 1, 0.1 do
  859. Player.Character[Name]["Syringe Valve 1"].Weld.C0 = CFrame.new(0, -0.75 + (0.5 * i), 0)
  860. Player.Character[Name]["Syringe Valve 2"].Weld.C0 = CFrame.new(0, -1 + (0.5 * i), 0)
  861. wait()
  862. end
  863. wait(0.25)
  864. for i = 1, 0, -0.05 do
  865. Player.Character[Name]["Syringe Valve 1"].Weld.C0 = CFrame.new(0, -0.75 + (0.5 * i), 0)
  866. Player.Character[Name]["Syringe Valve 2"].Weld.C0 = CFrame.new(0, -1 + (0.5 * i), 0)
  867. wait()
  868. end
  869. end)()
  870. if Model == Player.Character then
  871. wait(0.75)
  872. SetSpeed(1, 0.1, Model)
  873. for i = 0, 90, 15 do
  874. SetAngle(1, math.rad(90), Model)
  875. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  876. wait()
  877. end
  878. ResetLimbCFrame(1, Model)
  879. end
  880. CanUse = true
  881. end
  882. end
  883.  
  884.  
  885. function onKeyDown(key, mouse)
  886. if selected == false then return end
  887. key = key:lower()
  888. if key == "q" and CanUse == true then
  889. if mouse.Target == nil then return end
  890. if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
  891. onDeselected(mouse)
  892. removeParts("holster")
  893. script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
  894. end
  895. end
  896. end
  897.  
  898.  
  899. function onSelected(mouse)
  900. if selected == true then return end
  901. selected = true
  902. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  903. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  904. if Player.Character.WeaponActivated.Value == nil then break end
  905. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  906. wait()
  907. end
  908. local weapon = Instance.new("ObjectValue")
  909. weapon.Name = "WeaponActivated"
  910. weapon.Value = script.Parent
  911. weapon.Parent = Player.Character
  912. DisableLimb(1, Player.Character)
  913. SetAngle(1, math.rad(90), Player.Character)
  914. removeParts("holster")
  915. makeParts("hand")
  916. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  917. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  918. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  919. end
  920.  
  921.  
  922. function onDeselected(mouse)
  923. if selected == false then return end
  924. Button1Down = false
  925. while canFire == false do
  926. wait()
  927. end
  928. selected = false
  929. removeParts("hand")
  930. makeParts("holster")
  931. ForceAngle(1, 0, Player.Character)
  932. EnableLimb(1, Player.Character)
  933. if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
  934. if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
  935. if Player.Character.WeaponActivated.Value == script.Parent then
  936. Player.Character.WeaponActivated:Remove()
  937. end
  938. end
  939. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  940. if Player.Character.WeaponActivated.Value == nil then break end
  941. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  942. wait()
  943. end
  944. end
  945.  
  946.  
  947. if script.Parent.ClassName ~= "HopperBin" then
  948. if Player == nil then print("Error: Player not found!") return end
  949. Tool = Instance.new("HopperBin")
  950. Tool.Name = Name
  951. Tool.Parent = Player.Backpack
  952. script.Name = "Main"
  953. script.Parent = Tool
  954. elseif script.Parent.ClassName == "HopperBin" then
  955. end wait() if script.Parent.ClassName == "HopperBin" then
  956. while script.Parent.Parent.ClassName ~= "Backpack" do
  957. wait()
  958. end
  959. Player = script.Parent.Parent.Parent
  960. makeParts("holster")
  961. script.Parent.Selected:connect(onSelected)
  962. script.Parent.Deselected:connect(onDeselected)
  963. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement