Advertisement
memesbruh03

the SnapSword

Feb 20th, 2017
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 52.33 KB | None | 0 0
  1. --SnapSword Gifted by adchand2, Local Script!
  2.  
  3. local _CODE = "SnapSword"
  4.  
  5.  
  6. local player = game:GetService("Players").LocalPlayer
  7. local char = player.Character
  8. local huma = char:FindFirstChild("Humanoid")
  9. local initialized, disconnectRequest = false, false
  10. local model,suited,use,processing,animate,gtarget,gs = false,false,false,false,false,false,true
  11. local w,a,s,d = false,false,false,false
  12. local bindKeyDown,bindKeyUp = false,false
  13. local hit,trail,lighting,shirt,bin = false, false, false, false, false
  14. local bPos, bGyro = Instance.new("BodyPosition"), Instance.new("BodyGyro")
  15. local delete = true
  16. local prt,_jnt,_mdl,_prt,_kup,_kdn,_mse,ms = {}
  17. local combo = 0
  18. local tol = 4
  19. local mode = 0
  20. local cfs = false
  21. local jumping = false
  22. local buttonDown = false
  23. local shirtColor = "White"
  24. local pantsColor = "White"
  25. local attachColor = "White"
  26. local sheathColor = "White"
  27. local swordHandleColor = "White"
  28. local gunColor = "White"
  29. local gunTakePos = nil
  30. local defaultWalkspeed = huma.WalkSpeed
  31.  
  32.  --==================================================-MAIN-CODE-==================================================--
  33.  
  34. h=Instance.new("Hint",workspace)
  35. h.Name="SnapNotif"
  36. h.Text="SnapSword"
  37. wait(1)
  38. h:Destroy()
  39.  
  40. bPos.maxForce = Vector3.new(0,math.huge,0)
  41. bGyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  42.  
  43. if player == nil or char == nil then return end
  44.  
  45. if not player.Backpack:FindFirstChild(_CODE) then
  46.         bin = Instance.new("HopperBin")
  47.         bin.Name = _CODE
  48.         bin.Parent = player:FindFirstChild("Backpack")
  49. else bin = player.Backpack[_CODE] end
  50.  
  51. if bin ~= nil then
  52.         script.Name = "_SnapScript"
  53.         script.Parent = nil
  54. end
  55.  
  56. local part = {
  57.         head = char:FindFirstChild("Head"),
  58.         tors = char:FindFirstChild("Torso"),ftor,
  59.         larm = char:FindFirstChild("Left Arm"),
  60.         rarm = char:FindFirstChild("Right Arm"),
  61.         lleg = char:FindFirstChild("Left Leg"),
  62.         rleg = char:FindFirstChild("Right Leg")}
  63.  
  64. local motor = {
  65.         neck = part.tors:FindFirstChild("Neck"),
  66.         lsho = part.tors:FindFirstChild("Left Shoulder"),
  67.         rsho = part.tors:FindFirstChild("Right Shoulder"),
  68.         lhip = part.tors:FindFirstChild("Left Hip"),
  69.         rhip = part.tors:FindFirstChild("Right Hip")}
  70.  
  71. for i,obj in pairs(char:GetChildren()) do
  72.         if obj:IsA("CharacterMesh") then
  73.                 obj:Destroy()
  74.         end
  75. end
  76.  
  77. function JoinInit()
  78.         while processing do wait() end
  79.         processing = true
  80.         if char:FindFirstChild("Shirt") then
  81.                 shirt = char.Shirt
  82.                 shirt.Parent = nil
  83.         end
  84.         part.ftor = part.tors:Clone()
  85.         part.ftor.Name = "_Torso2"
  86.         part.ftor.BrickColor = BrickColor.new("White")
  87.         local joint = {neck,tors,lsho,rsho,lhip,rhip}
  88.         joint.tors = Instance.new("Weld", part.tors)
  89.         joint.tors.Name = "Torso_WELD"
  90.         joint.tors.Part0 = part.tors
  91.         joint.tors.Part1 = part.ftor
  92.         part.ftor.Parent = char
  93.         part.tors.Transparency = 1
  94.         for i,join in pairs (motor) do
  95.                 local weld
  96.                 if not join.Parent:FindFirstChild(join.Name.."_WELD") then
  97.                         weld = Instance.new("Weld", join.Parent)
  98.                         weld.Name = join.Name.."_WELD"
  99.                 else weld = join.Parent[join.Name.."_WELD"] end
  100.                 if tostring(i) == "lsho" then
  101.                         weld.C0 = CFrame.new(-1.5,0.5,0)
  102.                         weld.C1 = CFrame.new(0,0.5,0)
  103.                 elseif tostring(i) == "rsho" then
  104.                         weld.C0 = CFrame.new(1.5,0.5,0)
  105.                         weld.C1 = CFrame.new(0,0.5,0)
  106.                 elseif tostring(i) == "neck" then
  107.                         weld.C0 = CFrame.new(0,1,0)
  108.                         weld.C1 = CFrame.new(0,-0.5,0)
  109.                 else
  110.                         weld.C0 = join.C0
  111.                         weld.C1 = join.C1
  112.                 end
  113.                 weld.Part1 = join.Part1
  114.                 if tostring(i) ~= "neck" then
  115.                         join.Part0 = part.ftor
  116.                 else
  117.                         weld.Part0 = part.ftor
  118.                 end
  119.                 joint[i] = weld
  120.         end
  121.         initialized = true
  122.         processing = false
  123.         return joint
  124. end
  125.  
  126. function Bind(join)
  127.         if join == nil then return end
  128.         if _jnt == nil then return end
  129.         if part.ftor == nil then return end
  130.         if not _jnt[join]:IsA("Weld") then return end
  131.         if not motor[join]:IsA("Motor6D") then return end
  132.         motor[join].Part0 = nil
  133.         _jnt[join].Part0 = part.ftor
  134. end
  135.  
  136. function Snap()
  137.     s=Instance.new("Sound",char.Torso)
  138.     s.SoundId="rbxassetid://130874208"
  139.     s:Play()
  140. end
  141.  
  142. function Release(join)
  143.         if join == nil then return end
  144.         if _jnt == nil then return end
  145.         if part.ftor == nil then return end
  146.         if not _jnt[join]:IsA("Weld") then return end
  147.         if not motor[join]:IsA("Motor6D") then return end
  148.         _jnt[join].Part0 = nil
  149.         motor[join].Part0 = part.ftor
  150. end
  151.  
  152. function SuitInit()
  153.         while processing do wait() end
  154.         processing = true
  155.         if initialized then
  156.                 local suitModel
  157.                 if not char:FindFirstChild(_CODE.." Suit") then
  158.                         suitModel = Instance.new("Model", char)
  159.                         suitModel.Name = _CODE.." Suit"
  160.                         model = true
  161.                 else suitModel = char[_CODE.." Suit"] model = true end
  162.                 processing = false
  163.                 return suitModel
  164.         else processing = false end
  165. end
  166.  
  167. function CF(join,cf,rot,speed,ctin,s)
  168.         if s and cfs then ctin = true animate = false return end
  169.         if join == nil then return end
  170.         local def,done = join.C0,false
  171.         local cf = cf or def
  172.         local rot = rot or (def - def.p)
  173.         local speed = speed or 1
  174.         local x1,y1,z1 = def:toEulerAnglesXYZ()
  175.         local x2,y2,z2 = rot:toEulerAnglesXYZ()
  176.         coroutine.wrap(function()
  177.                 if speed ~= 1 then
  178.                         for i = 0,1,speed do
  179.                                 if s and cfs then ctin = true animate = false return end
  180.                                 join.C0 = CFrame.new(
  181.                                         (def.p.X * (1 - i) + cf.p.X * i),
  182.                                         (def.p.Y * (1 - i) + cf.p.Y * i),
  183.                                         (def.p.Z * (1 - i) + cf.p.Z * i)) *
  184.                                 CFrame.fromEulerAnglesXYZ(
  185.                                         (x1 * (1 - i) + x2 * i),
  186.                                         (y1 * (1 - i) + y2 * i),
  187.                                         (z1 * (1 - i) + z2 * i))
  188.                                 wait(0.015)
  189.                         end
  190.                 end if s and cfs then ctin = true animate = false else join.C0 = CFrame.new(cf.p) * CFrame.fromEulerAnglesXYZ(x2,y2,z2) end done = true
  191.         end)()
  192.         if not ctin and speed ~= 1 then while not done do wait(0.015) end end
  193. end
  194.  
  195. function CreatePart(tab, name, color, transparency, reflectance, size, cframe, rotation, cancollide, anchored, meshType, scaleSize, weldPart, parent)
  196.         if model and _mdl ~= nil and part.ftor ~= nil then
  197.                 local returnTable = {part,weld}
  198.                 if scaleSize == nil then scaleSize = false end
  199.                 local suitPart = Instance.new("Part")
  200.                 suitPart.Name = name
  201.                 suitPart.BrickColor = BrickColor.new(color)
  202.                 suitPart.Anchored = anchored
  203.                 suitPart.Locked = true
  204.                 suitPart.CanCollide = cancollide
  205.                 suitPart.Transparency = transparency
  206.                 suitPart.Reflectance = reflectance
  207.                 suitPart.FormFactor = Enum.FormFactor.Custom
  208.                 suitPart.BottomSurface = "Smooth"
  209.                 suitPart.TopSurface = "Smooth"
  210.                 suitPart.Size = size
  211.                 if meshType ~= nil then
  212.                         if meshType == "Cone" then
  213.                                 CreateMesh("http://www.roblox.com/asset/?id=1033714", suitPart, scaleSize)
  214.                         elseif meshType == "Corner" then
  215.                                 CreateMesh("http://www.roblox.com/asset/?id=11294911", suitPart, scaleSize)
  216.                         elseif meshType == "Devo" then
  217.                                 CreateMesh("http://www.roblox.com/asset/?id=15720044", suitPart, scaleSize)
  218.                         elseif meshType == "Diamond" then
  219.                                 CreateMesh("http://www.roblox.com/asset/?id=9756362", suitPart, scaleSize)
  220.                         elseif meshType == "Ring" then
  221.                                 CreateMesh("http://www.roblox.com/asset/?id=3270017", suitPart, scaleSize)
  222.                         elseif meshType == "Tetrahedron" then
  223.                                 CreateMesh("http://www.roblox.com/asset/?id=11294922", suitPart, scaleSize)
  224.                         elseif meshType == "Crown" then
  225.                                 CreateMesh("http://www.roblox.com/asset/?id=20329976", suitPart, scaleSize)
  226.                         elseif meshType == "Claws" then
  227.                                 CreateMesh("http://www.roblox.com/asset/?id=10681506", suitPart, scaleSize)
  228.                         elseif meshType == "Cylinder" then
  229.                                 local mesh = Instance.new("CylinderMesh", suitPart)
  230.                                 if scaleSize then mesh.Scale = suitPart.Size end
  231.                         elseif meshType == "Brick" then
  232.                                 local mesh = Instance.new("BlockMesh", suitPart)
  233.                                 if scaleSize then mesh.Scale = suitPart.Size end
  234.                         else
  235.                                 local mesh = Instance.new("SpecialMesh", suitPart)
  236.                                 if scaleSize then mesh.Scale = suitPart.Size end
  237.                                 mesh.MeshType = meshType
  238.                         end
  239.                 end
  240.                 if weldPart == nil then suitPart.CFrame = cframe * rotation else
  241.                 local weld = Instance.new("Weld", _mdl)
  242.                 weld.Part1 = suitPart
  243.                 weld.Part0 = weldPart
  244.                 weld.Name = tostring(weld.Part0).."_TO_"..tostring(weld.Part1)
  245.                 weld.C0 = cframe * rotation
  246.                 returnTable.weld = weld
  247.                 end
  248.                 returnTable.part = suitPart
  249.                 suitPart.Parent = parent or _mdl
  250.                 if tab ~= nil then tab[name] = returnTable else return returnTable end
  251.         end
  252. end
  253.  
  254. function CreateMesh(id, part, scaleSize)
  255.         local mesh = Instance.new("SpecialMesh", part)
  256.         if scaleSize then mesh.Scale = part.Size end
  257.         mesh.MeshType = Enum.MeshType.FileMesh
  258.         mesh.MeshId = id
  259.         return mesh
  260. end
  261.  
  262. function LoadSuit()
  263.         while processing do wait() end
  264.         processing = true
  265.         if not suited then
  266.                 CreatePart(prt, "torso_1", shirtColor, 0, 0, Vector3.new(2.015,2.11,1.015), CFrame.new(0,-0.04,0), CFrame.Angles(0,0,0),false,false, "Brick",false,part.ftor)
  267.                 CreatePart(prt, "torso_2", attachColor, 0, 0, Vector3.new(2.70,0.2,1.06), CFrame.new(-0.05,0.125,0), CFrame.Angles(0,0,math.rad(45)),false,false, "Brick",false,prt.torso_1.part)
  268.                 CreatePart(prt, "torso_3", attachColor, 0, 0, Vector3.new(2.15,0.2,1.06), CFrame.new(-0.025,-0.9,0), CFrame.Angles(0,0,math.rad(-2)),false,false, "Brick",false,prt.torso_1.part)
  269.                 CreatePart(prt, "torso_4", "Pastel Blue", 0, 1, Vector3.new(0.3,0.2,0.3), CFrame.new(0.6,0,-0.45), CFrame.Angles(math.rad(90),0,0),false,false, "Cylinder",false,prt.torso_3.part)
  270.                 CreatePart(prt, "arm_1", shirtColor, 0, 0, Vector3.new(1.015,0.8,1.015), CFrame.new(0,0.615,0), CFrame.Angles(0,0,0),false,false, "Brick",false,part.rarm)
  271.                 CreatePart(prt, "arm_2", shirtColor, 0, 0, Vector3.new(1.015,1.6,1.015), CFrame.new(0,0.215,0), CFrame.Angles(0,0,0),false,false, "Brick",false,part.larm)
  272.                 CreatePart(prt, "sheath_1", sheathColor, 0, 0, Vector3.new(0.425,4.5,0.2), CFrame.new(-0.25,0,0.63), CFrame.Angles(0,0,math.rad(-90)),false, false,"Brick", false, prt.torso_2.part)
  273.                 CreatePart(prt, "sheath_2", sheathColor, 0, 0,Vector3.new(0.21,0.6,0.415),CFrame.new(0,-2.55,0),CFrame.Angles(0,math.rad(90),math.rad(180)),false,false,"Wedge",false,prt.sheath_1.part)
  274.                 CreatePart(prt, "sheath_3", "Bright red", 0, 0,Vector3.new(0.25,0.6,0.2),CFrame.new(0,1.8,0.05),CFrame.Angles(0,0,0),false,false,"Diamond",true,prt.sheath_1.part)
  275.                 CreatePart(prt, "sheath_4", "White", 0, 0.3,Vector3.new(0.2,0.6,0.2),CFrame.new(0,1.3,0.1),CFrame.Angles(0,0,math.rad(27)),false,false,"Brick",true,prt.sheath_1.part)
  276.                 CreatePart(prt, "sheath_5", "Pastel Blue", 0, 0.3,Vector3.new(0.2,0.6,0.2),CFrame.new(0,1.1,0.1),CFrame.Angles(0,0,math.rad(27)),false,false,"Brick",true,prt.sheath_1.part)
  277.                 CreatePart(prt, "sheath_6", "White", 0, 0.3,Vector3.new(0.2,0.6,0.2),CFrame.new(0,0.9,0.1),CFrame.Angles(0,0,math.rad(27)),false,false,"Brick",true,prt.sheath_1.part)
  278.                 CreatePart(prt, "sheath_7", "Pastel Blue", 0, 0,Vector3.new(0.2,2,0.2),CFrame.new(0.2,0,0),CFrame.Angles(0,0,0),false,false,"Brick",true,prt.sheath_1.part)
  279.                 CreatePart(prt, "sheath_8", "Pastel Blue", 0, 0,Vector3.new(0.2,2,0.2),CFrame.new(-0.2,0,0),CFrame.Angles(0,0,0),false,false,"Brick",true,prt.sheath_1.part)
  280.                 CreatePart(prt, "sheath_9", "Pastel Blue", 0, 0,Vector3.new(0.2,0.72,0.2),CFrame.new(0.09,2.0125,0.13),CFrame.Angles(math.rad(35),0,-math.rad(20)),false,false,"Brick",true,prt.sheath_7.part)
  281.                 CreatePart(prt, "sheath_10", "Pastel Blue", 0, 0,Vector3.new(0.2,0.72,0.2),CFrame.new(-0.09,2.0125,0.13),CFrame.Angles(math.rad(35),0,math.rad(20)),false,false,"Brick",true,prt.sheath_8.part)
  282.                 CreatePart(prt, "sheath_11", "Pastel Blue", 0, 1,Vector3.new(0.25,0.425,0.25),CFrame.new(0,0.085,0),CFrame.Angles(0,0,0),false,false,"Brick",true,prt.sheath_9.part)
  283.                 CreatePart(prt, "sheath_12", "Pastel Blue", 0, 1,Vector3.new(0.25,0.425,0.25),CFrame.new(0,0.085,0),CFrame.Angles(0,0,0),false,false,"Brick",true,prt.sheath_10.part)
  284.                 CreatePart(prt, "sheath_13", "Pastel Blue", 0, 1,Vector3.new(0.2,0.7,0.2),CFrame.new(0,0,0),CFrame.Angles(math.rad(-145),0,0),false,false,"Brick",true,prt.sheath_2.part)
  285.                  CreatePart(prt, "sheath_14", "Pastel Blue", 0, 1,Vector3.new(0.2,1.11,0.2),CFrame.new(0.072,-0.025,0.1),CFrame.Angles(0,0,0),false,false,"Brick",true,prt.sheath_1.part)
  286.                 CreatePart(prt, "gunsheath_1", sheathColor, 0, 0, Vector3.new(0.5,0.9,0.7), CFrame.new(1.2,-0.2,0), CFrame.Angles(math.rad(-20),0,0),false, false,"Brick",true,prt.torso_3.part)
  287.                 CreatePart(prt, "gunsheath_2", "Pastel Blue", 0, 1, Vector3.new(0.3,0.2,0.3), CFrame.new(0.1,0.2,-0.225), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.gunsheath_1.part)
  288.                 CreatePart(prt, "gunsheath_3", "Pastel Blue", 0, 1, Vector3.new(0.3,0.2,0.3), CFrame.new(0,-0.1,0), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.gunsheath_2.part)
  289.                 CreatePart(prt, "gunsheath_4", "Pastel Blue", 0, 1, Vector3.new(0.3,0.2,0.3), CFrame.new(0,-0.1,0), CFrame.Angles(0,0,0),false, false,"Brick",true,prt.gunsheath_3.part)
  290.                 CreatePart(prt, "gun_1", gunColor, 0, 0, Vector3.new(0.4,0.775,0.5), CFrame.new(0,0.6,0.15), CFrame.Angles(math.rad(-105),0,0),false, false,"Brick",true,prt.gunsheath_1.part)
  291.                 CreatePart(prt, "gun_2", gunColor, 0, 0, Vector3.new(0.4,0.5,0.9), CFrame.new(0,0.2,-0.275), CFrame.Angles(math.rad(15),0,0),false, false,"Brick",true,prt.gun_1.part)
  292.                 CreatePart(prt, "gun_3", gunColor, 0, 0, Vector3.new(0.4,0.45,0.55), CFrame.new(0,0.1,0.26), CFrame.Angles(0,0,0),false, false,"Brick",true,prt.gun_2.part)
  293.                 CreatePart(prt, "gun_4", "Pastel Blue", 0, 1, Vector3.new(0.3,0.4,0.55), CFrame.new(0,0,-0.3), CFrame.Angles(0,0,0),false, false,"Brick",true,prt.gun_3.part)
  294.                 CreatePart(prt, "gun_5", gunColor, 0, 0, Vector3.new(0.4,0.45,0.6), CFrame.new(0,0,-0.55), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.gun_3.part)
  295.                 CreatePart(prt, "gun_6", gunColor, 0, 0, Vector3.new(0.4,0.45,0.2), CFrame.new(0,0,-0.22), CFrame.Angles(0,0,0),false, false,"Brick",true,prt.gun_3.part)
  296.                 CreatePart(prt, "gun_7", gunColor, 0, 0, Vector3.new(0.4,0.45,0.2), CFrame.new(0,0,-0.3), CFrame.Angles(0,0,0),false, false,"Brick",true,prt.gun_3.part)
  297.                 CreatePart(prt, "gun_8", gunColor, 0, 0, Vector3.new(0.2,0.2,0.5), CFrame.new(0,-0.25,0.18), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.gun_2.part)
  298.                 CreatePart(prt, "gun_9", gunColor, 0, 0, Vector3.new(0.2,0.2,0.5), CFrame.new(0,0.105,-0.105), CFrame.Angles(math.rad(90),0,0),false,false, "Brick",true,prt.gun_8.part)
  299.                 CreatePart(prt, "gun_10", gunColor, 0, 0, Vector3.new(0.2,0.2,0.5), CFrame.new(0,0.1725,-0.03), CFrame.Angles(math.rad(90),0,0),false,false, "Brick",true,prt.gun_8.part)
  300.                 CreatePart(prt, "gunbullet", "White", 0, 0, Vector3.new(0.325,0.2,0.325), CFrame.new(0,0,-0.42), CFrame.Angles(math.rad(90),0,0),false,false, "Cylinder",true,prt.gun_7.part)
  301.                 CreatePart(prt, "gunpointer", "Pastel Blue", 0, 0, Vector3.new(0.275,0.2,0.275), CFrame.new(0,-0.065,-0.39), CFrame.Angles(math.rad(90),0,0),false,false, "Cylinder",true,prt.gun_2.part)
  302.                 CreatePart(prt, "sword_1", swordHandleColor, 0, 0, Vector3.new(0.4,0.9,0.35), CFrame.new(0,2.715,0), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.sheath_1.part)
  303.                 CreatePart(prt, "sword_2", "White", 0, 0, Vector3.new(0.5,2.135,0.25), CFrame.new(0,-2.68,0), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.sword_1.part)
  304.                 CreatePart(prt, "sword_3", "White", 0, 0, Vector3.new(0.25,0.55,0.5), CFrame.new(0,-5.1,0), CFrame.Angles(0,math.rad(90),math.rad(180)),false,false,"Wedge",true,prt.sword_1.part)
  305.                 CreatePart(prt, "sword_4", "White", 0, 0, Vector3.new(0.9,0.3,0.55), CFrame.new(0,-0.4,0), CFrame.Angles(0,0,0),false, false,"Brick",true,prt.sword_1.part)
  306.                 CreatePart(prt, "sword_5", "White", 1, 0, Vector3.new(1.8,4.4,0.2), CFrame.new(0.7,0,0), CFrame.Angles(0,0,0),false, false,"Brick",false,prt.sword_2.part)
  307.                 CreatePart(prt, "sword_6", "Pastel Blue", 0, 0, Vector3.new(0.2,1.7,0.3), CFrame.new(0,-1.5,0), CFrame.Angles(0,0,0),false,false, "Brick",true,prt.sword_1.part)
  308.         elseif prt.torso_1 ~= nil then prt.torso_1.weld.Part0 = part.ftor end
  309.         suited = true
  310.         processing = false
  311.         return prt
  312. end -- +7
  313.  
  314. function Trail(val)
  315.         if not _prt.sword_1.part then return end
  316.         trail = val
  317.         if trail then
  318.                 coroutine.wrap(function()
  319.                         local last = _prt.sword_3.part.CFrame.p
  320.                         while use and trail and _prt.sword_3.part ~= nil do wait(.02)
  321.                                 local new = _prt.sword_3.part.CFrame.p
  322.                                 local mag = (last - new).magnitude
  323.                                 local pos = CFrame.new(last, new) * CFrame.Angles(math.rad(-90), 0, 0)
  324.                                 local trl = Instance.new("Part")
  325.                                 local msh = Instance.new("CylinderMesh", trl)
  326.                                 trl.Name = "SnapSword_TRAIL"
  327.                                 trl.Anchored = true
  328.                                 trl.Locked = true
  329.                                 trl.CanCollide = false
  330.                                 trl.FormFactor = Enum.FormFactor.Custom
  331.                                 trl.BrickColor = BrickColor.new("White")
  332.                                 trl.Transparency = 0.3
  333.                                 trl.Size = Vector3.new(0.2, mag, 0.2)
  334.                                 msh.Scale = Vector3.new(1.8, 1, 1.8)
  335.                                 trl.CFrame = pos * CFrame.new(0,mag/2,0)
  336.                                 trl.Parent = game.Workspace
  337.                                 coroutine.wrap(function() for i = trl.Transparency, 1, .05 do trl.Transparency = i msh.Scale = msh.Scale - Vector3.new(.15, 0, .15) wait(.02) end pcall(function() trl:Destroy() end) end)()
  338.                                 last = _prt.sword_3.part.CFrame.p
  339.                         end
  340.                 end)()
  341.         end
  342. end
  343.  
  344. function LightingGen(init,target,ran,delay,size,damage)
  345.     Snap()
  346.         local CL = function()
  347.                 local lght = Instance.new("Part")
  348.                 local msh = Instance.new("CylinderMesh", lght)
  349.                 local size = size or .3
  350.                 msh.Scale = Vector3.new(size,1,size)
  351.                 lght.Name = "SnapSword_LIGHT"
  352.                 lght.Anchored = true
  353.                 lght.Locked = true
  354.                 lght.CanCollide = false
  355.                 lght.Reflectance = 0
  356.                 lght.FormFactor = Enum.FormFactor.Custom
  357.                 lght.BrickColor = BrickColor.new("White")
  358.                 lght.Transparency = 0.5
  359.                 lght.Parent = char
  360.                 return lght
  361.         end
  362.         local delay, cPos = delay or .03
  363.         local rand = Vector3.new(math.random(-ran,ran)/10, math.random(-ran,ran)/10, math.random(-ran,ran)/10)
  364.         local mPos = (init - target).magnitude
  365.         local dLgt = math.random(1,5)
  366.         local dLgt = dLgt/10
  367.         local rVec = init + (target - init) * dLgt
  368.         local dVec = rVec - init
  369.         local gPos = CFrame.new(init, rVec + rand) * CFrame.Angles(math.rad(-90), 0, 0)
  370.         local rMag = (init - rVec + rand).magnitude
  371.         for i = dLgt, 1 - dLgt, dLgt do
  372.                 local cPrt = CL()
  373.                 cPrt.Size = Vector3.new(.2,rMag,.2)
  374.                 cPrt.CFrame = gPos * CFrame.new(0,rMag/2,0)
  375.                 cPos = gPos * CFrame.new(0,rMag,0)
  376.                 print("TEST")
  377.                 cPrt.Touched:connect(function(targ) print(targ:GetFullName())
  378.                         if targ.Parent:FindFirstChild("Humanoid") or targ.Parent:FindFirstChild("Zombie") then
  379.                                 if game.Players:GetPlayerFromCharacter(targ.Parent) ~= player then
  380.                                         print(targ:GetFullName())
  381.                                         local humanoid = targ.Parent.Humanoid or targ.Parent.Zombie
  382.                                         local dmg = damage or 10
  383.                                         humanoid.Health = humanoid.Health - dmg
  384.                                 end
  385.                         end
  386.                 end)
  387.                 coroutine.wrap(function() wait(delay) pcall(function() cPrt:Destroy() end) end)()
  388.                 if i <= 1 - dLgt * 2 then
  389.                         rVec = init + (target - init) * (i + dLgt)
  390.                         rand = Vector3.new(math.random(-ran,ran)/10, math.random(-ran,ran)/10, math.random(-ran,ran)/10)
  391.                         gPos = CFrame.new(cPos.p, rVec + rand) * CFrame.Angles(math.rad(-90), 0, 0)
  392.                         rMag = (cPos.p - rVec + rand).magnitude
  393.                 end
  394.         end
  395.         gPos = CFrame.new(cPos.p, target) * CFrame.Angles(math.rad(-90), 0, 0)
  396.         rMag = (cPos.p - target).magnitude
  397.         local cPrt = CL()
  398.         cPrt.Size = Vector3.new(.2,rMag,.2)
  399.         cPrt.CFrame = gPos * CFrame.new(0,rMag/2,0)
  400.         cPrt.Touched:connect(function(targ) print(targ:GetFullName())
  401.                 if targ.Parent:FindFirstChild("Humanoid") or targ.Parent:FindFirstChild("Zombie") then
  402.                         if game.Players:GetPlayerFromCharacter(targ.Parent) ~= player then
  403.                                 print(targ:GetFullName())
  404.                                 local humanoid = targ.Parent.Humanoid or targ.Parent.Zombie
  405.                                 local dmg = damage or 10
  406.                                 humanoid.Health = humanoid.Health - dmg
  407.                         end
  408.                 end
  409.         end)
  410.         coroutine.wrap(function() wait(delay) pcall(function() cPrt:Destroy() end) end)()
  411. end
  412.  
  413. function SwordEquip(force)
  414.         if processing and not force then return end
  415.         processing,cfs = true,true
  416.         if suited then
  417.                 Bind("rsho")
  418.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, math.rad(90)), .05, true)
  419.                 CF(_prt.sword_1.weld, CFrame.new(0,4.5,0), nil, .05, true)
  420.                 for i = 0, 1, .05 do
  421.                         _prt.sword_1.part.Transparency = i
  422.                         _prt.sword_2.part.Transparency = i
  423.                         _prt.sword_3.part.Transparency = i
  424.                         _prt.sword_4.part.Transparency = i
  425.                         _prt.sword_6.part.Transparency = i
  426.                         wait(.015)
  427.                 end
  428.                 _prt.sword_1.part.Transparency = 1
  429.                 _prt.sword_2.part.Transparency = 1
  430.                 _prt.sword_3.part.Transparency = 1
  431.                 _prt.sword_4.part.Transparency = 1
  432.                 _prt.sword_6.part.Transparency = 1
  433.                 _prt.sword_1.weld.Part0 = part.rarm
  434.                 CF(_prt.sword_1.weld, CFrame.new(0, -1, -0.25), CFrame.Angles(0, math.rad(90), 0))
  435.                 for i = 0, 1, .05 do
  436.                         _prt.sword_1.part.Transparency = 1 - i
  437.                         _prt.sword_2.part.Transparency = 1 - i
  438.                         _prt.sword_3.part.Transparency = 1 - i
  439.                         _prt.sword_4.part.Transparency = 1 - i
  440.                         _prt.sword_6.part.Transparency = 1 - i
  441.                         wait(.015)
  442.                 end
  443.                 _prt.sword_1.part.Transparency = 0
  444.                 _prt.sword_2.part.Transparency = 0
  445.                 _prt.sword_3.part.Transparency = 0
  446.                 _prt.sword_4.part.Transparency = 0
  447.                 Bind("lsho")
  448.                 huma.WalkSpeed = 65
  449.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, math.rad(-5)), .07, true)
  450.                 CF(_prt.sword_1.weld, nil, CFrame.Angles(math.rad(90), math.rad(90), 0), .07, true)
  451.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, math.rad(5)), .07)
  452.         end
  453.         mode,processing,cfs = 1, false, false
  454.         Walk()
  455. end
  456.  
  457. function SwordUnequip(force)
  458.         if processing and not force then return end
  459.         processing,cfs = true,true
  460.         if suited then
  461.                 CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .2, true)
  462.                 CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .2, true)
  463.                 CF(_jnt.lsho, CFrame.new(-1.5,0.5,0), CFrame.Angles(0, 0, math.rad(-5)), .2, true)
  464.                 CF(_jnt.rsho, nil, CFrame.Angles(math.rad(100), math.rad(90), 0), .07)
  465.                 Trail(true)
  466.                 CF(_prt.sword_1.weld, nil, CFrame.Angles(0, math.rad(90), 0), .15, true)
  467.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, math.rad(90)), .15)
  468.                 Trail(false)
  469.                 for i = 0, 1, .05 do
  470.                         _prt.sword_1.part.Transparency = i
  471.                         _prt.sword_2.part.Transparency = i
  472.                         _prt.sword_3.part.Transparency = i
  473.                         _prt.sword_4.part.Transparency = i
  474.                         _prt.sword_6.part.Transparency = i
  475.                         wait(.015)
  476.                 end
  477.                 _prt.sword_1.part.Transparency = 1
  478.                 _prt.sword_2.part.Transparency = 1
  479.                 _prt.sword_3.part.Transparency = 1
  480.                 _prt.sword_4.part.Transparency = 1
  481.                 _prt.sword_6.part.Transparency = 1
  482.                 _prt.sword_1.weld.Part0 = _prt.sheath_1.part
  483.                 CF(_prt.sword_1.weld, CFrame.new(0, 4.5, 0), CFrame.Angles(0, 0, 0))
  484.                 CF(_prt.sword_1.weld, CFrame.new(0,2.715,0), CFrame.Angles(0, 0, 0), .05, true)
  485.                 for i = 0, 1, .05 do
  486.                         _prt.sword_1.part.Transparency = 1 - i
  487.                         _prt.sword_2.part.Transparency = 1 - i
  488.                         _prt.sword_3.part.Transparency = 1 - i
  489.                         _prt.sword_4.part.Transparency = 1 - i
  490.                         _prt.sword_6.part.Transparency = 1 - i
  491.                         wait(.015)
  492.                 end
  493.                 _prt.sword_1.part.Transparency = 0
  494.                 _prt.sword_2.part.Transparency = 0
  495.                 _prt.sword_3.part.Transparency = 0
  496.                 _prt.sword_4.part.Transparency = 0
  497.                 huma.WalkSpeed = defaultWalkspeed
  498.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, 0), .07, true)
  499.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, 0), .07)
  500.                 Release("rsho")
  501.                 Release("lsho")
  502.         end
  503.         mode,processing,cfs = 0, false, false
  504. end
  505.  
  506. function GunEquip(force)
  507.         if processing and not force then return end
  508.         processing,cfs = true,true
  509.         if suited then
  510.                 Bind("rsho")
  511.                 CF(_jnt.rsho, CFrame.new(1.5,0.9,0), CFrame.Angles(math.rad(-20), 0, 0), 0.15)
  512.                 gunTakePos = _prt.gun_1.part.CFrame:inverse() * part.rarm.CFrame
  513.                 _prt.gun_1.weld.Part0 = part.rarm
  514.                 _prt.gun_1.weld.C0 = gunTakePos:inverse()
  515.                 CF(_jnt.rsho, CFrame.new(1.5,1.7,0), CFrame.Angles(math.rad(-20), 0, math.rad(2)), 0.15)
  516.                 Bind("lsho")
  517.                 CF(_jnt.lsho, nil, CFrame.Angles(math.rad(-5), 0, math.rad(-5)), 0.08, true)
  518.                 CF(_jnt.rsho, CFrame.new(1.5,0.5,0), CFrame.Angles(math.rad(-10), 0, math.rad(10)), 0.08, true)
  519.                 CF(_prt.gun_1.weld, _prt.gun_1.weld.C0 * CFrame.new(0.25,-0.1,0.1), nil, 0.08)
  520.         end
  521.         mode,processing,cfs = 2, false, false
  522.         Walk()
  523. end
  524.  
  525. function GunUnequip(force)
  526.         if processing and not force then return end
  527.         processing = true
  528.         if suited then
  529.                 if not gs and gtarget then gtarget = false repeat wait(.015) until gs end
  530.                 CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .2, true)
  531.                 CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .2, true)
  532.                 CF(_jnt.lsho, CFrame.new(-1.5,0.5,0), CFrame.Angles(0, 0, math.rad(-5)), .2, true)
  533.                 CF(_prt.gun_1.weld, gunTakePos:inverse(), (gunTakePos - gunTakePos.p):inverse(), 0.15, true)
  534.                 CF(_jnt.rsho, CFrame.new(1.5,1.7,0), CFrame.Angles(math.rad(-20), 0, math.rad(2)), 0.15)
  535.                 CF(_jnt.rsho, CFrame.new(1.5,0.9,0), CFrame.Angles(math.rad(-20), 0, 0), 0.15)
  536.                 _prt.gun_1.weld.Part0 = _prt.gunsheath_1.part
  537.                 CF(_prt.gun_1.weld, CFrame.new(0,0.6,0.15), CFrame.Angles(math.rad(-105),0,0))
  538.                 CF(_jnt.rsho, CFrame.new(1.5,0.5,0), CFrame.Angles(0, 0, 0), 0.08)
  539.                 Release("rsho")
  540.                 Release("lsho")
  541.         end
  542.         mode,processing,cfs = 0, false, false
  543. end
  544.  
  545. function LightEquip(force)
  546.         if processing and not force then return end
  547.         processing,cfs = true,true
  548.         if suited then
  549.                 Bind("rsho")
  550.                 Bind("lsho")
  551.                 huma.WalkSpeed = 65
  552.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, math.rad(-5)), .07, true)
  553.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, math.rad(5)), .07)
  554.         end
  555.         mode,processing,cfs = 3, false, false
  556.         Walk()
  557. end
  558.  
  559. function LightUnequip(force)
  560.         if processing and not force then return end
  561.         processing,cfs = true,true
  562.         if suited then
  563.                 huma.WalkSpeed = defaultWalkspeed
  564.                 CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .2, true)
  565.                 CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .2, true)
  566.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, 0), .07, true)
  567.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, 0), .07)
  568.                 Release("rsho")
  569.                 Release("lsho")
  570.         end
  571.         mode,processing,cfs = 0, false, false
  572.         Walk()
  573. end
  574.  
  575. function Walk()
  576.         if use then
  577.                 while processing or animate do wait(.015) end
  578.                 if w or a or s or d then
  579.                         animate = true
  580.                         if mode == 1 then
  581.                                 CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(65), 0), .15, true, true)
  582.                                 CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(-65), 0), .15, true, true)
  583.                                 CF(_jnt.rsho, nil, CFrame.Angles(math.rad(-20), 0, math.rad(70)), .15, true, true)
  584.                                 CF(_jnt.lsho, nil, CFrame.Angles(math.rad(30), math.rad(20), math.rad(5)), .15, false, true)
  585.                         elseif mode == 2 then
  586.                                 CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(65), 0), .15, true, true)
  587.                                 CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(-65), 0), .15, true, true)
  588.                                 CF(_jnt.rsho, CFrame.new(1,0.4,-0.2), CFrame.Angles(math.rad(35), math.rad(20), math.rad(-40)), .15, true, true)
  589.                                 CF(_jnt.lsho, CFrame.new(-1,0.5,0), CFrame.Angles(math.rad(60), math.rad(-20), math.rad(35)), .15, false, true)
  590.                         elseif mode == 3 then
  591.                                 CF(_jnt.rsho, nil, CFrame.Angles(math.rad(-35), 0, math.rad(10)), .15, true, true)
  592.                                 CF(_jnt.lsho, nil, CFrame.Angles(math.rad(-35), 0, math.rad(-10)), .15, false, true)
  593.                         end
  594.                         animate = false
  595.                 end
  596.         end
  597. end
  598.  
  599. function Stand()
  600.         if use then
  601.                 while processing or animate do wait(.015) end
  602.                 if not w and not a and not s and not d and not jumping then
  603.                         animate = true
  604.                         if mode ~= 0 then
  605.                                 CF(_jnt.neck, CFrame.new(0,1,0), CFrame.Angles(0, 0, 0), .2, true, true)
  606.                                 CF(_jnt.tors, CFrame.new(0,0,0), CFrame.Angles(0, 0, 0), .2, true, true)
  607.                                 CF(_jnt.rsho, CFrame.new(1.5,0.5,0), CFrame.Angles(0, 0, math.rad(5)), .2, true, true)
  608.                                 CF(_jnt.lsho, CFrame.new(-1.5,0.5,0), CFrame.Angles(0, 0, math.rad(-5)), .2, false, true)
  609.                         end
  610.                         animate = false
  611.                 end
  612.         end
  613. end
  614.  
  615. function FAC(num,res)
  616.         if (math.floor(num) <= res + tol and math.floor(num) >= res - tol) or (math.ceil(num) <= res + tol and math.ceil(num) >= res - tol) then return true
  617.         else return false end
  618. end
  619.  
  620. function SliceAndKill(p)
  621.         coroutine.wrap(function()
  622.                 if p.Name ~= "__NSCUTPART" and p.Name ~= "Base" and p.Name ~= "SnapSword_TRAIL" and p.Name ~= "SnapSword_LIGHT" then
  623.                         if p.Parent ~= char and p.Parent ~= _mdl and not p.Parent:IsA("Hat") then
  624.                                 local pX,pY,pZ = p.CFrame:toEulerAnglesXYZ()
  625.                                 if (FAC(pX,0) or FAC(pX,180)) and (FAC(pZ,0) or FAC(pZ,180)) and p.Size.y < 0.4 then return end
  626.                                 pX = math.deg(pX) if pX < 0 then pX = pX * (-1) else pX = math.floor(pX) end
  627.                                 pZ = math.deg(pZ) if pZ < 0 then pZ = pZ * (-1) else pZ = math.floor(pZ) end
  628.                                 if not FAC(pX,0) and not FAC(pX,90) and not FAC(pX,180) then return end
  629.                                 if not FAC(pZ,0) and not FAC(pZ,90) and not FAC(pZ,180) then return end
  630.                                 if (not FAC(pX,0) and not FAC(pZ,0)) or (not FAC(pX,180) and not FAC(pZ,180)) then
  631.                                         if FAC(pX,0) and FAC(pZ,180) then
  632.                                                 p.CFrame = p.CFrame * CFrame.Angles(0, 0, math.pi)
  633.                                         elseif FAC(pX,180) and FAC(pZ,0) then
  634.                                                 p.CFrame = p.CFrame * CFrame.Angles(math.pi, 0, 0)
  635.                                         elseif FAC(pX,90) and (FAC(pZ,0) or FAC(pZ,180)) then
  636.                                                 local rPart = p:Clone()
  637.                                                 rPart.Anchored = true
  638.                                                 rPart.Size = Vector3.new(p.Size.z,p.Size.x,p.Size.y)
  639.                                                 rPart.CFrame = CFrame.new(p.CFrame.x, p.CFrame.y, p.CFrame.z) * CFrame.Angles(0, pY, 0)
  640.                                                 if not p.Anchored then rPart.Anchored = false end
  641.                                                 rPart.Parent = p.Parent
  642.                                                 p:Remove()
  643.                                                 p = rPart
  644.                                         elseif FAC(pX,90) and FAC(pZ,90) then
  645.                                                 local rPart = p:Clone()
  646.                                                 rPart.Anchored = true
  647.                                                 rPart.Size = Vector3.new(p.Size.y,p.Size.z,p.Size.x)
  648.                                                 rPart.CFrame = CFrame.new(p.CFrame.x, p.CFrame.y, p.CFrame.z) * CFrame.Angles(0, pY, 0)
  649.                                                 if not p.Anchored then rPart.Anchored = false end
  650.                                                 rPart.Parent = p.Parent
  651.                                                 p:Remove()
  652.                                                 p = rPart
  653.                                         elseif (FAC(pX,0) or FAC(pX,180)) and FAC(pZ,90) then
  654.                                                 local rPart = p:Clone()
  655.                                                 rPart.Anchored = true
  656.                                                 rPart.Size = Vector3.new(p.Size.y,p.Size.x,p.Size.z)
  657.                                                 rPart.CFrame = CFrame.new(p.CFrame.x, p.CFrame.y, p.CFrame.z) * CFrame.Angles(0, pY, 0)
  658.                                                 if not p.Anchored then rPart.Anchored = false end
  659.                                                 rPart.Parent = p.Parent
  660.                                                 p:Remove()
  661.                                                 p = rPart
  662.                                         end
  663.                                 end
  664.                                 local s = _prt.sword_3.part
  665.                                 local pYPos = p.CFrame.p.y - (p.Size.y/2)
  666.                                 local sYPos = s.CFrame.p.y
  667.                                 if sYPos <= pYPos or sYPos >= (pYPos + p.Size.y) then return end
  668.                                 local x, y, z = p.CFrame:toEulerAnglesXYZ()
  669.                                 local c1 = p:Clone()
  670.                                 local c2 = p:Clone()
  671.                                 local CC,TR = p.CanCollide, p.Transparency
  672.                                 local mat = p.Material
  673.                                 c1:BreakJoints()
  674.                                 c2:BreakJoints()
  675.                                 if CC then
  676.                                         c1.CanCollide = true
  677.                                         c2.CanCollide = true
  678.                                         c1.Anchored = false
  679.                                         c2.Anchored = false
  680.                                 else
  681.                                         c1.CanCollide = false
  682.                                         c2.CanCollide = false
  683.                                         c1.Anchored = true
  684.                                         c2.Anchored = true
  685.                                 end
  686.                                 c1.FormFactor = Enum.FormFactor.Custom
  687.                                 c2.FormFactor = Enum.FormFactor.Custom
  688.                                 c1.Material = Enum.Material.Plastic
  689.                                 c2.Material = Enum.Material.Plastic
  690.                                 c1.Size = Vector3.new(p.Size.x,sYPos-pYPos,p.Size.z)
  691.                                 c2.Size = Vector3.new(p.Size.x,c2.Size.y-(sYPos-pYPos),p.Size.z)
  692.                                 c1.CFrame = p.CFrame * CFrame.new(0, -c2.Size.y/2,0)
  693.                                 c2.CFrame = p.CFrame * CFrame.new(0, c1.Size.y/2,0)                
  694.                                 c1.Name = "__NSCUTPART"
  695.                                 c2.Name = "__NSCUTPART"
  696.                                 c1.Reflectance = 0.5
  697.                                 c2.Reflectance = 0.5
  698.                                 c1.Parent = game.Workspace
  699.                                 c2.Parent = game.Workspace
  700.                                 p:Remove()
  701.                                 for i = 1, 10, 1 do wait(0.02)
  702.                                         c1.Reflectance = c1.Reflectance - 1/10
  703.                                         c2.Reflectance = c2.Reflectance - 1/10
  704.                                 end
  705.                                 if not CC then
  706.                                         coroutine.wrap(function()
  707.                                                 for i = TR, 1, 0.05 do wait(0.02)
  708.                                                         c1.Transparency = i
  709.                                                         c2.Transparency = i
  710.                                                 end pcall(function() c1:Remove() c2:Remove() end)
  711.                                         end)()
  712.                                 end                                        
  713.                                 c1.Reflectance = 0
  714.                                 c2.Reflectance = 0
  715.                                 c1.Material = mat
  716.                                 c2.Material = mat
  717.                                 if CC then
  718.                                         c1.Name = "_NSCUTPART"
  719.                                         c2.Name = "_NSCUTPART"
  720.                                 end
  721.                         end
  722.                 end
  723.         end)()
  724. end
  725.  
  726. function Hit(val)
  727.         hit = val
  728.         if hit then
  729.                 coroutine.wrap(function()
  730.                         local event = _prt.sword_5.part.Touched:connect(SliceAndKill)
  731.                         while use and hit and _prt.sword_2 ~= nil and _prt.sword_3 ~= nil and _prt.sword_5 ~= nil do wait() end
  732.                         event:disconnect()
  733.                 end)()
  734.         end
  735.     Snap()
  736. end
  737.  
  738. function GunTarget()
  739.         if not ms then return end
  740.         if processing and not gtarget then return end
  741.         processing,cfs,gs = true, true, false
  742.                 if not gtarget then gtarget = true
  743.                         huma.WalkSpeed = 5
  744.                         CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(-90), 0), .1, true)
  745.                         CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(90), 0), .1, true)
  746.                         CF(_jnt.lsho, CFrame.new(-1.5,0.5,0), CFrame.Angles(math.rad(-5), 0, math.rad(-5)), .1, true)
  747.                         CF(_jnt.rsho, CFrame.new(1.5,0.5,0), CFrame.Angles(0, 0, math.rad(90)), .1, true)
  748.                         pcall(function() bGyro.Parent = part.tors end)
  749.                         repeat wait(.015)
  750.                                 if ms and not disconnectRequest then
  751.                                         bGyro.cframe = CFrame.new(part.tors.CFrame.p, Vector3.new(ms.Hit.p.X, part.tors.CFrame.p.Y, ms.Hit.p.Z))
  752.                                         _jnt.rsho.C0 = CFrame.new(Vector3.new(1.5,0.5,0), ms.Hit.p) * CFrame.Angles(0, 0, math.rad(90))
  753.                                 end
  754.                         until not gtarget or not ms gtarget = false
  755.                            huma.WalkSpeed = defaultWalkspeed
  756.                         pcall(function() bGyro.Parent = nil end)
  757.                         CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .1, true)
  758.                         CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .1, true)
  759.                         CF(_jnt.lsho, CFrame.new(-1.5,0.5,0), CFrame.Angles(0, 0, math.rad(-5)), .1, true)
  760.                         CF(_jnt.rsho, CFrame.new(1.5,0.5,0), CFrame.Angles(0, 0, math.rad(5)), .1)
  761.                 end
  762.         processing,cfs,gs = false, false, true
  763.         if not gtarget and not disconnectRequest then Walk() end
  764. Snap()
  765. end
  766.  
  767. function OnKeyDown(key) key = key:lower()
  768.         if bindKeyDown then
  769.                 if key == "w" then Snap() w = true Walk()  end
  770.                 if key == "a" then Snap() a = true Walk() end
  771.                 if key == "s" then Snap() s = true Walk() end
  772.                 if key == "d" then Snap() d = true Walk()end
  773.                 if key == "c" then Snap() if mode == 0 then SwordEquip() elseif mode == 1 then SwordUnequip() elseif mode == 2 then GunUnequip() SwordEquip() elseif mode == 3 then LightUnequip() SwordEquip() end end
  774.                 if key == "v" then Snap() if mode == 0 then GunEquip() elseif mode == 2 then GunUnequip() elseif mode == 1 then  SwordUnequip() GunEquip() elseif mode == 3 then LightUnequip() GunEquip() end end
  775.                 if key == "x" then Snap() if mode == 0 then LightEquip() elseif mode == 3 then LightUnequip() elseif mode == 1 then SwordUnequip() LightEquip() elseif mode == 2 then GunUnequip() LightEquip() end end
  776.                 if key == "e" then Snap() if mode == 2 and not gtarget then GunTarget() else gtarget = false end end
  777.         end
  778. end
  779.  
  780. function OnKeyUp(key) key = key:lower()
  781.         if bindKeyUp then
  782.                 if key == "w" then Snap() w = false if not a and not s and not d then Stand() end end
  783.                 if key == "a" then Snap() a = false if not w and not s and not d then Stand() end end
  784.                 if key == "s" then Snap() s = false if not w and not a and not d then Stand() end end
  785.                 if key == "d" then Snap() d = false if not w and not a and not s then Stand() end end
  786.         end
  787. end
  788.  
  789. function OnButton1Down() buttonDown = true combo = combo + 1
  790.         if not ms then end
  791.         if processing and not gtarget then return end
  792.         processing,cfs = true, true
  793.         if mode == 1 then
  794.                 CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(40), 0), .2, true)
  795.                 CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(-40), 0), .2, true)
  796.                 CF(_prt.sword_1.weld, nil, CFrame.Angles(0, math.rad(-90), 0), .2, true)
  797.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, math.rad(-10)), .2, true)
  798.                 CF(_jnt.rsho, nil, CFrame.Angles(0, math.rad(-20), math.rad(90)), .2)
  799.                 pcall(function() bPos.position = Vector3.new(0,part.tors.CFrame.p.Y,0) bPos.Parent = part.tors end)
  800.                 Trail(true)
  801.                 Hit(true)
  802.                 CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(-50), 0), .15, true)
  803.                 CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(50), 0), .15, true)
  804.                 CF(_prt.sword_1.weld, nil, CFrame.Angles(math.rad(55), math.rad(-90), 0), .15, true)
  805.                 CF(_jnt.rsho, nil, CFrame.Angles(math.rad(90), math.rad(90), 0), .15)
  806.                 Trail(false)
  807.                 Hit(false)
  808.                 if combo > 1 then combo = 2
  809.                         if buttonDown then pcall(function() bPos.Parent = nil end) repeat wait(0.015) LightingGen(_prt.sword_4.part.CFrame.p,_prt.sword_3.part.CFrame.p,3,.05) until not buttonDown end
  810.                         CF(_prt.sword_1.weld, nil, CFrame.Angles(math.rad(55), math.rad(90),0), .3)
  811.                         Trail(true)
  812.                         Hit(true)
  813.                         CF(_prt.sword_1.weld, nil, CFrame.Angles(0, math.rad(90), 0), .15, true)
  814.                         CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(40), 0), .12, true)
  815.                         CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(-40), 0), .15, true)
  816.                         CF(_jnt.rsho, nil, CFrame.Angles(0, math.rad(-20), math.rad(90)), .15)
  817.                         pcall(function() bPos.Parent = nil end)
  818.                         Trail(false)
  819.                         Hit(false)
  820.                         CF(_prt.sword_1.weld, nil, CFrame.Angles(math.rad(90), math.rad(90), 0), .15, true)
  821.                         CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .15, true)
  822.                         CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .15, true)
  823.                         CF(_jnt.rsho, nil, CFrame.Angles(math.rad(-10), 0, 0), .15)
  824.                 else
  825.                         pcall(function() bPos.Parent = nil end)
  826.                         CF(_prt.sword_1.weld, nil, CFrame.Angles(math.rad(90), math.rad(90), 0), .15, true)
  827.                         CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .15, true)
  828.                         CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .15, true)
  829.                         CF(_jnt.rsho, nil, CFrame.Angles(0, 0, math.rad(5)), .15)
  830.                 end        
  831.         elseif mode == 2 then
  832.  
  833.                 --> GUN <--
  834.             Snap()
  835.  
  836.         elseif mode == 3 then
  837.                 CF(_jnt.neck, nil, CFrame.Angles(0, math.rad(90), 0), .1, true)
  838.                 CF(_jnt.tors, nil, CFrame.Angles(0, math.rad(-90), 0), .1, true)
  839.                 CF(_jnt.rsho, nil, CFrame.Angles(math.rad(-20), 0, math.rad(20)), .1, true)
  840.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, math.rad(-90)), .1)
  841.                 while ms and buttonDown and not disconnectRequest do wait(.015)
  842.                         pcall(function() bGyro.Parent = part.tors end)
  843.                         if ms and not disconnectRequest and huma.Health ~= 0 then
  844.                                 bGyro.cframe = CFrame.new(part.tors.CFrame.p, Vector3.new(ms.Hit.p.X, part.tors.CFrame.p.Y, ms.Hit.p.Z))
  845.                                 if ms.Target then
  846.                                         LightingGen((part.larm.CFrame * CFrame.new(0,-1,0)).p, ms.Hit.p, 10, .05, .5)
  847.                                 end
  848.                         end
  849.                 end
  850.                 pcall(function() bGyro.Parent = nil end)
  851.                 CF(_jnt.neck, nil, CFrame.Angles(0, 0, 0), .1, true)
  852.                 CF(_jnt.tors, nil, CFrame.Angles(0, 0, 0), .1, true)
  853.                 CF(_jnt.lsho, nil, CFrame.Angles(0, 0, math.rad(-5)), .1, true)
  854.                 CF(_jnt.rsho, nil, CFrame.Angles(0, 0, math.rad(5)), .1)
  855.         end
  856.         combo = 0
  857.         if not gtarget then processing, cfs = false, false end
  858.         Walk()
  859. end
  860.  
  861. function Disconnection() disconnectRequest = true ms = nil
  862.         while processing do wait(.015) end
  863.         w,a,s,d = false,false,false,false
  864.         processing = true
  865.         if use then
  866.                 Hit(false)
  867.                 bindKeyUp, bindKeyDown = false, false
  868.                 if mode == 1 then SwordUnequip(true) end
  869.                 if mode == 2 then GunUnequip(true) end
  870.                 if mode == 3 then LightUnequip(true) end
  871.                 use = false
  872.                 huma.WalkSpeed = defaultWalkspeed
  873.                 gunTakePos = nil
  874.                 w,a,s,d = false,false,false,false
  875.                 w2,a2,s2,d2 = false,false,false,false                
  876.                 _prt.torso_1.weld.Part0 = part.tors
  877.                 if delete then part.tors.Transparency = 0 end
  878.                 for i,mtor in pairs (motor) do
  879.                         pcall(function() mtor.Part0 = part.tors end)
  880.                 end
  881.                 if _jnt ~= nil then
  882.                         for i,weld in pairs(_jnt) do
  883.                                 pcall(function() weld:Remove() end)
  884.                         end
  885.                 end
  886.                 if part.ftor ~= nil then part.ftor:Remove() end
  887.                 if delete then
  888.                         if shirt ~= nil then shirt.Parent = char end
  889.                         if _mdl ~= nil then _mdl:Remove() end
  890.                         suited = false
  891.                         model = false
  892.                         prt = {}
  893.                 end
  894.                 _jnt,_mdl,_prt = nil, nil, nil
  895.                 _kup:disconnect()
  896.                 _kdn:disconnect()
  897.                 _mse:disconnect()
  898.                 _ms2:disconnect()
  899.                 combo = 0
  900.                 _kup,_kdn,_mse,_ms2 = nil,nil,nil,nil
  901.                 initialized = false
  902.         end
  903.         disconnectRequest = false
  904.         processing = false
  905. Snap()
  906. end
  907.  
  908. function _Main(mouse)
  909.         while processing do wait(0.015) end
  910.         ms = mouse
  911.         _jnt = JoinInit()
  912.         _mdl = SuitInit()
  913.         _prt = LoadSuit()
  914.         mode = 0
  915.         _kup = mouse.KeyUp:connect(OnKeyUp)
  916.         _kdn = mouse.KeyDown:connect(OnKeyDown)
  917.         _mse = mouse.Button1Down:connect(OnButton1Down)
  918.         _ms2 = mouse.Button1Up:connect(function() buttonDown = false end)
  919.         use, bindKeyUp, bindKeyDown = true, true, true
  920. Snap()
  921. end
  922.  
  923. bin.Selected:connect(_Main)
  924. bin.Deselected:connect(Disconnection)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement