Advertisement
Pewca

hehqgqegehq

Oct 27th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.22 KB | None | 0 0
  1. --[[
  2. Kevlar Vest
  3. An armor plate made of Kevlar.
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "Kevlar Vest"
  11. Player = Game.Players.LocalPlayer
  12. Char = Player.Character
  13. animate = Char:findFirstChild("Animate")
  14. if animate then
  15. animate:Destroy()
  16. end
  17.  
  18. Selected = false
  19. Connected = false
  20. On = false
  21. Button1Down = false
  22. CanUse = true
  23. MainColor = BrickColor.new("Black")
  24. AccentColor = BrickColor.new("Bright orange")
  25.  
  26.  
  27. --[[ CFrameTween v3 Functions: PropertyCFrameTween --]]
  28. function PropertyCFrameTween(Part, Property, End, Step, Wrap)
  29. local StartPosition = Part[Property].p
  30. local StartAngle = Vector3.new(Part[Property]:toEulerAnglesXYZ())
  31. local EndPosition = End.p
  32. local EndAngle = Vector3.new(End:toEulerAnglesXYZ())
  33. local Loop = coroutine.create(function()
  34. for i = 0, 1, Step do Part[Property] = CFrame.new((StartPosition * (1 - i)) + (EndPosition * i)) * CFrame.fromEulerAnglesXYZ( (StartAngle.x * (1 - i)) + (EndAngle.x * i), (StartAngle.y * (1 - i)) + (EndAngle.y * i), (StartAngle.z * (1 - i)) + (EndAngle.z * i) )
  35. wait()
  36. end
  37. --Part[Property] = End error()
  38. end)
  39. coroutine.resume(Loop)
  40. if Wrap ~= true
  41. then while coroutine.status(Loop) ~= "dead" do wait() end end end
  42.  
  43.  
  44. function CreateParts(Parent)
  45. if Parent == nil then return end
  46. local Parts = Instance.new("Model")
  47. Parts.Name = ModelName
  48. Parts.Parent = Player.Character
  49.  
  50. local MasterPart = Instance.new("Part")
  51. MasterPart.Name = "Handle"
  52. MasterPart.Transparency = 1
  53. MasterPart.TopSurface = 0
  54. MasterPart.BottomSurface = 0
  55. MasterPart.FormFactor = "Custom"
  56. MasterPart.Size = Vector3.new(2, 2, 1)
  57. MasterPart.Parent = Parts
  58. local Weld = Instance.new("Weld", MasterPart)
  59. Weld.Part0 = Weld.Parent
  60. Weld.Part1 = Player.Character:FindFirstChild("Torso")
  61.  
  62. local Part = Instance.new("Part")
  63. Part.Name = "Front"
  64. Part.BrickColor = MainColor
  65. Part.TopSurface = 0
  66. Part.BottomSurface = 0
  67. Part.FormFactor = "Custom"
  68. Part.Size = Vector3.new(1.7, 1, 0.2)
  69. Part.Parent = Parts
  70. local Mesh = Instance.new("SpecialMesh", Part)
  71. Mesh.MeshType = "Brick"
  72. Mesh.Scale = Vector3.new(1, 1, 0.05 / 0.2)
  73. local Weld = Instance.new("Weld", Part)
  74. Weld.Part0 = Weld.Parent
  75. Weld.Part1 = MasterPart
  76. Weld.C0 = CFrame.new(0, 0.3, 0.525)
  77.  
  78. for i = -1, 1, 2 do
  79. local Part = Instance.new("WedgePart")
  80. Part.Name = "Front Top Wedge " ..i
  81. Part.BrickColor = MainColor
  82. Part.TopSurface = 0
  83. Part.BottomSurface = 0
  84. Part.FormFactor = "Custom"
  85. Part.Size = Vector3.new(0.2, 0.7, 0.4)
  86. Part.Parent = Parts
  87. local Mesh = Instance.new("SpecialMesh", Part)
  88. Mesh.MeshType = "Wedge"
  89. Mesh.Scale = Vector3.new(0.05 / 0.2, 1, 1)
  90. local Weld = Instance.new("Weld", Part)
  91. Weld.Part0 = Weld.Parent
  92. Weld.Part1 = MasterPart
  93. Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), 0)
  94. Weld.C1 = CFrame.new(0.65 * i, 0.55, -0.525)
  95. end
  96.  
  97. for i = -1, 1, 2 do
  98. local Part = Instance.new("WedgePart")
  99. Part.Name = "Front Top Collar Wedge " ..i
  100. Part.BrickColor = MainColor
  101. Part.TopSurface = 0
  102. Part.BottomSurface = 0
  103. Part.FormFactor = "Custom"
  104. Part.Size = Vector3.new(0.2, 0.2, 0.3)
  105. Part.Parent = Parts
  106. local Mesh = Instance.new("SpecialMesh", Part)
  107. Mesh.MeshType = "Wedge"
  108. Mesh.Scale = Vector3.new(0.05 / 0.2, 1, 1)
  109. local Weld = Instance.new("Weld", Part)
  110. Weld.Part0 = Weld.Parent
  111. Weld.Part1 = MasterPart
  112. Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0)
  113. Weld.C1 = CFrame.new(0.2 * i, 0.8, -0.525)
  114. end
  115.  
  116. for i = -1, 1, 2 do
  117. local Part = Instance.new("Part")
  118. Part.Name = "Front Top Bar " ..i
  119. Part.BrickColor = MainColor
  120. Part.TopSurface = 0
  121. Part.BottomSurface = 0
  122. Part.FormFactor = "Custom"
  123. Part.Size = Vector3.new(0.2, 0.7, 0.2)
  124. Part.Parent = Parts
  125. local Mesh = Instance.new("SpecialMesh", Part)
  126. Mesh.MeshType = "Brick"
  127. Mesh.Scale = Vector3.new(0.1 / 0.2, 1, 0.05 / 0.2)
  128. local Weld = Instance.new("Weld", Part)
  129. Weld.Part0 = Weld.Parent
  130. Weld.Part1 = MasterPart
  131. Weld.C0 = CFrame.new(0.4 * i, -0.55, 0.525)
  132. end
  133.  
  134. local Part = Instance.new("Part")
  135. Part.Name = "Front Top"
  136. Part.BrickColor = MainColor
  137. Part.TopSurface = 0
  138. Part.BottomSurface = 0
  139. Part.FormFactor = "Custom"
  140. Part.Size = Vector3.new(0.7, 0.5, 0.2)
  141. Part.Parent = Parts
  142. local Mesh = Instance.new("SpecialMesh", Part)
  143. Mesh.MeshType = "Brick"
  144. Mesh.Scale = Vector3.new(1, 1, 0.05 / 0.2)
  145. local Weld = Instance.new("Weld", Part)
  146. Weld.Part0 = Weld.Parent
  147. Weld.Part1 = MasterPart
  148. Weld.C0 = CFrame.new(0, -0.45, 0.525)
  149.  
  150. for i = -0.1, 0.7, 0.2 do
  151. local Part = Instance.new("Part")
  152. Part.Name = "Front Bar " ..i
  153. Part.BrickColor = AccentColor
  154. Part.TopSurface = 0
  155. Part.BottomSurface = 0
  156. Part.FormFactor = "Custom"
  157. Part.Size = Vector3.new(1.6, 0.2, 0.2)
  158. Part.Parent = Parts
  159. local Mesh = Instance.new("SpecialMesh", Part)
  160. Mesh.MeshType = "Brick"
  161. Mesh.Scale = Vector3.new(1, 0.025 / 0.2, 0.01 / 0.2)
  162. local Weld = Instance.new("Weld", Part)
  163. Weld.Part0 = Weld.Parent
  164. Weld.Part1 = MasterPart
  165. Weld.C0 = CFrame.new(0, i, 0.55)
  166. end
  167.  
  168. for i = -1, 1, 2 do
  169. local Part = Instance.new("Part")
  170. Part.Name = "Front Top Bar " ..i
  171. Part.BrickColor = AccentColor
  172. Part.TopSurface = 0
  173. Part.BottomSurface = 0
  174. Part.FormFactor = "Custom"
  175. Part.Size = Vector3.new(0.2, 0.6, 0.2)
  176. Part.Parent = Parts
  177. local Mesh = Instance.new("SpecialMesh", Part)
  178. Mesh.MeshType = "Brick"
  179. Mesh.Scale = Vector3.new(0.025 / 0.2, 1, 0.01 / 0.2)
  180. local Weld = Instance.new("Weld", Part)
  181. Weld.Part0 = Weld.Parent
  182. Weld.Part1 = MasterPart
  183. Weld.C0 = CFrame.new(0.3375 * i, -0.4, 0.55)
  184. end
  185.  
  186. for i = -1, 1, 2 do
  187. local Part = Instance.new("Part")
  188. Part.Name = "Front Strap " ..i
  189. Part.BrickColor = MainColor
  190. Part.TopSurface = 0
  191. Part.BottomSurface = 0
  192. Part.FormFactor = "Custom"
  193. Part.Size = Vector3.new(0.2, 0.7, 0.2)
  194. Part.Parent = Parts
  195. local Mesh = Instance.new("SpecialMesh", Part)
  196. Mesh.MeshType = "Brick"
  197. Mesh.Scale = Vector3.new(1, 1, 0.025 / 0.2)
  198. local Weld = Instance.new("Weld", Part)
  199. Weld.Part0 = Weld.Parent
  200. Weld.Part1 = MasterPart
  201. Weld.C0 = CFrame.new(0.7 * i, -0.65, 0.5125)
  202. end
  203.  
  204. local Part = Instance.new("Part")
  205. Part.Name = "Back"
  206. Part.BrickColor = MainColor
  207. Part.TopSurface = 0
  208. Part.BottomSurface = 0
  209. Part.FormFactor = "Custom"
  210. Part.Size = Vector3.new(1.7, 1.3, 0.2)
  211. Part.Parent = Parts
  212. local Mesh = Instance.new("SpecialMesh", Part)
  213. Mesh.MeshType = "Brick"
  214. Mesh.Scale = Vector3.new(1, 1, 0.05 / 0.2)
  215. local Weld = Instance.new("Weld", Part)
  216. Weld.Part0 = Weld.Parent
  217. Weld.Part1 = MasterPart
  218. Weld.C0 = CFrame.new(0, 0.2, -0.525)
  219.  
  220. for i = -1, 1, 2 do
  221. local Part = Instance.new("Part")
  222. Part.Name = "Back Bar " ..i
  223. Part.BrickColor = AccentColor
  224. Part.TopSurface = 0
  225. Part.BottomSurface = 0
  226. Part.FormFactor = "Custom"
  227. Part.Size = Vector3.new(0.2, 1.3, 0.2)
  228. Part.Parent = Parts
  229. local Mesh = Instance.new("SpecialMesh", Part)
  230. Mesh.MeshType = "Brick"
  231. Mesh.Scale = Vector3.new(0.025 / 0.2, 1, 0.01 / 0.2)
  232. local Weld = Instance.new("Weld", Part)
  233. Weld.Part0 = Weld.Parent
  234. Weld.Part1 = MasterPart
  235. Weld.C0 = CFrame.new(0.3375 * i, 0.2, -0.55)
  236. end
  237.  
  238. for i = -1, 1, 2 do
  239. local Part = Instance.new("Part")
  240. Part.Name = "Back Strap " ..i
  241. Part.BrickColor = MainColor
  242. Part.TopSurface = 0
  243. Part.BottomSurface = 0
  244. Part.FormFactor = "Custom"
  245. Part.Size = Vector3.new(0.2, 0.55, 0.2)
  246. Part.Parent = Parts
  247. local Mesh = Instance.new("SpecialMesh", Part)
  248. Mesh.MeshType = "Brick"
  249. Mesh.Scale = Vector3.new(1, 1, 0.025 / 0.2)
  250. local Weld = Instance.new("Weld", Part)
  251. Weld.Part0 = Weld.Parent
  252. Weld.Part1 = MasterPart
  253. Weld.C0 = CFrame.new(0.7 * i, -0.725, -0.5125)
  254. end
  255.  
  256. for i = -1, 1, 2 do
  257. local Part = Instance.new("Part")
  258. Part.Name = "Top Strap " ..i
  259. Part.BrickColor = MainColor
  260. Part.TopSurface = 0
  261. Part.BottomSurface = 0
  262. Part.FormFactor = "Custom"
  263. Part.Size = Vector3.new(0.2, 0.2, 1.05)
  264. Part.Parent = Parts
  265. local Mesh = Instance.new("SpecialMesh", Part)
  266. Mesh.MeshType = "Brick"
  267. Mesh.Scale = Vector3.new(1, 0.025 / 0.2, 1)
  268. local Weld = Instance.new("Weld", Part)
  269. Weld.Part0 = Weld.Parent
  270. Weld.Part1 = MasterPart
  271. Weld.C0 = CFrame.new(0.7 * i, -1.0125, 0)
  272. end
  273.  
  274. for _, Part in pairs(Parts:GetChildren()) do
  275. Part.Locked = true
  276. Part.CanCollide = false
  277. end
  278. end
  279.  
  280.  
  281. function RemoveParts(Parent, Format)
  282. pcall(function() Parent[ModelName]:Remove() end)
  283. end
  284.  
  285.  
  286. function SetAngle(Joint, Angle, Character)
  287. if Character == nil then return false end
  288. local Joints = {
  289. Character.Torso:FindFirstChild("Right Shoulder 2"),
  290. Character.Torso:FindFirstChild("Left Shoulder 2"),
  291. Character.Torso:FindFirstChild("Right Hip 2"),
  292. Character.Torso:FindFirstChild("Left Hip 2")
  293. }
  294. if Joints[Joint] == nil then return false end
  295. if Joint == 1 or Joint == 3 then
  296. Joints[Joint].DesiredAngle = Angle
  297. end
  298. if Joint == 2 or Joint == 4 then
  299. Joints[Joint].DesiredAngle = -Angle
  300. end
  301. end
  302.  
  303.  
  304. function ForceAngle(Joint, Angle, Character)
  305. if Character == nil then return false end
  306. local Joints = {
  307. Character.Torso:FindFirstChild("Right Shoulder 2"),
  308. Character.Torso:FindFirstChild("Left Shoulder 2"),
  309. Character.Torso:FindFirstChild("Right Hip 2"),
  310. Character.Torso:FindFirstChild("Left Hip 2")
  311. }
  312. if Joints[Joint] == nil then return false end
  313. if Joint == 1 or Joint == 3 then
  314. Joints[Joint].DesiredAngle = Angle
  315. Joints[Joint].CurrentAngle = Angle
  316. end
  317. if Joint == 2 or Joint == 4 then
  318. Joints[Joint].DesiredAngle = -Angle
  319. Joints[Joint].CurrentAngle = -Angle
  320. end
  321. end
  322.  
  323.  
  324. function SetSpeed(Joint, Speed, Character)
  325. if Character == nil then return false end
  326. local Joints = {
  327. Character.Torso:FindFirstChild("Right Shoulder 2"),
  328. Character.Torso:FindFirstChild("Left Shoulder 2"),
  329. Character.Torso:FindFirstChild("Right Hip 2"),
  330. Character.Torso:FindFirstChild("Left Hip 2")
  331. }
  332. if Joints[Joint] == nil then return false end
  333. Joints[Joint].MaxVelocity = Speed
  334. end
  335.  
  336.  
  337. function DisableLimb(Limb, Character)
  338. if Character == nil then return false end
  339. if Character:FindFirstChild("Torso") == nil then return false end
  340. local Joints = {
  341. Character.Torso:FindFirstChild("Right Shoulder"),
  342. Character.Torso:FindFirstChild("Left Shoulder"),
  343. Character.Torso:FindFirstChild("Right Hip"),
  344. Character.Torso:FindFirstChild("Left Hip")
  345. }
  346. local Limbs = {
  347. Character:FindFirstChild("Right Arm"),
  348. Character:FindFirstChild("Left Arm"),
  349. Character:FindFirstChild("Right Leg"),
  350. Character:FindFirstChild("Left Leg")
  351. }
  352. if Joints[Limb] == nil then return false end
  353. if Limbs[Limb] == nil then return false end
  354. local Joint = Instance.new("Motor6D")
  355. Joint.Parent = Character.Torso
  356. Joint.Part0 = Character.Torso
  357. Joint.Part1 = Limbs[Limb]
  358. if Limb == 1 then
  359. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  360. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  361. Joint.Name = "Right Shoulder 2"
  362. elseif Limb == 2 then
  363. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  364. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  365. Joint.Name = "Left Shoulder 2"
  366. elseif Limb == 3 then
  367. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  368. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  369. Joint.Name = "Right Hip 2"
  370. elseif Limb == 4 then
  371. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  372. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  373. Joint.Name = "Left Hip 2"
  374. end
  375. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  376. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  377. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  378. Joints[Limb]:Remove()
  379. end
  380.  
  381.  
  382. function ResetLimbCFrame(Limb, Character)
  383. if Character == nil then return false end
  384. if Character.Parent == nil then return false end
  385. if Character:FindFirstChild("Torso") == nil then return false end
  386. local Joints = {
  387. Character.Torso:FindFirstChild("Right Shoulder 2"),
  388. Character.Torso:FindFirstChild("Left Shoulder 2"),
  389. Character.Torso:FindFirstChild("Right Hip 2"),
  390. Character.Torso:FindFirstChild("Left Hip 2")
  391. }
  392. local Limbs = {
  393. Character:FindFirstChild("Right Arm"),
  394. Character:FindFirstChild("Left Arm"),
  395. Character:FindFirstChild("Right Leg"),
  396. Character:FindFirstChild("Left Leg")
  397. }
  398. if Joints[Limb] == nil then return false end
  399. if Limbs[Limb] == nil then return false end
  400. if Limb == 1 then
  401. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  402. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  403. elseif Limb == 2 then
  404. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  405. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  406. elseif Limb == 3 then
  407. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  408. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  409. elseif Limb == 4 then
  410. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  411. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  412. end
  413. end
  414.  
  415.  
  416. function EnableLimb(Limb, Character)
  417. if Character == nil then return false end
  418. if Character:FindFirstChild("Torso") == nil then return false end
  419. local Joints = {
  420. Character.Torso:FindFirstChild("Right Shoulder 2"),
  421. Character.Torso:FindFirstChild("Left Shoulder 2"),
  422. Character.Torso:FindFirstChild("Right Hip 2"),
  423. Character.Torso:FindFirstChild("Left Hip 2")
  424. }
  425. local Limbs = {
  426. Character:FindFirstChild("Right Arm"),
  427. Character:FindFirstChild("Left Arm"),
  428. Character:FindFirstChild("Right Leg"),
  429. Character:FindFirstChild("Left Leg")
  430. }
  431. if Joints[Limb] == nil then return false end
  432. if Limbs[Limb] == nil then return false end
  433. if Limb == 1 then
  434. Joints[Limb].Name = "Right Shoulder"
  435. elseif Limb == 2 then
  436. Joints[Limb].Name = "Left Shoulder"
  437. elseif Limb == 3 then
  438. Joints[Limb].Name = "Right Hip"
  439. elseif Limb == 4 then
  440. Joints[Limb].Name = "Left Hip"
  441. end
  442. Animate = Character:FindFirstChild("Animate")
  443. if Animate == nil then return false end
  444. Animate = Animate:Clone()
  445. Character.Animate:Remove()
  446. Animate.Parent = Character
  447. end
  448.  
  449.  
  450. function Toggle()
  451. if Player.Character == nil then return false end
  452. if (Player.Character:FindFirstChild(ModelName) ~= nil and On == false) or CanUse == false or Selected == false then return end
  453. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Left Arm") == nil or Player.Character.Torso:FindFirstChild("Right Shoulder") == nil or Player.Character.Torso:FindFirstChild("Left Shoulder") == nil or Player.Character:FindFirstChild("Humanoid") == nil or Player.Character.Humanoid.Health <= 0 then
  454. if On == true then
  455. RemoveParts(Player.Character)
  456. On = false
  457. end
  458. return
  459. end
  460. CanUse = false
  461. DisableLimb(1, Player.Character)
  462. SetSpeed(1, 0.5, Player.Character)
  463. SetAngle(1, 0, Player.Character)
  464. DisableLimb(2, Player.Character)
  465. SetSpeed(2, 0.5, Player.Character)
  466. SetAngle(2, 0, Player.Character)
  467. wait(0.2)
  468. Player.Character.Torso["Neck"].C0 = CFrame.new(0, 1, 0)
  469. Player.Character.Torso["Neck"].C1 = CFrame.new(0, -0.5, 0)
  470. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0)
  471. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0, 0.5, 0)
  472. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  473. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0)
  474. On = not On
  475. if On == true then
  476. PropertyCFrameTween(Player.Character.Torso["Neck"], "C0",
  477. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-50), math.rad(-25), 0),
  478. 0.15, true)
  479. PropertyCFrameTween(Player.Character.Torso["Right Shoulder 2"], "C0",
  480. CFrame.new(1.5, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(50), math.rad(40), math.rad(-30)),
  481. 0.15, true)
  482. PropertyCFrameTween(Player.Character.Torso["Left Shoulder 2"], "C0",
  483. CFrame.new(-0.7, 0.3, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(20), math.rad(-20), math.rad(60)),
  484. 0.15, false)
  485.  
  486. CreateParts(Player.Character)
  487. coroutine.wrap(function()
  488. local Transparency = {}
  489. for i, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  490. Transparency[i] = Part.Transparency
  491. end
  492. for i = 1, 0, -0.1 do
  493. for x, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  494. Part.Transparency = Transparency[x] + ((1 - Transparency[x]) * i)
  495. end
  496. wait()
  497. end
  498. for i, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  499. Part.Transparency = Transparency[i]
  500. end
  501. end)()
  502.  
  503. local Weld = Player.Character[ModelName].Handle.Weld
  504. Weld.Part1 = Player.Character["Right Arm"]
  505. Weld.C0 = CFrame.new(0.5, 1, 1)
  506.  
  507. PropertyCFrameTween(Weld, "C0",
  508. CFrame.new(1.5, -1.8, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, 0),
  509. 0.075, true)
  510. PropertyCFrameTween(Player.Character.Torso["Neck"], "C0",
  511. CFrame.new(0, 1, 0),
  512. 0.075, true)
  513. PropertyCFrameTween(Player.Character.Torso["Right Shoulder 2"], "C0",
  514. CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, 0),
  515. 0.075, true)
  516. PropertyCFrameTween(Player.Character.Torso["Left Shoulder 2"], "C0",
  517. CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, 0),
  518. 0.075, false)
  519.  
  520. PropertyCFrameTween(Weld, "C0",
  521. CFrame.new(1.5, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, 0),
  522. 0.2, false)
  523.  
  524. RemoveParts(Player.Character)
  525. CreateParts(Player.Character)
  526.  
  527. PropertyCFrameTween(Player.Character.Torso["Neck"], "C0",
  528. CFrame.new(0, 1, 0),
  529. 0.2, true)
  530. PropertyCFrameTween(Player.Character.Torso["Right Shoulder 2"], "C0",
  531. CFrame.new(1.5, 0.5, 0),
  532. 0.2, true)
  533. PropertyCFrameTween(Player.Character.Torso["Left Shoulder 2"], "C0",
  534. CFrame.new(-1.5, 0.5, 0),
  535. 0.2, false)
  536.  
  537. local Health = Player.Character.Humanoid.Health / Player.Character.Humanoid.MaxHealth
  538. Player.Character.Humanoid.MaxHealth = Player.Character.Humanoid.MaxHealth + 200
  539. wait(0.1)
  540. Player.Character.Humanoid.Health = Player.Character.Humanoid.MaxHealth * Health
  541. else
  542. local Weld = Player.Character[ModelName].Handle.Weld
  543.  
  544. PropertyCFrameTween(Weld, "C0",
  545. CFrame.new(0, -2, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(20)),
  546. 0.1, true)
  547. PropertyCFrameTween(Player.Character.Torso["Neck"], "C0",
  548. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-20)),
  549. 0.1, true)
  550. PropertyCFrameTween(Player.Character.Torso["Right Shoulder 2"], "C0",
  551. CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, math.rad(-30)),
  552. 0.15, true)
  553. PropertyCFrameTween(Player.Character.Torso["Left Shoulder 2"], "C0",
  554. CFrame.new(-0.7, 0.3, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(80), math.rad(80)),
  555. 0.1, false)
  556.  
  557. Weld.Part1 = Player.Character["Right Arm"]
  558. Weld.C0 = CFrame.fromEulerAnglesXYZ(0, 0, math.rad(120)) * CFrame.new(0, 1, 0)
  559. coroutine.wrap(function()
  560. local Transparency = {}
  561. for i, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  562. Transparency[i] = Part.Transparency
  563. end
  564. for i = 0, 1, 0.1 do
  565. for x, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  566. Part.Transparency = Transparency[x] + ((1 - Transparency[x]) * i)
  567. end
  568. wait()
  569. end
  570. for i, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  571. Part.Transparency = Transparency[i]
  572. end
  573. RemoveParts(Player.Character)
  574. end)()
  575.  
  576. PropertyCFrameTween(Player.Character.Torso["Neck"], "C0",
  577. CFrame.new(0, 1, 0),
  578. 0.1, true)
  579. PropertyCFrameTween(Player.Character.Torso["Right Shoulder 2"], "C0",
  580. CFrame.new(1.5, 0.5, 0),
  581. 0.1, true)
  582. PropertyCFrameTween(Player.Character.Torso["Left Shoulder 2"], "C0",
  583. CFrame.new(-1.5, 0.5, 0),
  584. 0.1, false)
  585.  
  586. local Health = Player.Character.Humanoid.Health / Player.Character.Humanoid.MaxHealth
  587. Player.Character.Humanoid.MaxHealth = Player.Character.Humanoid.MaxHealth - 200
  588. wait(0.1)
  589. Player.Character.Humanoid.Health = Player.Character.Humanoid.MaxHealth * Health
  590. end
  591. Player.Character.Torso["Neck"].C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180))
  592. Player.Character.Torso["Neck"].C1 = CFrame.new(0, -0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180))
  593. ResetLimbCFrame(1, Player.Character)
  594. EnableLimb(1, Player.Character)
  595. ResetLimbCFrame(2, Player.Character)
  596. EnableLimb(2, Player.Character)
  597. CanUse = true
  598. end
  599.  
  600.  
  601. function onKeyDown(Key, Mouse)
  602. if Selected == false then return end
  603. Key = Key:lower()
  604. if Button1Down == false and CanUse == true then
  605. if Key == "q" then
  606. if Mouse.Target == nil then return end
  607. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  608. if NewPlayer == nil then return end
  609. if NewPlayer.Character == nil then return end
  610. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  611. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  612. onDeselected(Mouse)
  613. wait()
  614. if On then
  615. Selected = true
  616. Toggle()
  617. Selected = false
  618. end
  619. script.Parent.Parent = NewPlayer.Backpack
  620. Player = NewPlayer
  621. end
  622. end
  623. end
  624.  
  625.  
  626. function onSelected(Mouse)
  627. if Selected == true then return end
  628. Selected = true
  629. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  630. Mouse.Button1Down:connect(Toggle)
  631. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  632. end
  633.  
  634.  
  635. function onDeselected(Mouse)
  636. if Selected == false then return end
  637. Selected = false
  638. end
  639.  
  640.  
  641. if script.Parent.ClassName ~= "HopperBin" then
  642. if Player == nil then print("Error: Player not found!") return end
  643. Tool = Instance.new("HopperBin")
  644. Tool.Name = ModelName
  645. Tool.Parent = Player.Backpack
  646. script.Name = "Main"
  647. script.Parent = Tool
  648. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  649. Connected = true
  650. Player = script.Parent.Parent.Parent
  651. end wait() if script.Parent.ClassName == "HopperBin" then
  652. while script.Parent.Parent.ClassName ~= "Backpack" do
  653. wait()
  654. end
  655. script.Parent.Selected:connect(onSelected)
  656. script.Parent.Deselected:connect(onDeselected)
  657. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement