istealscripts

Lightsaber

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