Advertisement
AlphaPhoenix21

Long metal pipe.

Feb 21st, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.28 KB | None | 0 0
  1. function clerp(c1,c2,al)
  2. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  3. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  4. for i,v in pairs(com1) do
  5. com1[i] = v+(com2[i]-v)*al
  6. end
  7. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  8. end
  9. vt = Vector3.new
  10. Effects = { }
  11. bc = BrickColor.new
  12. plr = game:service'Players'.LocalPlayer
  13. char = plr.Character
  14. Player = game.Players.LocalPlayer
  15. Character = Player.Character
  16. mouse = plr:GetMouse()
  17. humanoid = char:findFirstChild("Humanoid")
  18. torso = char:findFirstChild("Torso")
  19. if torso == nil then
  20. print'no r15 skr0d xd'
  21. end
  22. head = char.Head
  23. Head = char.Head
  24. ra = char:findFirstChild("Right Arm")
  25. la = char:findFirstChild("Left Arm")
  26. rl = char:findFirstChild("Right Leg")
  27. ll = char:findFirstChild("Left Leg")
  28. rs = torso:findFirstChild("Right Shoulder")
  29. ls = torso:findFirstChild("Left Shoulder")
  30. rh = torso:findFirstChild("Right Hip")
  31. lh = torso:findFirstChild("Left Hip")
  32. neck = torso:findFirstChild("Neck")
  33. rss = game:GetService("RunService").RenderStepped
  34. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  35. RootPart = Character.HumanoidRootPart
  36. RootJoint = RootPart.RootJoint
  37. anim = char:findFirstChild("Animate")
  38. root = char.HumanoidRootPart
  39. rootpart = char:findFirstChild("HumanoidRootPart")
  40. RootPart = char:findFirstChild("HumanoidRootPart")
  41. attack = false
  42. local RbxUtility = LoadLibrary("RbxUtility")
  43. local Create = RbxUtility.Create
  44. CustomColor = BrickColor.new("Bright red")
  45.  
  46.  
  47. New = function(Object, Parent, Name, Data)
  48. local Object = Instance.new(Object)
  49. for Index, Value in pairs(Data or {}) do
  50. Object[Index] = Value
  51. end
  52. Object.Parent = Parent
  53. Object.Name = Name
  54. return Object
  55. end
  56.  
  57. function weld5(part0, part1, c0, c1)
  58. weeld=Instance.new("Weld", part0)
  59. weeld.Part0=part0
  60. weeld.Part1=part1
  61. weeld.C0=c0
  62. weeld.C1=c1
  63. return weeld
  64. end
  65. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  66. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  67. end
  68.  
  69. function swait(num)
  70. if num==0 or num==nil then
  71. game:service'RunService'.Stepped:wait(0)
  72. else
  73. for i=0,num do
  74. game:service'RunService'.Stepped:wait(0)
  75. end
  76. end
  77. end
  78. function thread(f)
  79. coroutine.resume(coroutine.create(f))
  80. end
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. --Very important stuff--
  94. Player=game:GetService("Players").LocalPlayer
  95. Character=Player.Character
  96. PlayerGui=Player.PlayerGui
  97. Backpack=Player.Backpack
  98. Torso=Character.Torso
  99. Head=Character.Head
  100. Humanoid=Character.Humanoid
  101. m=Instance.new('Model',Character)
  102. LeftArm=Character["Left Arm"]
  103. LeftLeg=Character["Left Leg"]
  104. RightArm=Character["Right Arm"]
  105. RightLeg=Character["Right Leg"]
  106. LS=Torso["Left Shoulder"]
  107. LH=Torso["Left Hip"]
  108. RS=Torso["Right Shoulder"]
  109. RH=Torso["Right Hip"]
  110. Face = Head.face
  111. Neck=Torso.Neck
  112. it=Instance.new
  113. attacktype=1
  114. vt=Vector3.new
  115. cf=CFrame.new
  116. euler=CFrame.fromEulerAnglesXYZ
  117. angles=CFrame.Angles
  118. cloaked=false
  119. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  120. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  121. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  122. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  123. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  124. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  125. RootPart=Character.HumanoidRootPart
  126. RootJoint=RootPart.RootJoint
  127. RootCF=euler(-1.57,0,3.14)
  128. attack = false
  129. attackdebounce = false
  130. deb=false
  131. equipped=true
  132. hand=false
  133. MMouse=nil
  134. combo=0
  135. mana=0
  136. trispeed=.2
  137. attackmode=false
  138. local idle=0
  139. local Anim="Idle"
  140. local gun=false
  141. local shoot=false
  142. local sine = 0
  143. local change = 1
  144. player=nil
  145.  
  146. mouse=Player:GetMouse()
  147. --save shoulders
  148. RSH, LSH=nil, nil
  149. --welds
  150. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  151. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  152. LH=Torso["Left Hip"]
  153. RH=Torso["Right Hip"]
  154. TorsoColor=Torso.BrickColor
  155. function NoOutline(Part)
  156. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  157. end
  158. player=Player
  159. ch=Character
  160. RSH=ch.Torso["Right Shoulder"]
  161. LSH=ch.Torso["Left Shoulder"]
  162. --
  163. RSH.Parent=nil
  164. LSH.Parent=nil
  165. --
  166. RW.Name="Right Shoulder"
  167. RW.Part0=ch.Torso
  168. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  169. RW.C1=cf(0, 0.5, 0)
  170. RW.Part1=ch["Right Arm"]
  171. RW.Parent=ch.Torso
  172. --
  173. LW.Name="Left Shoulder"
  174. LW.Part0=ch.Torso
  175. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  176. LW.C1=cf(0, 0.5, 0)
  177. LW.Part1=ch["Left Arm"]
  178. LW.Parent=ch.Torso
  179.  
  180.  
  181.  
  182. Player=game:GetService('Players').LocalPlayer
  183. Character=Player.Character
  184. mouse=Player:GetMouse()
  185. m=Instance.new('Model',Character)
  186.  
  187.  
  188. local function weldBetween(a, b)
  189. local weldd = Instance.new("ManualWeld")
  190. weldd.Part0 = a
  191. weldd.Part1 = b
  192. weldd.C0 = CFrame.new()
  193. weldd.C1 = b.CFrame:inverse() * a.CFrame
  194. weldd.Parent = a
  195. return weldd
  196. end
  197.  
  198. ArtificialHB = Instance.new("BindableEvent", script)
  199. ArtificialHB.Name = "Heartbeat"
  200.  
  201. script:WaitForChild("Heartbeat")
  202.  
  203. frame = 1 / 60
  204. tf = 0
  205. allowframeloss = false
  206. tossremainder = false
  207. lastframe = tick()
  208. script.Heartbeat:Fire()
  209.  
  210. game:GetService("RunService").Heartbeat:connect(function(s, p)
  211. tf = tf + s
  212. if tf >= frame then
  213. if allowframeloss then
  214. script.Heartbeat:Fire()
  215. lastframe = tick()
  216. else
  217. for i = 1, math.floor(tf / frame) do
  218. script.Heartbeat:Fire()
  219. end
  220. lastframe = tick()
  221. end
  222. if tossremainder then
  223. tf = 0
  224. else
  225. tf = tf - frame * math.floor(tf / frame)
  226. end
  227. end
  228. end)
  229.  
  230.  
  231.  
  232. CFuncs = {
  233. ["Part"] = {
  234. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  235. local Part = Create("Part"){
  236. Parent = Parent,
  237. Reflectance = Reflectance,
  238. Transparency = Transparency,
  239. CanCollide = false,
  240. Locked = true,
  241. BrickColor = BrickColor.new(tostring(BColor)),
  242. Name = Name,
  243. Size = Size,
  244. Material = Material,
  245. }
  246. RemoveOutlines(Part)
  247. return Part
  248. end;
  249. };
  250.  
  251. ["Mesh"] = {
  252. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  253. local Msh = Create(Mesh){
  254. Parent = Part,
  255. Offset = OffSet,
  256. Scale = Scale,
  257. }
  258. if Mesh == "SpecialMesh" then
  259. Msh.MeshType = MeshType
  260. Msh.MeshId = MeshId
  261. end
  262. return Msh
  263. end;
  264. };
  265.  
  266. ["Mesh"] = {
  267. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  268. local Msh = Create(Mesh){
  269. Parent = Part,
  270. Offset = OffSet,
  271. Scale = Scale,
  272. }
  273. if Mesh == "SpecialMesh" then
  274. Msh.MeshType = MeshType
  275. Msh.MeshId = MeshId
  276. end
  277. return Msh
  278. end;
  279. };
  280.  
  281. ["Weld"] = {
  282. Create = function(Parent, Part0, Part1, C0, C1)
  283. local Weld = Create("Weld"){
  284. Parent = Parent,
  285. Part0 = Part0,
  286. Part1 = Part1,
  287. C0 = C0,
  288. C1 = C1,
  289. }
  290. return Weld
  291. end;
  292. };
  293.  
  294. ["Sound"] = {
  295. Create = function(id, par, vol, pit)
  296. coroutine.resume(coroutine.create(function()
  297. local S = Create("Sound"){
  298. Volume = vol,
  299. Pitch = pit or 1,
  300. SoundId = id,
  301. Parent = par or workspace,
  302. }
  303. wait()
  304. S:play()
  305. game:GetService("Debris"):AddItem(S, 6)
  306. end))
  307. end;
  308. };
  309.  
  310. ["ParticleEmitter"] = {
  311. Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  312. local fp = Create("ParticleEmitter"){
  313. Parent = Parent,
  314. Color = ColorSequence.new(Color1, Color2),
  315. LightEmission = LightEmission,
  316. Size = Size,
  317. Texture = Texture,
  318. Transparency = Transparency,
  319. ZOffset = ZOffset,
  320. Acceleration = Accel,
  321. Drag = Drag,
  322. LockedToPart = LockedToPart,
  323. VelocityInheritance = VelocityInheritance,
  324. EmissionDirection = EmissionDirection,
  325. Enabled = Enabled,
  326. Lifetime = LifeTime,
  327. Rate = Rate,
  328. Rotation = Rotation,
  329. RotSpeed = RotSpeed,
  330. Speed = Speed,
  331. VelocitySpread = VelocitySpread,
  332. }
  333. return fp
  334. end;
  335. };
  336.  
  337. CreateTemplate = {
  338.  
  339. };
  340. }
  341.  
  342. function Damage(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
  343. if hit.Parent == nil then
  344. return
  345. end
  346. local h = hit.Parent:FindFirstChildOfClass("Humanoid")
  347. for _, v in pairs(hit.Parent:children()) do
  348. if v:IsA("Humanoid") then
  349. h = v
  350. end
  351. end
  352. if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("UpperTorso") ~= nil then
  353. warn'No R15 allowed'
  354. hit.Parent:FindFirstChild("Head"):BreakJoints()
  355. end
  356.  
  357. if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
  358. if hit.Parent:findFirstChild("DebounceHit") ~= nil then
  359. if hit.Parent.DebounceHit.Value == true then
  360. return
  361. end
  362. end
  363. if insta == true then
  364. hit.Parent:FindFirstChild("Head"):BreakJoints()
  365. end
  366. local c = Create("ObjectValue"){
  367. Name = "creator",
  368. Value = game:service("Players").LocalPlayer,
  369. Parent = h,
  370. }
  371. game:GetService("Debris"):AddItem(c, .5)
  372. if HitSound ~= nil and HitPitch ~= nil then
  373. CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
  374. end
  375. local Damage = math.random(minim, maxim)
  376. local blocked = false
  377. local block = hit.Parent:findFirstChild("Block")
  378. if block ~= nil then
  379. if block.className == "IntValue" then
  380. if block.Value > 0 then
  381. blocked = true
  382. block.Value = block.Value - 1
  383. print(block.Value)
  384. end
  385. end
  386. end
  387. if blocked == false then
  388. h.Health = h.Health - Damage
  389. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, torso.BrickColor.Color)
  390. else
  391. h.Health = h.Health - (Damage / 2)
  392. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, torso.BrickColor.Color)
  393. end
  394. if Type == "Knockdown" then
  395. local hum = hit.Parent.Humanoid
  396. hum.PlatformStand = true
  397. coroutine.resume(coroutine.create(function(HHumanoid)
  398. swait(1)
  399. HHumanoid.PlatformStand = false
  400. end), hum)
  401. local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit
  402. local bodvol = Create("BodyVelocity"){
  403. velocity = angle * knockback,
  404. P = 5000,
  405. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  406. Parent = hit,
  407. }
  408. local rl = Create("BodyAngularVelocity"){
  409. P = 3000,
  410. maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
  411. angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
  412. Parent = hit,
  413. }
  414. game:GetService("Debris"):AddItem(bodvol, .5)
  415. game:GetService("Debris"):AddItem(rl, .5)
  416. elseif Type == "Normal" then
  417. local vp = Create("BodyVelocity"){
  418. P = 500,
  419. maxForce = Vector3.new(math.huge, 0, math.huge),
  420. velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05,
  421. }
  422. if knockback > 0 then
  423. vp.Parent = hit.Parent.Torso
  424. end
  425. game:GetService("Debris"):AddItem(vp, .5)
  426. elseif Type == "Up" then
  427. local bodyVelocity = Create("BodyVelocity"){
  428. velocity = Vector3.new(0, 20, 0),
  429. P = 5000,
  430. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  431. Parent = hit,
  432. }
  433. game:GetService("Debris"):AddItem(bodyVelocity, .5)
  434. elseif Type == "DarkUp" then
  435. coroutine.resume(coroutine.create(function()
  436. for i = 0, 1, 0.1 do
  437. swait()
  438. Effects.Block.Create(BrickColor.new("Black"), hit.Parent.Torso.CFrame, 5, 5, 5, 1, 1, 1, .08, 1)
  439. end
  440. end))
  441. local bodyVelocity = Create("BodyVelocity"){
  442. velocity = Vector3.new(0, 20, 0),
  443. P = 5000,
  444. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  445. Parent = hit,
  446. }
  447. game:GetService("Debris"):AddItem(bodyVelocity, 1)
  448. elseif Type == "Snare" then
  449. local bp = Create("BodyPosition"){
  450. P = 2000,
  451. D = 100,
  452. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  453. position = hit.Parent.Torso.Position,
  454. Parent = hit.Parent.Torso,
  455. }
  456. game:GetService("Debris"):AddItem(bp, 1)
  457. elseif Type == "Freeze" then
  458. local BodPos = Create("BodyPosition"){
  459. P = 50000,
  460. D = 1000,
  461. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  462. position = hit.Parent.Torso.Position,
  463. Parent = hit.Parent.Torso,
  464. }
  465. local BodGy = Create("BodyGyro") {
  466. maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge ,
  467. P = 20e+003,
  468. Parent = hit.Parent.Torso,
  469. cframe = hit.Parent.Torso.CFrame,
  470. }
  471. hit.Parent.Torso.Anchored = true
  472. coroutine.resume(coroutine.create(function(Part)
  473. swait(1.5)
  474. Part.Anchored = false
  475. end), hit.Parent.Torso)
  476. game:GetService("Debris"):AddItem(BodPos, 3)
  477. game:GetService("Debris"):AddItem(BodGy, 3)
  478. end
  479. local debounce = Create("BoolValue"){
  480. Name = "DebounceHit",
  481. Parent = hit.Parent,
  482. Value = true,
  483. }
  484. game:GetService("Debris"):AddItem(debounce, Delay)
  485. c = Create("ObjectValue"){
  486. Name = "creator",
  487. Value = Player,
  488. Parent = h,
  489. }
  490. game:GetService("Debris"):AddItem(c, .5)
  491. end
  492. end
  493.  
  494. function ShowDamage(Pos, Text, Time, Color)
  495. local Rate = (1 / 30)
  496. local Pos = (Pos or Vector3.new(0, 0, 0))
  497. local Text = (Text or "")
  498. local Time = (Time or 2)
  499. local Color = (Color or Color3.new(1, 0, 1))
  500. local EffectPart = CFuncs.Part.Create(workspace, "Metal", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0))
  501. EffectPart.Anchored = true
  502. local BillboardGui = Create("BillboardGui"){
  503. Size = UDim2.new(3, 0, 3, 0),
  504. Adornee = EffectPart,
  505. Parent = EffectPart,
  506. }
  507. local TextLabel = Create("TextLabel"){
  508. BackgroundTransparency = 1,
  509. Size = UDim2.new(1, 0, 1, 0),
  510. Text = Text,
  511. Font = "SciFi",
  512. TextColor3 = Color,
  513. TextScaled = true,
  514. Parent = BillboardGui,
  515. }
  516. game.Debris:AddItem(EffectPart, (Time))
  517. EffectPart.Parent = game:GetService("Workspace")
  518. delay(0, function()
  519. local Frames = (Time / Rate)
  520. for Frame = 1, Frames do
  521. wait(Rate)
  522. local Percent = (Frame / Frames)
  523. EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
  524. TextLabel.TextTransparency = Percent
  525. end
  526. if EffectPart and EffectPart.Parent then
  527. EffectPart:Destroy()
  528. end
  529. end)
  530. end
  531. function MagnitudeDamage(Part, Magnitude, MinimumDamage, MaximumDamage, KnockBack, Type, HitSound, HitPitch)
  532. for _, c in pairs(workspace:children()) do
  533. local hum = c:findFirstChild("Humanoid")
  534. if hum ~= nil then
  535. local head = c:findFirstChild("Torso")
  536. if head ~= nil then
  537. local targ = head.Position - Part.Position
  538. local mag = targ.magnitude
  539. if mag <= Magnitude and c.Name ~= Player.Name then
  540. Damage(head, head, MinimumDamage, MaximumDamage, KnockBack, Type, RootPart, .1, "rbxassetid://" .. HitSound, HitPitch)
  541. end
  542. end
  543. end
  544. end
  545. end
  546.  
  547.  
  548. nooutline = function(part)
  549. part.TopSurface = 10
  550. end
  551.  
  552. part = function(formfactor, parent, material, reflectance, transparency, brickcolor, name, size)
  553. local fp = it("Part")
  554. fp.formFactor = formfactor
  555. fp.Parent = parent
  556. fp.Reflectance = reflectance
  557. fp.Transparency = transparency
  558. fp.CanCollide = false
  559. fp.Locked = true
  560. fp.BrickColor = BrickColor.new(tostring(brickcolor))
  561. fp.Name = name
  562. fp.Size = size
  563. fp.Position = Character.Torso.Position
  564. nooutline(fp)
  565. fp.Material = material
  566. fp:BreakJoints()
  567. return fp
  568. end
  569.  
  570. mesh = function(Mesh, part, meshtype, meshid, offset, scale)
  571. local mesh = it(Mesh)
  572. mesh.Parent = part
  573. if Mesh == "SpecialMesh" then
  574. mesh.MeshType = meshtype
  575. mesh.MeshId = meshid
  576. end
  577. mesh.Offset = offset
  578. mesh.Scale = scale
  579. return mesh
  580. end
  581.  
  582. weld = function(parent, part0, part1, c0, c1)
  583. local weld = it("Weld")
  584. weld.Parent = parent
  585. weld.Part0 = part0
  586. weld.Part1 = part1
  587. weld.C0 = c0
  588. weld.C1 = c1
  589. return weld
  590. end
  591.  
  592. m = Instance.new("Model", Character)
  593. m.Name = "pole xd"
  594. Handle = part(Enum.FormFactor.Brick, m, Enum.Material.Metal, 0, 0, "Medium stone grey", "Handle", Vector3.new(0.300000003, 0.300000003, 0.300000003))
  595. Handleweld = weld(m, Character["Right Arm"], Handle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-2.14576721e-005, 1.00000191, 1.52587891e-005, -4.37113883e-008, 0, -1, 0, 0.999999881, 0, 1, 0, -4.37113883e-008))
  596. mesh("SpecialMesh", Handle, Enum.MeshType.Cylinder, "", Vector3.new(0, 0, 0), Vector3.new(35, 1.5, 1.5))
  597. Hitbox = part(Enum.FormFactor.Brick, m, Enum.Material.Metal, 0, 1, "Really red", "Hitbox", Vector3.new(0.899999976, 2.25, 2.25))
  598. Hitboxweld = weld(m, Handle, Hitbox, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0, 3.01000118, -4.37113883e-008, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-008))
  599. Handleweld.Part0 = RightArm
  600. Handleweld.Part1 = Handle
  601. Handleweld.C0 = cf(0, 0, 0) * angles(math.rad(0), math.rad(145), math.rad(0)) * angles(math.rad(75), math.rad(0), math.rad(0)) * cf(0, 0.25, 0)
  602.  
  603.  
  604.  
  605.  
  606. function rayCast(Position, Direction, Range, Ignore)
  607. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  608. end
  609. function RemoveOutlines(part)
  610. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  611. end
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620. Character.Humanoid.MaxHealth = 9580
  621. Character.Humanoid.Health = 9580
  622. Character.Humanoid.JumpPower = 155
  623. mouse.Button1Down:connect(function()
  624. if attack==false then
  625. if attacktype==1 then
  626. attack=true
  627. attacktype=2
  628. attackone()
  629. elseif attacktype==2 then
  630. attack=true
  631. attacktype=3
  632. attacktwo()
  633. elseif attacktype==3 then
  634. attack=true
  635. attacktype=1
  636. attackthree()
  637.  
  638. end
  639. end
  640. end)
  641.  
  642.  
  643.  
  644. function attackone()
  645. attack = true
  646. local con = RightLeg.Touched:connect(function(hit)
  647. Damage(Torso, hit, 10, 20, math.random(1, 5), "Knockdown", RootPart, .2, "rbxassetid://146163522", 1)
  648. end)
  649. for i = 0,2,0.1 do
  650. swait()
  651.  
  652. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-4-2),math.rad(0),math.rad(0)),.2)
  653. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(10) + -math.sin(sine/8)/1.2,math.rad(5* math.cos(sine / 8)),math.rad(15 + 1.25 * math.cos(sine / 8))),.3)
  654. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(10) + math.sin(sine/8)/1.2,math.rad(5* math.cos(sine / 8)),math.rad(-15 - 1.25 * math.cos(sine / 8))),.3)
  655. RH.C0=clerp(RH.C0,cf(1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(90),math.rad(90)),0.15)
  656. LH.C0=clerp(LH.C0,cf(-1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(-3),math.rad(0)),0.15)
  657. end
  658. con:Disconnect()
  659. attack = false
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666. end
  667.  
  668. RWC0 = cf(.1, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0))
  669. LWC0 = cf(-.1, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0))
  670. function attacktwo()
  671. attack = true
  672. for i = 0, 2, 0.1 do
  673. swait()
  674. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(30)), 0.3)
  675. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(-15)), 0.3)
  676. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -0.5) * angles(math.rad(90), math.rad(0), math.rad(-30)) * angles(math.rad(0), math.rad(90), math.rad(0)) * RWC0, 0.3)
  677. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)) * LWC0, 0.3)
  678. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(0), math.rad(60), math.rad(0)) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  679. LH.C0 = clerp(LH.C0, cf(-1, -1, 0) * angles(math.rad(0), math.rad(-120), math.rad(0)) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  680. Handleweld.C0 = clerp(Handleweld.C0, cf(0, 0, 0) * angles(math.rad(-20), math.rad(0), math.rad(0)), 0.3)
  681. end
  682. local con = Hitbox.Touched:connect(function(hit)
  683. Damage(Torso, hit, 23, 46, math.random(1, 5), "Normal", RootPart, .2, "rbxassetid://146163522", 1)
  684. end)
  685.  
  686. for i = 0, 2, 0.1 do
  687. swait()
  688. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-30 - 360 * i)), 0.45)
  689. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(30)), 0.45)
  690. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(60)) * angles(math.rad(0), math.rad(90), math.rad(0)) * RWC0, 0.45)
  691. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(10), math.rad(0), math.rad(-60)) * LWC0, 0.45)
  692. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(0), math.rad(90), math.rad(0)) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.45)
  693. LH.C0 = clerp(LH.C0, cf(-1, -1, 0) * angles(math.rad(0), math.rad(-90), math.rad(0)) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.45)
  694. Handleweld.C0 = clerp(Handleweld.C0, cf(0, -0.25, -0.5) * angles(math.rad(-40), math.rad(0), math.rad(0)), 0.45)
  695. end
  696. for i = 0, 2, 0.1 do
  697. swait()
  698. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  699. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  700. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)) * angles(math.rad(0), math.rad(90), math.rad(0)) * RWC0, 0.3)
  701. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-60)) * LWC0, 0.3)
  702. RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(0), math.rad(90), math.rad(0)) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  703. LH.C0 = clerp(LH.C0, cf(-1, -1, 0) * angles(math.rad(0), math.rad(-90), math.rad(0)) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  704. Handleweld.C0 = clerp(Handleweld.C0, cf(0, -0.25, -0.5) * angles(math.rad(-40), math.rad(0), math.rad(0)), 0.3)
  705. end
  706. con:disconnect()
  707. attack = false
  708. end
  709.  
  710.  
  711. function attackthree()
  712. attack = true
  713. for i = 0, 2, 0.1 do
  714. swait()
  715. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), 0.3)
  716. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(-30)) * angles(math.rad(0), math.rad(90), math.rad(0)) * RWC0, 0.3)
  717. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(30)) * LWC0, 0.3)
  718. RH.C0=clerp(RH.C0,cf(1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  719. LH.C0=clerp(LH.C0,cf(-1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  720. Handleweld.C0 = clerp(Handleweld.C0, cf(0, 0, 0) * angles(math.rad(-20), math.rad(0), math.rad(0)), 0.3)
  721. end
  722. local con = Hitbox.Touched:connect(function(hit)
  723. Damage(Torso, hit, 14, 23, math.random(1, 5), "Knockdown", RootPart, .2, "rbxassetid://146163522", 1)
  724. end)
  725. for i = 0, 2, 0.1 do
  726. swait()
  727. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(0),math.rad(0)),.2)
  728. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), 0.3)
  729. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -0.7) * angles(math.rad(90), math.rad(0), math.rad(-30)) * angles(math.rad(0), math.rad(90), math.rad(0)) * RWC0, 0.3)
  730. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -0.7) * angles(math.rad(90), math.rad(0), math.rad(30)) * LWC0, 0.3)
  731. RH.C0=clerp(RH.C0,cf(1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  732. LH.C0=clerp(LH.C0,cf(-1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  733. Handleweld.C0 = clerp(Handleweld.C0, cf(0, 0, 0) * angles(math.rad(-20), math.rad(0), math.rad(0)), 0.3)
  734. end
  735. attack = false
  736. con:Disconnect()
  737. end
  738.  
  739.  
  740.  
  741.  
  742.  
  743. --animations--
  744. local sine = 0
  745. local change = 1
  746. local val = 0
  747. toim = 0
  748. Humanoid.Animator.Parent = nil
  749. idleanim=.4
  750. while true do
  751. swait()
  752. sine = sine + change
  753. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  754. local velderp=RootPart.Velocity.y
  755. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  756. if equipped==true or equipped==false then
  757. if attack==false then
  758. idle=idle+1
  759. else
  760. idle=0
  761. end
  762. if idle>=500 then
  763. if attack==false then
  764. --Sheath() xdxdxdxdxd
  765. end
  766. end
  767. if RootPart.Velocity.y > 1 and hitfloor==nil then
  768. Anim="Jump"
  769. if attack==false then
  770. change = 2
  771. Humanoid.CameraOffset = Vector3.new(0,0,0)
  772. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0 + 360 * math.cos (sine / 30)),math.rad(0),math.rad(0)),.3)
  773. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-10),math.rad(0),math.rad(0)),.3)
  774. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(10)), 0.3)
  775. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-30)), 0.3)
  776. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(-20)),.3)
  777. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-60),math.rad(0)),.3)
  778. end
  779. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  780. Anim="Fall"
  781. change = 1
  782. if attack==false then
  783. Humanoid.CameraOffset = Vector3.new(0,0,0)
  784. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(-20)),.3)
  785. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-60),math.rad(0)),.3)
  786. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  787. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(40),math.rad(0),math.rad(0)),.3)
  788. RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.65, 0) * angles(math.rad(-10), math.rad(0), math.rad(90)), 0.3)
  789. LW.C0 = clerp(LW.C0, CFrame.new(-1.45, 0.65, 0) * angles(math.rad(-10), math.rad(0), math.rad(-90)), 0.3)
  790. end
  791. elseif torvel<1 and hitfloor~=nil then
  792. Anim="Idle"
  793. if attack==false then
  794. Humanoid.CameraOffset = Vector3.new(0,0,0)
  795. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-0.1+0.1*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(0),math.rad(0)),0.15)
  796. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15),math.rad(5* math.cos(sine / 60)),math.rad(0)),.3)
  797. RH.C0=clerp(RH.C0,cf(1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  798. LH.C0=clerp(LH.C0,cf(-1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30)),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(-5),math.rad(16)),0.15)
  799. RW.C0=clerp(RW.C0,cf(1.5,0.5+0.04* math.cos(sine / 60),0)*angles(math.rad(90),math.rad(-30),math.rad(125)),.3)
  800. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5+0.04* math.cos(sine / 60), 0) * angles(math.rad(-0), math.rad(-5* math.cos(sine / 60)), math.rad(-15)),.2)
  801. Handleweld.C0 = clerp(Handleweld.C0, cf(0, 0.25, 0.75) * angles(math.rad(-15), math.rad(0), math.rad(0)), 0.15)
  802. end
  803. elseif torvel>2 and torvel<22 and hitfloor~=nil then
  804. Anim="Walk"
  805. if attack==false then
  806. change=0.5
  807. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(5*math.cos(sine/8)),math.rad(0)),.2)
  808. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * cf(0, 0, 0) * angles(math.rad(10*math.cos(sine/8)), math.rad(0), math.rad(0)), 0.3)
  809. RW.C0=clerp(RW.C0,CFrame.new(1.5,0.5,0)*angles(math.rad(30*math.cos(sine/7))+ math.sin(sine/7)/2.5,math.rad(0),math.rad(10)),0.15)
  810. LW.C0=clerp(LW.C0,CFrame.new(-1.5,0.5,0)*angles(math.rad(-30*math.cos(sine/7))+ -math.sin(sine/7)/2.5,math.rad(0),math.rad(-10)),0.15)
  811. RH.C0=clerp(RH.C0,cf(1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30))+ -math.sin(sine/7),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  812. LH.C0=clerp(LH.C0,cf(-1,-0.9-0.1*math.cos(sine/30),0.025*math.cos(sine/30))*angles(math.rad(-2.5*math.cos(sine/30))+ math.sin(sine/7),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0)),0.15)
  813. end
  814. elseif torvel>=22 and hitfloor~=nil then
  815. Anim="Run"
  816. if attack==false then
  817. Humanoid.CameraOffset = Vector3.new(0,0,0)
  818. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(0),math.rad(0)),.2)
  819. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-4+2*math.sin(sine/18)),math.rad(0),math.rad(0)),.2)
  820. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(0 - 25 * math.cos(sine / 8)),math.rad(0),math.rad(10 + 1.25 * math.cos(sine / 16))),.3)
  821. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(0 + 25 * math.cos(sine / 8)),math.rad(0),math.rad(-10 - 1.25 * math.cos(sine / 16))),.3)
  822. LH.C0 = clerp(LH.C0, CFrame.new(-0.5, -1-0.4*math.cos(sine/8)/2, 0 *math.sin(sine/8)/2) * CFrame.Angles(math.rad(0) + -math.sin(sine/8)/1.2, math.rad(0), 0), .8)
  823. RH.C0 = clerp(RH.C0, CFrame.new(0.5, -1+0.4*math.cos(sine/8)/2,0 *-math.sin(sine/8)/2) * CFrame.Angles(math.rad(0) + math.sin(sine/8)/1.2, math.rad(0), 0), .8)
  824. end
  825. end
  826. end
  827. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement