austin2820

Untitled

Jan 7th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.10 KB | None | 0 0
  1. --[[
  2. Lightsaber
  3. A compact plasma emitter with a self-destruct delay that makes it look like a sword.
  4. Models:
  5. - 1, Single blade
  6. - 2, Single blade dual
  7. - 3, Dual blade
  8. - 4, Dual blade dual
  9. Good colors:
  10. - Lime green
  11. - Really red
  12. - Royal purple
  13. - Really blue
  14. - Institutional white
  15. - New Yeller
  16. - Hot pink
  17. - Neon orange
  18. --]]
  19.  
  20.  
  21. if script == nil then return end
  22. ModelName = "Lightsaber"
  23. ModelType = 2
  24. Color = BrickColor.new("Really blue")
  25. Stance = tostring(ModelType / 2):match("%.") and 0 or 1
  26. Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("DarkShadow6")
  27. Selected = false
  28. Connected = false
  29. Button1Down = false
  30. CanUse = true
  31. Activated = false
  32. FirstPerson = game:GetService("InsertService"):LoadAsset(60568552)["FirstPerson"].Value
  33. MouseAim = game:GetService("InsertService"):LoadAsset(61527949)["MouseAim"].Value
  34.  
  35.  
  36. function CheckPlayer()
  37. if Player.Character == nil then return false end
  38. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  39. if Player.Character.Humanoid.Health <= 0 then return false end
  40. return true
  41. end
  42.  
  43.  
  44. loadstring(game:GetService("InsertService"):LoadAsset(65363615)["tagHumanoid"].Value)()
  45.  
  46.  
  47. loadstring(game:GetService("InsertService"):LoadAsset(63178291)["CameraPunch"].Value)()
  48.  
  49.  
  50. loadstring(game:GetService("InsertService"):LoadAsset(62991657)["PacketFunctions"].Value)()
  51.  
  52.  
  53. loadstring(game:GetService("InsertService"):LoadAsset(65636834)["CFrameTween"].Value)()
  54.  
  55.  
  56. function onPlasmaTouched(Source, Hit)
  57. if Activated == false then return end
  58. if Player.Character == nil or Player.Character:FindFirstChild("Humanoid") == nil or Player.Character.Humanoid.Health <= 0 then return end
  59. if Hit:IsDescendantOf(Player.Character) then return end
  60. if Hit.Name == "Lightsaber Effect" then return end
  61. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  62. if Humanoid ~= nil and Humanoid.Health > 0 then
  63. tagHumanoid(Humanoid)
  64. Humanoid:TakeDamage(2.5)
  65. coroutine.wrap(function() wait(0.1) untagHumanoid(Humanoid) end)()
  66. else
  67. local Dust = Instance.new("Part", Workspace)
  68. Dust.Name = "Lightsaber Effect"
  69. Dust.TopSurface = 0
  70. Dust.BottomSurface = 0
  71. Dust.BrickColor = Color
  72. Dust.CanCollide = false
  73. Dust.Locked = true
  74. Dust.Anchored = true
  75. Dust.FormFactor = "Custom"
  76. Dust.Size = Vector3.new(1, 1, 1)
  77. Dust.CFrame = Source.CFrame * CFrame.new(math.random(-1000, 1000) / 1000, math.random(-2000, 2000) / 1000, math.random(-1000, 1000) / 1000)
  78. local Mesh = Instance.new("SpecialMesh", Dust)
  79. Mesh.MeshType = "Sphere"
  80. Mesh.Scale = Vector3.new(0, 0, 0)
  81. coroutine.wrap(function()
  82. local Size = math.random(500, 2000) / 1000
  83. for i = 0, 1, 0.1 do
  84. Mesh.Scale = Size * i * Vector3.new(1, 1, 1)
  85. Dust.Transparency = i
  86. wait()
  87. end
  88. Dust:Remove()
  89. end)()
  90. end
  91. end
  92.  
  93.  
  94. function CreateParts(Parent, Format)
  95. if Parent == nil then return end
  96. local Parts = Instance.new("Model")
  97. Parts.Name = ModelName
  98. if Format == 1 then
  99. Parts.Name = Parts.Name.. " (Holstered)"
  100. elseif Format == 3 or Format == 5 then
  101. Parts.Name = Parts.Name.. " (Dual)"
  102. end
  103. Parts.Parent = Parent
  104. local Handle = Instance.new("Part", Parts)
  105. Handle.Name = "Handle"
  106. Handle.BrickColor = BrickColor.new("Medium stone grey")
  107. Handle.BottomSurface = 0
  108. Handle.TopSurface = 0
  109. Handle.FormFactor = "Custom"
  110. Handle.Size = Vector3.new(0.35, 1.5, 0.35)
  111. Instance.new("CylinderMesh", Handle)
  112. local Weld = Instance.new("Weld", Handle)
  113. Weld.Part0 = Weld.Parent
  114. if Format == 1 then
  115. Weld.Part1 = Player.Character:FindFirstChild("Right Leg")
  116. Weld.C0 = CFrame.new(-0.7, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0)
  117. elseif Format == 2 or Format == 4 then
  118. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  119. Weld.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  120. elseif Format == 3 or Format == 5 then
  121. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  122. Weld.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  123. end
  124.  
  125. local Part = Instance.new("Part", Parts)
  126. Part.Name = "Plasma"
  127. Part.BrickColor = BrickColor.new("Institutional white")
  128. Part.BottomSurface = 0
  129. Part.TopSurface = 0
  130. Part.FormFactor = "Custom"
  131. Part.Size = Vector3.new(0.2, 3, 0.2)
  132. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0, 1)
  133. local Weld = Instance.new("Weld", Part)
  134. Weld.Part0 = Weld.Parent
  135. Weld.Part1 = Handle
  136. Weld.C0 = CFrame.new(0, -2.25, 0)
  137. Weld.C1 = CFrame.new(0, -2.25, 0)
  138.  
  139. Part.Touched:connect(function(Hit) onPlasmaTouched(Part, Hit) end)
  140.  
  141. local Part = Instance.new("Part", Parts)
  142. Part.Name = "Plasma Top"
  143. Part.BrickColor = BrickColor.new("Institutional white")
  144. Part.BottomSurface = 0
  145. Part.TopSurface = 0
  146. Part.FormFactor = "Custom"
  147. Part.Size = Vector3.new(0.2, 1, 0.2)
  148. Instance.new("SpecialMesh", Part).MeshType = "Sphere"
  149. local Weld = Instance.new("Weld", Part)
  150. Weld.Part0 = Weld.Parent
  151. Weld.Part1 = Handle
  152. Weld.C0 = CFrame.new(0, -3.75, 0)
  153. Weld.C1 = CFrame.new(0, -3.75, 0)
  154.  
  155. if Format > 3 then
  156. local Part = Instance.new("Part", Parts)
  157. Part.Name = "Plasma 2"
  158. Part.BrickColor = BrickColor.new("Institutional white")
  159. Part.BottomSurface = 0
  160. Part.TopSurface = 0
  161. Part.FormFactor = "Custom"
  162. Part.Size = Vector3.new(0.2, 3, 0.2)
  163. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0, 1)
  164. local Weld = Instance.new("Weld", Part)
  165. Weld.Part0 = Weld.Parent
  166. Weld.Part1 = Handle
  167. Weld.C0 = CFrame.new(0, 2.25, 0)
  168. Weld.C1 = CFrame.new(0, 2.25, 0)
  169.  
  170. Part.Touched:connect(function(Hit) onPlasmaTouched(Part, Hit) end)
  171.  
  172. local Part = Instance.new("Part", Parts)
  173. Part.Name = "Plasma 2 Top"
  174. Part.BrickColor = BrickColor.new("Institutional white")
  175. Part.BottomSurface = 0
  176. Part.TopSurface = 0
  177. Part.FormFactor = "Custom"
  178. Part.Size = Vector3.new(0.2, 1, 0.2)
  179. Instance.new("SpecialMesh", Part).MeshType = "Sphere"
  180. local Weld = Instance.new("Weld", Part)
  181. Weld.Part0 = Weld.Parent
  182. Weld.Part1 = Handle
  183. Weld.C0 = CFrame.new(0, 3.75, 0)
  184. Weld.C1 = CFrame.new(0, 3.75, 0)
  185. end
  186.  
  187. local Part = Instance.new("Part", Parts)
  188. Part.Name = "Grip 1"
  189. Part.BrickColor = BrickColor.new("Dark stone grey")
  190. Part.BottomSurface = 0
  191. Part.TopSurface = 0
  192. Part.FormFactor = "Custom"
  193. Part.Size = Vector3.new(0.36, 0.2, 0.36)
  194. Instance.new("CylinderMesh", Part)
  195. local Weld = Instance.new("Weld", Part)
  196. Weld.Part0 = Weld.Parent
  197. Weld.Part1 = Handle
  198. Weld.C0 = CFrame.new(0, 0.4, 0)
  199.  
  200. local Part = Instance.new("Part", Parts)
  201. Part.Name = "Grip 2"
  202. Part.BrickColor = BrickColor.new("Dark stone grey")
  203. Part.BottomSurface = 0
  204. Part.TopSurface = 0
  205. Part.FormFactor = "Custom"
  206. Part.Size = Vector3.new(0.36, 0.2, 0.36)
  207. Instance.new("CylinderMesh", Part)
  208. local Weld = Instance.new("Weld", Part)
  209. Weld.Part0 = Weld.Parent
  210. Weld.Part1 = Handle
  211. Weld.C0 = CFrame.new(0, -0.4, 0)
  212.  
  213. local Part = Instance.new("Part", Parts)
  214. Part.Name = "Button"
  215. Part.BrickColor = BrickColor.new("Dark red")
  216. Part.BottomSurface = 0
  217. Part.TopSurface = 0
  218. Part.FormFactor = "Custom"
  219. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  220. local Mesh = Instance.new("SpecialMesh", Part)
  221. Mesh.MeshType = "Brick"
  222. Mesh.Scale = Vector3.new(0.1 / 0.2, 1, 1)
  223. local Weld = Instance.new("Weld", Part)
  224. Weld.Part0 = Weld.Parent
  225. Weld.Part1 = Handle
  226. Weld.C0 = CFrame.new(0, 0.-0.3, 0.1)
  227.  
  228. for _, Part in pairs(Parts:GetChildren()) do
  229. Part.Locked = true
  230. Part.CanCollide = false
  231. if Part.Name:match("Plasma") then
  232. for i = 0.01, 0.14, 0.01 do
  233. local Clone = Part:Clone()
  234. Clone.Name = Clone.Name.. " Glow " ..i
  235. Clone.Transparency = 0.925
  236. Clone.BrickColor = Color
  237. Clone.Size = Clone.Size + Vector3.new(i, Part.Name:match("Top") and i or 0, i)
  238. pcall(function() Clone.Weld:Remove() end)
  239. Clone.Parent = Parts
  240. local Weld = Instance.new("Weld", Clone)
  241. Weld.Part0 = Weld.Parent
  242. Weld.Part1 = Part
  243. Part.Mesh.Changed:connect(function(Property)
  244. Clone.Mesh[Property] = Part.Mesh[Property]
  245. end)
  246. end
  247. end
  248. end
  249. end
  250.  
  251.  
  252. function SetAngle(Joint, Angle, Character)
  253. if Character == nil then return false end
  254. local Joints = {
  255. Character.Torso:FindFirstChild("Right Shoulder 2"),
  256. Character.Torso:FindFirstChild("Left Shoulder 2"),
  257. Character.Torso:FindFirstChild("Right Hip 2"),
  258. Character.Torso:FindFirstChild("Left Hip 2")
  259. }
  260. if Joints[Joint] == nil then return false end
  261. if Joint == 1 or Joint == 3 then
  262. Joints[Joint].DesiredAngle = Angle
  263. end
  264. if Joint == 2 or Joint == 4 then
  265. Joints[Joint].DesiredAngle = -Angle
  266. end
  267. end
  268.  
  269.  
  270. function ForceAngle(Joint, Angle, Character)
  271. if Character == 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. if Joints[Joint] == nil then return false end
  279. if Joint == 1 or Joint == 3 then
  280. Joints[Joint].DesiredAngle = Angle
  281. Joints[Joint].CurrentAngle = Angle
  282. end
  283. if Joint == 2 or Joint == 4 then
  284. Joints[Joint].DesiredAngle = -Angle
  285. Joints[Joint].CurrentAngle = -Angle
  286. end
  287. end
  288.  
  289.  
  290. function SetSpeed(Joint, Speed, Character)
  291. if Character == nil then return false end
  292. local Joints = {
  293. Character.Torso:FindFirstChild("Right Shoulder 2"),
  294. Character.Torso:FindFirstChild("Left Shoulder 2"),
  295. Character.Torso:FindFirstChild("Right Hip 2"),
  296. Character.Torso:FindFirstChild("Left Hip 2")
  297. }
  298. if Joints[Joint] == nil then return false end
  299. Joints[Joint].MaxVelocity = Speed
  300. end
  301.  
  302.  
  303. function DisableLimb(Limb, Character)
  304. if Character == nil then return false end
  305. if Character:FindFirstChild("Torso") == nil then return false end
  306. local Joints = {
  307. Character.Torso:FindFirstChild("Right Shoulder"),
  308. Character.Torso:FindFirstChild("Left Shoulder"),
  309. Character.Torso:FindFirstChild("Right Hip"),
  310. Character.Torso:FindFirstChild("Left Hip")
  311. }
  312. local Limbs = {
  313. Character:FindFirstChild("Right Arm"),
  314. Character:FindFirstChild("Left Arm"),
  315. Character:FindFirstChild("Right Leg"),
  316. Character:FindFirstChild("Left Leg")
  317. }
  318. if Joints[Limb] == nil then return false end
  319. if Limbs[Limb] == nil then return false end
  320. local Joint = Instance.new("Motor6D")
  321. Joint.Parent = Character.Torso
  322. Joint.Part0 = Character.Torso
  323. Joint.Part1 = Limbs[Limb]
  324. if Limb == 1 then
  325. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  326. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  327. Joint.Name = "Right Shoulder 2"
  328. elseif Limb == 2 then
  329. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  330. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  331. Joint.Name = "Left Shoulder 2"
  332. elseif Limb == 3 then
  333. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  334. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  335. Joint.Name = "Right Hip 2"
  336. elseif Limb == 4 then
  337. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  338. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  339. Joint.Name = "Left Hip 2"
  340. end
  341. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  342. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  343. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  344. Joints[Limb]:Remove()
  345. end
  346.  
  347.  
  348. function ResetLimbCFrame(Limb, Character)
  349. if Character == nil then return false end
  350. if Character.Parent == nil then return false end
  351. if Character:FindFirstChild("Torso") == nil then return false end
  352. local Joints = {
  353. Character.Torso:FindFirstChild("Right Shoulder 2"),
  354. Character.Torso:FindFirstChild("Left Shoulder 2"),
  355. Character.Torso:FindFirstChild("Right Hip 2"),
  356. Character.Torso:FindFirstChild("Left Hip 2")
  357. }
  358. local Limbs = {
  359. Character:FindFirstChild("Right Arm"),
  360. Character:FindFirstChild("Left Arm"),
  361. Character:FindFirstChild("Right Leg"),
  362. Character:FindFirstChild("Left Leg")
  363. }
  364. if Joints[Limb] == nil then return false end
  365. if Limbs[Limb] == nil then return false end
  366. if Limb == 1 then
  367. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  368. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  369. elseif Limb == 2 then
  370. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  371. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  372. elseif Limb == 3 then
  373. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  374. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  375. elseif Limb == 4 then
  376. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  377. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  378. end
  379. end
  380.  
  381.  
  382. function EnableLimb(Limb, Character)
  383. if Character == nil then return false end
  384. if Character:FindFirstChild("Torso") == nil then return false end
  385. local Joints = {
  386. Character.Torso:FindFirstChild("Right Shoulder 2"),
  387. Character.Torso:FindFirstChild("Left Shoulder 2"),
  388. Character.Torso:FindFirstChild("Right Hip 2"),
  389. Character.Torso:FindFirstChild("Left Hip 2")
  390. }
  391. local Limbs = {
  392. Character:FindFirstChild("Right Arm"),
  393. Character:FindFirstChild("Left Arm"),
  394. Character:FindFirstChild("Right Leg"),
  395. Character:FindFirstChild("Left Leg")
  396. }
  397. if Joints[Limb] == nil then return false end
  398. if Limbs[Limb] == nil then return false end
  399. if Limb == 1 then
  400. Joints[Limb].Name = "Right Shoulder"
  401. elseif Limb == 2 then
  402. Joints[Limb].Name = "Left Shoulder"
  403. elseif Limb == 3 then
  404. Joints[Limb].Name = "Right Hip"
  405. elseif Limb == 4 then
  406. Joints[Limb].Name = "Left Hip"
  407. end
  408. Animate = Character:FindFirstChild("Animate")
  409. if Animate == nil then return false end
  410. Animate = Animate:Clone()
  411. Character.Animate:Remove()
  412. Animate.Parent = Character
  413. end
  414.  
  415.  
  416. function Stand()
  417. if Stance == 0 then
  418. if ModelType == 2 or ModelType == 4 then
  419. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  420. CFrame.new(),
  421. 0.1, true)
  422. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  423. CFrame.new(-0.7, 0.4, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(20)),
  424. 0.1, true)
  425. else
  426. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  427. CFrame.new(0, 0.4, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(50)),
  428. 0.1, true)
  429. end
  430. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  431. CFrame.new(),
  432. 0.1, true)
  433. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  434. CFrame.fromEulerAnglesXYZ(0, math.rad(20), 0),
  435. 0.1, true)
  436. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  437. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-20), 0),
  438. 0.1, true)
  439. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  440. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(20)),
  441. 0.1, true)
  442. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C1",
  443. CFrame.new(0, 0.5, 0),
  444. 0.1, true)
  445. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  446. CFrame.new(0, 0.5, 0),
  447. 0.1, false)
  448. elseif Stance == 1 then
  449. if ModelType == 2 or ModelType == 4 then
  450. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  451. CFrame.new(),
  452. 0.1, true)
  453. end
  454. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  455. CFrame.fromEulerAnglesXYZ(0, math.rad(20), 0),
  456. 0.1, true)
  457. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  458. CFrame.fromEulerAnglesXYZ(0, math.rad(40), 0),
  459. 0.1, true)
  460. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  461. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-40), 0),
  462. 0.1, true)
  463. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  464. CFrame.new(1.3, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(80), 0, math.rad(40)),
  465. 0.1, true)
  466. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C1",
  467. CFrame.new(0, 0.5, 0),
  468. 0.1, true)
  469. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  470. CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-30), math.rad(-40), math.rad(-30)),
  471. 0.1, true)
  472. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  473. CFrame.new(0, 0.5, 0),
  474. 0.1, false)
  475. elseif Stance == 2 then
  476. if ModelType == 2 or ModelType == 4 then
  477. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  478. CFrame.new(),
  479. 0.1, true)
  480. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  481. CFrame.new(-1.2, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-90)),
  482. 0.1, true)
  483. else
  484. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  485. CFrame.new(-1.2, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-40)),
  486. 0.1, true)
  487. end
  488. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  489. CFrame.new(),
  490. 0.1, true)
  491. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  492. CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0),
  493. 0.1, true)
  494. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  495. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0),
  496. 0.1, true)
  497. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  498. CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(1), 0, math.rad(90)),
  499. 0.1, true)
  500. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C1",
  501. CFrame.new(0, 0.5, 0),
  502. 0.1, true)
  503. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  504. CFrame.new(0, 0.5, 0),
  505. 0.1, false)
  506. end
  507. end
  508.  
  509.  
  510. function onButton1Down(Mouse)
  511. if Button1Down == true then return end
  512. Button1Down = true
  513. if CheckPlayer() == false then return end
  514. if CanUse == true and Activated == true then
  515. CanUse = false
  516. SetSpeed(1, 0.5, Player.Character)
  517. while Button1Down == true and Selected == true do
  518. SoundToServer("Slash", "http://www.roblox.com/Asset/?id=11998777", math.random(800, 1200) / 1000, 1, false, Player.Character[ModelName].Handle)
  519. local Move = math.random(1, 2)
  520. if Move == 1 then
  521. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  522. CFrame.fromEulerAnglesXYZ(0, math.rad(70), 0),
  523. 0.2, true)
  524. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  525. CFrame.fromEulerAnglesXYZ(0, math.rad(60), 0),
  526. 0.2, true)
  527. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  528. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-60), 0),
  529. 0.2, true)
  530. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  531. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(100), 0, math.rad(-20)),
  532. 0.2, true)
  533. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  534. CFrame.new(-1, 0.4, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(20), 0, math.rad(-20)),
  535. 0.2, false)
  536.  
  537. if ModelType == 2 or ModelType == 4 then
  538. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  539. CFrame.fromEulerAnglesXYZ(0, math.rad(-60), 0),
  540. 0.2, true)
  541. end
  542.  
  543. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  544. CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0),
  545. 0.2, true)
  546. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  547. CFrame.fromEulerAnglesXYZ(0, math.rad(-10), 0),
  548. 0.2, true)
  549. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  550. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10), 0),
  551. 0.2, true)
  552. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  553. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(150)),
  554. 0.2, true)
  555. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  556. CFrame.new(-1, 0.4, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(40), 0, math.rad(-30)),
  557. 0.2, false)
  558.  
  559. if Button1Down == true and (ModelType == 2 or ModelType == 4) then
  560. SoundToServer("Slash", "http://www.roblox.com/Asset/?id=11998777", math.random(1000, 1500) / 1000, 1, false, Player.Character[ModelName].Handle)
  561. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  562. CFrame.fromEulerAnglesXYZ(0, math.rad(-110), 0),
  563. 0.2, true)
  564. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  565. CFrame.fromEulerAnglesXYZ(0, math.rad(-60), 0),
  566. 0.2, true)
  567. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  568. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(60), 0),
  569. 0.2, true)
  570. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  571. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(110), 0, math.rad(80)),
  572. 0.2, true)
  573. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  574. CFrame.new(-1, 0.375, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(60), 0, math.rad(50)),
  575. 0.2, false)
  576. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  577. CFrame.new(),
  578. 0.2, true)
  579. wait()
  580. end
  581. elseif Move == 2 then
  582. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  583. CFrame.new(),
  584. 0.2, true)
  585. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  586. CFrame.fromEulerAnglesXYZ(0, math.rad(20), 0),
  587. 0.2, true)
  588. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  589. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(20), math.rad(-20), 0),
  590. 0.2, true)
  591. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  592. CFrame.new(1.5, 0.6, 0),
  593. 0.2, true)
  594. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C1",
  595. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-160), math.rad(20), 0),
  596. 0.2, true)
  597. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  598. CFrame.new(-1, 0.4, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(-20), 0, math.rad(-30)),
  599. 0.2, false)
  600.  
  601. if ModelType == 2 or ModelType == 4 then
  602. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  603. CFrame.fromEulerAnglesXYZ(0, math.rad(-20), 0),
  604. 0.2, true)
  605. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  606. CFrame.new(-1.5, 0.4, 0),
  607. 0.2, true)
  608. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  609. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(20), math.rad(20), 0),
  610. 0.2, true)
  611. else
  612. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  613. CFrame.new(-1.3, 0.4, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(-80), 0, math.rad(-30)),
  614. 0.2, true)
  615. end
  616.  
  617. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  618. CFrame.fromEulerAnglesXYZ(0, math.rad(25), 0),
  619. 0.2, true)
  620. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  621. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-30), math.rad(-25), 0),
  622. 0.2, true)
  623. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C1",
  624. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(20), math.rad(20), 0),
  625. 0.2, false)
  626.  
  627. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C1",
  628. CFrame.new(0, 0.5, 0),
  629. 0.5, true)
  630. wait()
  631.  
  632. if Button1Down == true and (ModelType == 2 or ModelType == 4) then
  633. SoundToServer("Slash", "http://www.roblox.com/Asset/?id=11998777", math.random(1000, 1500) / 1000, 1, false, Player.Character[ModelName].Handle)
  634. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  635. CFrame.fromEulerAnglesXYZ(0, math.rad(120), 0),
  636. 0.25, true)
  637. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  638. CFrame.fromEulerAnglesXYZ(0, math.rad(-40), 0),
  639. 0.25, true)
  640. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  641. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(20), math.rad(40), math.rad(-20)),
  642. 0.25, true)
  643. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  644. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(30), 0, math.rad(30)),
  645. 0.25, true)
  646. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  647. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-50), 0),
  648. 0.25, false)
  649.  
  650. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  651. CFrame.fromEulerAnglesXYZ(0, math.rad(170), 0),
  652. 0.2, true)
  653. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  654. CFrame.fromEulerAnglesXYZ(0, math.rad(-80), 0),
  655. 0.2, true)
  656. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  657. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(30), math.rad(80), math.rad(-30)),
  658. 0.2, true)
  659. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  660. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-160), math.rad(-20), 0),
  661. 0.2, false)
  662.  
  663. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  664. CFrame.new(),
  665. 0.4, true)
  666. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  667. CFrame.fromEulerAnglesXYZ(0, math.rad(-30), 0),
  668. 0.4, true)
  669. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  670. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(10), math.rad(30), math.rad(-10)),
  671. 0.4, true)
  672. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C1",
  673. CFrame.new(0, 0.5, 0),
  674. 0.4, true)
  675. wait()
  676. end
  677. elseif Move == 3 then
  678.  
  679. end
  680. end
  681. Stand()
  682. CanUse = true
  683. end
  684. end
  685.  
  686.  
  687. function onButton1Up(Mouse)
  688. Button1Down = false
  689. end
  690.  
  691.  
  692. function onKeyDown(Key, Mouse)
  693. if Selected == false then return end
  694. Key = Key:lower()
  695. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  696. if Key == "q" then
  697. if Mouse.Target == nil then return end
  698. if CheckPlayer() == false then return end
  699. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  700. if NewPlayer == nil then return end
  701. if NewPlayer.Character == nil then return end
  702. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  703. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  704. onDeselected(Mouse)
  705. wait()
  706. RemoveParts(Player.Character, 1)
  707. script.Parent.Parent = NewPlayer.Backpack
  708. Player = NewPlayer
  709. elseif Key == "y" then
  710. CanUse = false
  711. Stance = Stance + 1
  712. if Stance > 2 then
  713. Stance = 0
  714. end
  715. Stand()
  716. CanUse = true
  717. elseif Key == "e" then
  718. CanUse = false
  719. Activated = not Activated
  720. if Activated == true then
  721. SoundToServer("Start", "http://www.roblox.com/Asset/?id=11998796", 1, 0.8, false, Player.Character[ModelName].Handle)
  722. SoundToServer("Start", "http://www.roblox.com/Asset/?id=11998777", 0.6, 1, false, Player.Character[ModelName].Handle)
  723. SoundToServer("Start", "http://www.roblox.com/Asset/?id=2974000", 1.8, 0.3, false, Player.Character[ModelName].Handle)
  724. else
  725. SoundToServer("Buzz", "http://www.roblox.com/Asset/?id=2974000", -1.3, 1, true, Player.Character[ModelName].Handle)
  726. SendToServer([[for _, Part in pairs(Source:GetChildren()) do
  727. if Part.ClassName == "Sound" and Part.Name == "Buzz" then
  728. coroutine.wrap(function()
  729. wait(0.4)
  730. for i = Part.Volume, 0, -0.1 do
  731. Part.Volume = i
  732. wait()
  733. end
  734. wait(1)
  735. Part:Remove()
  736. Part:Stop()
  737. end)()
  738. end
  739. end]], "Sound Stop", {"Source", Player.Character[ModelName].Handle})
  740. end
  741. for i = Activated == true and 1 or 0, Activated == true and 0 or 1, 0.05 * (Activated == true and -1 or 1) do
  742. pcall(function()
  743. Player.Character[ModelName].Plasma.Weld.C1 = CFrame.new(0, Player.Character[ModelName].Plasma.Weld.C0.y * i, 0)
  744. Player.Character[ModelName]["Plasma Top"].Weld.C1 = CFrame.new(0, Player.Character[ModelName].Plasma.Weld.C1.y - ((Player.Character[ModelName].Plasma.Size.y / 2) * i), 0)
  745. Player.Character[ModelName].Plasma.Mesh.Scale = Vector3.new(1, 1 - i, 1)
  746. Player.Character[ModelName]["Plasma Top"].Mesh.Scale = Vector3.new(1, 1 - i, 1)
  747. Player.Character[ModelName.. " (Dual)"].Plasma.Weld.C1 = CFrame.new(0, Player.Character[ModelName].Plasma.Weld.C0.y * i, 0)
  748. Player.Character[ModelName.. " (Dual)"]["Plasma Top"].Weld.C1 = CFrame.new(0, Player.Character[ModelName].Plasma.Weld.C1.y - ((Player.Character[ModelName].Plasma.Size.y / 2) * i), 0)
  749. Player.Character[ModelName.. " (Dual)"].Plasma.Mesh.Scale = Vector3.new(1, 1 - i, 1)
  750. Player.Character[ModelName.. " (Dual)"]["Plasma Top"].Mesh.Scale = Vector3.new(1, 1 - i, 1)
  751. end)
  752. pcall(function()
  753. Player.Character[ModelName]["Plasma 2"].Weld.C1 = CFrame.new(0, Player.Character[ModelName]["Plasma 2"].Weld.C0.y * i, 0)
  754. Player.Character[ModelName]["Plasma 2 Top"].Weld.C1 = CFrame.new(0, Player.Character[ModelName]["Plasma 2"].Weld.C1.y + ((Player.Character[ModelName]["Plasma 2"].Size.y / 2) * i), 0)
  755. Player.Character[ModelName]["Plasma 2"].Mesh.Scale = Vector3.new(1, 1 - i, 1)
  756. Player.Character[ModelName]["Plasma 2 Top"].Mesh.Scale = Vector3.new(1, 1 - i, 1)
  757. Player.Character[ModelName.. " (Dual)"]["Plasma 2"].Weld.C1 = CFrame.new(0, Player.Character[ModelName]["Plasma 2"].Weld.C0.y * i, 0)
  758. Player.Character[ModelName.. " (Dual)"]["Plasma 2 Top"].Weld.C1 = CFrame.new(0, Player.Character[ModelName]["Plasma 2"].Weld.C1.y + ((Player.Character[ModelName]["Plasma 2"].Size.y / 2) * i), 0)
  759. Player.Character[ModelName.. " (Dual)"]["Plasma 2"].Mesh.Scale = Vector3.new(1, 1 - i, 1)
  760. Player.Character[ModelName.. " (Dual)"]["Plasma 2 Top"].Mesh.Scale = Vector3.new(1, 1 - i, 1)
  761. end)
  762. wait()
  763. end
  764. if Activated == true then
  765. pcall(function()
  766. Player.Character[ModelName].Plasma.Weld.C1 = CFrame.new()
  767. Player.Character[ModelName]["Plasma Top"].Weld.C1 = CFrame.new()
  768. Player.Character[ModelName].Plasma.Mesh.Scale = Vector3.new(1, 1, 1)
  769. Player.Character[ModelName]["Plasma Top"].Mesh.Scale = Vector3.new(1, 1, 1)
  770. Player.Character[ModelName.. " (Dual)"].Plasma.Weld.C1 = CFrame.new()
  771. Player.Character[ModelName.. " (Dual)"]["Plasma Top"].Weld.C1 = CFrame.new()
  772. Player.Character[ModelName.. " (Dual)"].Plasma.Mesh.Scale = Vector3.new(1, 1, 1)
  773. Player.Character[ModelName.. " (Dual)"]["Plasma Top"].Mesh.Scale = Vector3.new(1, 1, 1)
  774. end)
  775. pcall(function()
  776. Player.Character[ModelName]["Plasma 2"].Weld.C1 = CFrame.new()
  777. Player.Character[ModelName]["Plasma 2 Top"].Weld.C1 = CFrame.new()
  778. Player.Character[ModelName]["Plasma 2"].Mesh.Scale = Vector3.new(1, 1, 1)
  779. Player.Character[ModelName]["Plasma 2 Top"].Mesh.Scale = Vector3.new(1, 1, 1)
  780. Player.Character[ModelName.. " (Dual)"]["Plasma 2"].Weld.C1 = CFrame.new()
  781. Player.Character[ModelName.. " (Dual)"]["Plasma 2 Top"].Weld.C1 = CFrame.new()
  782. Player.Character[ModelName.. " (Dual)"]["Plasma 2"].Mesh.Scale = Vector3.new(1, 1, 1)
  783. Player.Character[ModelName.. " (Dual)"]["Plasma 2 Top"].Mesh.Scale = Vector3.new(1, 1, 1)
  784. end)
  785. SoundToServer("Buzz", "http://www.roblox.com/Asset/?id=11998796", 0.5, 0.4, true, Player.Character[ModelName].Handle)
  786. coroutine.wrap(function()
  787. wait(0.9)
  788. if Activated == false then
  789. return
  790. end
  791. SoundToServer("Buzz", "http://www.roblox.com/Asset/?id=11998796", 0.5, 0.4, true, Player.Character[ModelName].Handle)
  792. end)()
  793. end
  794. CanUse = true
  795. end
  796. if Activated == true then
  797. if Key == "r" then
  798. CanUse = false
  799. KeyRDown = true
  800. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  801. CFrame.fromEulerAnglesXYZ(0, math.rad(50), 0),
  802. 0.15, true)
  803. PropertyCFrameTween(Player.Character.AimGyroAdd, "Value",
  804. CFrame.fromEulerAnglesXYZ(0, math.rad(80), 0),
  805. 0.15, true)
  806. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  807. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-80), 0),
  808. 0.15, true)
  809. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  810. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(-30)),
  811. 0.15, true)
  812. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  813. CFrame.new(-1.3, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(60), 0, math.rad(-20)),
  814. 0.15, false)
  815.  
  816. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  817. CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0),
  818. 0.2, true)
  819. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  820. CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10), 0),
  821. 0.2, true)
  822. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  823. CFrame.new(0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(150)),
  824. 0.2, true)
  825. if ModelType == 2 or ModelType == 4 then
  826. PropertyCFrameTween(Player.Character[ModelName.. " (Dual)"].Handle.Weld, "C1",
  827. CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0),
  828. 0.2, true)
  829. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  830. CFrame.new(-0.9, 0.4, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(-30)),
  831. 0.2, true)
  832. else
  833. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  834. CFrame.new(-1, 0.4, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(80), 0, math.rad(-30)),
  835. 0.2, true)
  836. end
  837.  
  838. local Stop = false
  839. for i = 80, -math.huge, -25 do
  840. if KeyRDown == false or Selected == false then
  841. Stop = true
  842. end
  843. if Stop == true and i % 360 < 25 then
  844. break
  845. end
  846. SoundToServer("Slash", "http://www.roblox.com/Asset/?id=11998777", 0.9, 0.3, false, Player.Character[ModelName].Handle)
  847. Player.Character.AimGyroAdd.Value = CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  848. wait()
  849. end
  850. Stand()
  851. CanUse = true
  852. end
  853. end
  854. end
  855. end
  856.  
  857.  
  858. function onKeyUp(Key, Mouse)
  859. if Selected == false then return end
  860. Key = Key:lower()
  861. if Key == "r" then
  862. KeyRDown = false
  863. end
  864. end
  865.  
  866.  
  867. function RemoveParts(Parent, Format)
  868. if Format == 1 then
  869. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  870. elseif Format == 2 then
  871. pcall(function() Parent[ModelName]:Remove() end)
  872. elseif Format == 3 or Format == 5 then
  873. pcall(function() Parent[ModelName.. " (Dual)"]:Remove() end)
  874. end
  875. end
  876.  
  877.  
  878. function onSelected(Mouse)
  879. if script.Parent.Active == false then return end
  880. if Selected == true then return end
  881. CanUse = false
  882. while true do
  883. if CheckPlayer() == true then
  884. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
  885. break
  886. end
  887. end
  888. wait(0.1)
  889. end
  890. Selected = true
  891. if script.Parent.Active == false then return end
  892. DisableLimb(1, Player.Character)
  893. SetSpeed(1, 0.5, Player.Character)
  894. SetAngle(1, 0, Player.Character)
  895. DisableLimb(2, Player.Character)
  896. SetSpeed(2, 0.5, Player.Character)
  897. SetAngle(2, 0, Player.Character)
  898. wait(0.2)
  899. RemoveParts(Player.Character, 1)
  900. if ModelType == 1 or ModelType == 2 then
  901. CreateParts(Player.Character, 2)
  902. elseif ModelType == 3 or ModelType == 4 then
  903. CreateParts(Player.Character, 4)
  904. end
  905. if ModelType == 2 then
  906. CreateParts(Player.Character, 3)
  907. elseif ModelType == 4 then
  908. CreateParts(Player.Character, 5)
  909. end
  910. Player.Character.Torso["Neck"].C0 = CFrame.new(0, 1, 0)
  911. Player.Character.Torso["Neck"].C1 = CFrame.new(0, -0.5, 0)
  912. Player.Character.Torso:FindFirstChild("Left Shoulder 2").C0 = CFrame.new(-1.5, 0.5, 0)
  913. Player.Character.Torso:FindFirstChild("Left Shoulder 2").C1 = CFrame.new(0, 0.5, 0)
  914. Player.Character.Torso:FindFirstChild("Right Shoulder 2").C0 = CFrame.new(1.5, 0.5, 0)
  915. Player.Character.Torso:FindFirstChild("Right Shoulder 2").C1 = CFrame.new(0, 0.5, 0)
  916. local AimGyroAdd = Instance.new("CFrameValue", Player.Character)
  917. AimGyroAdd.Name = "AimGyroAdd"
  918. Stand()
  919. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  920. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  921. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  922. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  923. Mouse.KeyUp:connect(function(Key) onKeyUp(Key, Mouse) end)
  924. CanUse = true
  925. end
  926.  
  927.  
  928. function onDeselected(Mouse)
  929. if Selected == false then return end
  930. Selected = false
  931. while CanUse == false do wait() end
  932. if Selected == true then return end
  933. if Activated == true then
  934. Selected = true
  935. onKeyDown("e", Mouse)
  936. Selected = false
  937. end
  938. CanUse = false
  939. Player.Character.AimGyroAdd:Remove()
  940. PropertyCFrameTween(Player.Character[ModelName].Handle.Weld, "C1",
  941. CFrame.new(),
  942. 0.2, true)
  943. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Neck"), "C0",
  944. CFrame.new(0, 1, 0),
  945. 0.2, true)
  946. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Right Shoulder 2"), "C0",
  947. CFrame.new(1.5, 0.5, 0),
  948. 0.2, true)
  949. PropertyCFrameTween(Player.Character.Torso:FindFirstChild("Left Shoulder 2"), "C0",
  950. CFrame.new(-1.5, 0.5, 0),
  951. 0.2, false)
  952. RemoveParts(Player.Character, 2)
  953. RemoveParts(Player.Character, 3)
  954. RemoveParts(Player.Character, 5)
  955. CreateParts(Player.Character, 1)
  956. Player.Character.Torso["Neck"].C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180))
  957. Player.Character.Torso["Neck"].C1 = CFrame.new(0, -0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180))
  958. SetAngle(1, 0, Player.Character)
  959. ResetLimbCFrame(1, Player.Character)
  960. EnableLimb(1, Player.Character)
  961. SetAngle(2, 0, Player.Character)
  962. ResetLimbCFrame(2, Player.Character)
  963. EnableLimb(2, Player.Character)
  964. CanUse = true
  965. end
  966.  
  967.  
  968. if script.Parent.ClassName ~= "HopperBin" then
  969. if Player == nil then print("Error: Player not found!") return end
  970. Tool = Instance.new("HopperBin")
  971. Tool.Name = ModelName
  972. Tool.Parent = Player.Backpack
  973. script.Name = "Main"
  974. script.Parent = Tool
  975. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  976. Connected = true
  977. Player = script.Parent.Parent.Parent
  978. script.Parent.Selected:connect(onSelected)
  979. script.Parent.Deselected:connect(onDeselected)
  980. CreateParts(Player.Character, 1)
  981. coroutine.wrap(loadstring(FirstPerson))()
  982. coroutine.wrap(loadstring(MouseAim))()
  983. end
Advertisement
Add Comment
Please, Sign In to add comment