Advertisement
memberhero

Untitled

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