Advertisement
memberhero

sword

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