Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Lerp = function(a, b, c)
- return a + (b - a) * c
- end
- clerp = CFrame.new().lerp -- <3 from ponda
- -----------------------VARIABLES-----------------------------------------------------------------
- local Player = game.Players.LocalPlayer
- Character = Player.Character
- Torso = Character.Torso
- local Mouse = Player:GetMouse()
- RightArm = Character["Right Arm"]
- LeftArm = Character["Left Arm"]
- RightLeg = Character["Right Leg"]
- LeftLeg = Character["Left Leg"]
- Head = Character.Head
- Neck = Torso.Neck
- Neck.Part0 = nil
- RightSH = Torso["Right Shoulder"]
- RightSH.Part0 = nil
- LeftSH = Torso["Left Shoulder"]
- LeftSH.Part0 = nil
- RightHip = Torso["Right Hip"]
- RightHip.Part0 = nil
- LeftHip = Torso["Left Hip"]
- LeftHip.Part0 = nil
- Humanoid = Character.Humanoid
- HumanoidRP = Humanoid.Torso
- sprinting = false
- animPlaying = false
- game.Lighting.Outlines = false
- if Character:FindFirstChild("Animate") then
- Character.Animate:Destroy()
- end
- function Snap(p0, p1, c0) -- c0
- local joint = Instance.new("Snap", Torso)
- joint.Part0 = p0
- joint.Part1 = p1
- joint.C0 = c0 -- c0
- return joint
- end
- function Weld(p0, p1, c0) -- c0
- local joint = Instance.new("Snap", Torso)
- joint.Part0 = p0
- joint.Part1 = p1
- joint.C0 = c0 -- c0
- return joint
- end
- function genPart(name, anchored, cancollide, brickcolor, material, formfactor, topsur, bottomsur, size)
- Part = Instance.new("Part", SwordModel)
- Part.Name = name
- Part.Anchored = anchored or false
- Part.CanCollide = cancollide or false
- Part.BrickColor = BrickColor.new(brickcolor)
- Part.Material = material
- Part.FormFactor = formfactor or "Custom"
- Part.TopSurface = topsur or "Smooth"
- Part.BottomSurface = bottomsur or "Smooth"
- Part.Size = size or Vector3.new
- return genPart
- end
- RARM = Snap(Torso, RightArm, CFrame.new(1.5, 0.1, -0.5))
- LARM = Snap(Torso, LeftArm, CFrame.new(-1.5, 0.5, 0))
- HEAD = Snap(Torso, Head, CFrame.new(0, 1.5, 0) * CFrame.fromEulerAnglesXYZ(-0.25, -0.35, 0))
- ROOTPART = Snap(Torso, HumanoidRP, CFrame.new(0, 0, 0)) -- Angle Torso
- RLEG = Snap(Torso, RightLeg, CFrame.new(0.5, -2, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- LLEG = Snap(Torso, LeftLeg, CFrame.new(-0.5, -1, -0.7) * CFrame.fromEulerAnglesXYZ(-0.4, -0.3, 0.6))
- local sine = 0
- local lasttick = tick();
- ----------------------------------------------------------------------------------------
- --[[TO DO'S
- 1. Change LLEG's tilt to look more detailed <y>
- 2. Edit jump/fall animations to look more effective <n>
- 3. Move leg's C0 a bit so that it looks more detailed <n>
- 4. Angle Torso in the standing animations
- 5. Tilt Head in sprint animation <y>
- ]]--
- --//-- SWORD --//-
- -- KEEP IN MIND (name, anchored, cancollide, brickcolor, material, formfactor, topsur, bottomsur, size)
- -- (name, parent, scale)
- local SwordModel = Instance.new("Model", Character)
- -- MAIN HANDLE --
- Handle = Instance.new("Part", SwordModel)
- Handle.CanCollide = false
- Handle.Anchored = false
- Handle.FormFactor = "Custom"
- Handle.Size = Vector3.new(1, 1, 1)
- Handle.TopSurface = "Smooth"
- Handle.BottomSurface = "Smooth"
- Weld(Handle, RightArm, CFrame.new(0.95, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 180.5))
- HandleMesh = Instance.new("CylinderMesh", Handle)
- HandleMesh.Scale = Vector3.new(0.4, 1.4, 0.4)
- HandleG = Instance.new("Part", SwordModel)
- HandleG.CanCollide = false
- HandleG.Anchored = false
- HandleG.FormFactor = "Custom"
- HandleG.Size = Vector3.new(1, 1, 1)
- HandleG.TopSurface = "Smooth"
- HandleG.BottomSurface = "Smooth"
- Weld(HandleG, Handle, CFrame.new(0, 0.56, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HandleGMesh = Instance.new("CylinderMesh", HandleG)
- HandleGMesh.Scale = Vector3.new(0.435, 0.2, 0.435)
- HandleG1 = Instance.new("Part", SwordModel)
- HandleG1.CanCollide = false
- HandleG1.Anchored = false
- HandleG1.FormFactor = "Custom"
- HandleG1.Size = Vector3.new(1, 1, 1)
- HandleG1.TopSurface = "Smooth"
- HandleG1.BottomSurface = "Smooth"
- Weld(HandleG1, Handle, CFrame.new(0, 0.31, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HandleG1Mesh = Instance.new("CylinderMesh", HandleG1)
- HandleG1Mesh.Scale = Vector3.new(0.435, 0.25, 0.435)
- gDec1 = Instance.new("Part", SwordModel)
- gDec1.CanCollide = false
- gDec1.Anchored = false
- gDec1.FormFactor = "Custom"
- gDec1.Size = Vector3.new(1, 1, 1)
- gDec1.TopSurface = "Smooth"
- gDec1.BottomSurface = "Smooth"
- gDec1.BrickColor = BrickColor.new("Navy blue")
- gDec1.Material = "Plastic"
- Weld(gDec1, HandleG1, CFrame.new(0, 0, 0))
- gDec1Mesh = Instance.new("CylinderMesh", gDec1)
- gDec1Mesh.Scale = Vector3.new(0.44, 0.05, 0.44)
- HandleG2 = Instance.new("Part", SwordModel)
- HandleG2.CanCollide = false
- HandleG2.Anchored = false
- HandleG2.FormFactor = "Custom"
- HandleG2.Size = Vector3.new(1, 1, 1)
- HandleG2.TopSurface = "Smooth"
- HandleG2.BottomSurface = "Smooth"
- Weld(HandleG2, Handle, CFrame.new(0, 0.04, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HandleG2Mesh = Instance.new("CylinderMesh", HandleG2)
- HandleG2Mesh.Scale = Vector3.new(0.435, 0.25, 0.435)
- gDec2 = Instance.new("Part", SwordModel)
- gDec2.CanCollide = false
- gDec2.Anchored = false
- gDec2.FormFactor = "Custom"
- gDec2.Size = Vector3.new(1, 1, 1)
- gDec2.TopSurface = "Smooth"
- gDec2.BottomSurface = "Smooth"
- gDec2.BrickColor = BrickColor.new("Navy blue")
- gDec2.Material = "Plastic"
- Weld(gDec2, HandleG2, CFrame.new(0, 0, 0))
- gDec2Mesh = Instance.new("CylinderMesh", gDec2)
- gDec2Mesh.Scale = Vector3.new(0.44, 0.05, 0.44)
- HandleG3 = Instance.new("Part", SwordModel)
- HandleG3.CanCollide = false
- HandleG3.Anchored = false
- HandleG3.FormFactor = "Custom"
- HandleG3.Size = Vector3.new(1, 1, 1)
- HandleG3.TopSurface = "Smooth"
- HandleG3.BottomSurface = "Smooth"
- Weld(HandleG3, Handle, CFrame.new(0, -0.23, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HandleG3Mesh = Instance.new("CylinderMesh", HandleG3)
- HandleG3Mesh.Scale = Vector3.new(0.435, 0.25, 0.435)
- gDec3 = Instance.new("Part", SwordModel)
- gDec3.CanCollide = false
- gDec3.Anchored = false
- gDec3.FormFactor = "Custom"
- gDec3.Size = Vector3.new(1, 1, 1)
- gDec3.TopSurface = "Smooth"
- gDec3.BottomSurface = "Smooth"
- gDec3.BrickColor = BrickColor.new("Navy blue")
- gDec3.Material = "Plastic"
- Weld(gDec3, HandleG3, CFrame.new(0, 0, 0))
- gDec3Mesh = Instance.new("CylinderMesh", gDec3)
- gDec3Mesh.Scale = Vector3.new(0.44, 0.05, 0.44)
- HandleG4 = Instance.new("Part", SwordModel)
- HandleG4.CanCollide = false
- HandleG4.Anchored = false
- HandleG4.FormFactor = "Custom"
- HandleG4.Size = Vector3.new(1, 1, 1)
- HandleG4.TopSurface = "Smooth"
- HandleG4.BottomSurface = "Smooth"
- Weld(HandleG4, Handle, CFrame.new(0, -0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HandleG4Mesh = Instance.new("CylinderMesh", HandleG4)
- HandleG4Mesh.Scale = Vector3.new(0.435, 0.25, 0.435)
- gDec4 = Instance.new("Part", SwordModel)
- gDec4.CanCollide = false
- gDec4.Anchored = false
- gDec4.FormFactor = "Custom"
- gDec4.Size = Vector3.new(1, 1, 1)
- gDec4.TopSurface = "Smooth"
- gDec4.BottomSurface = "Smooth"
- gDec4.BrickColor = BrickColor.new("Navy blue")
- gDec4.Material = "Plastic"
- Weld(gDec4, HandleG4, CFrame.new(0, 0, 0))
- gDec4Mesh = Instance.new("CylinderMesh", gDec4)
- gDec4Mesh.Scale = Vector3.new(0.44, 0.05, 0.44)
- -- POMMEL PARTS --
- Handle2 = Instance.new("Part", SwordModel)
- Handle2.CanCollide = false
- Handle2.Anchored = false
- Handle2.FormFactor = "Custom"
- Handle2.Size = Vector3.new(1, 1, 1)
- Handle2.TopSurface = "Smooth"
- Handle2.BottomSurface = "Smooth"
- Weld(Handle2, Handle, CFrame.new(0, -0.15, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- Handle2Mesh = Instance.new("CylinderMesh", Handle2)
- Handle2Mesh.Scale = Vector3.new(0.35, 1.3, 0.35)
- Handle3 = Instance.new("Part", SwordModel)
- Handle3.CanCollide = false
- Handle3.Anchored = false
- Handle3.FormFactor = "Custom"
- Handle3.Size = Vector3.new(1, 1, 1)
- Handle3.TopSurface = "Smooth"
- Handle3.BottomSurface = "Smooth"
- Handle3.BrickColor = BrickColor.new("Really black")
- Weld(Handle3, Handle, CFrame.new(0, -0.25, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- Handle3Mesh = Instance.new("CylinderMesh", Handle3)
- Handle3Mesh.Scale = Vector3.new(0.3, 1.3, 0.3)
- Connector = Instance.new("Part", SwordModel)
- Connector.CanCollide = false
- Connector.Anchored = false
- Connector.FormFactor = "Custom"
- Connector.Size = Vector3.new(1, 1, 1)
- Connector.TopSurface = "Smooth"
- Connector.BottomSurface = "Smooth"
- Connector.BrickColor = BrickColor.new("Really black")
- Weld(Connector, Handle, CFrame.new(0, -0.9, 0) *CFrame.fromEulerAnglesXYZ(0, 0, 0))
- ConM = Instance.new("SpecialMesh", Connector)
- ConM.MeshType = "Sphere"
- ConM.Scale = Vector3.new(0.3, 0.3, 0.3)
- Connector2 = Instance.new("Part", SwordModel)
- Connector2.CanCollide = false
- Connector2.Anchored = false
- Connector2.FormFactor = "Custom"
- Connector2.Size = Vector3.new(1, 1, 1)
- Connector2.TopSurface = "Smooth"
- Connector2.BottomSurface = "Smooth"
- Connector2.BrickColor = BrickColor.new("Really black")
- Weld(Connector2, Connector, CFrame.new(0, -0.9, 0) *CFrame.fromEulerAnglesXYZ(0, 0, 0))
- ConM2 = Instance.new("SpecialMesh", Connector2)
- ConM2.MeshType = "Sphere"
- ConM2.Scale = Vector3.new(0.3, 0.3, 0.3)
- Cone = Instance.new("Part", SwordModel)
- Cone.CanCollide = false
- Cone.Anchored = false
- Cone.FormFactor = "Custom"
- Cone.Size = Vector3.new(1, 1, 1)
- Cone.TopSurface = "Smooth"
- Cone.BottomSurface = "Smooth"
- Cone.BrickColor = BrickColor.new("Really black")
- Weld(Cone, Connector2, CFrame.new(0, -0.39, 0) *CFrame.fromEulerAnglesXYZ(0, 0, 0))
- ConM2 = Instance.new("FileMesh", Cone)
- ConM2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- ConM2.Scale = Vector3.new(0.15, 1, 0.15)
- -- POMMEL --
- Pommel = Instance.new("Part", SwordModel)
- Pommel.CanCollide = false
- Pommel.Anchored = false
- Pommel.FormFactor = "Custom"
- Pommel.Size = Vector3.new(1, 1, 1)
- Pommel.TopSurface = "Smooth"
- Pommel.BottomSurface = "Smooth"
- Weld(Pommel, Handle, CFrame.new(0, -1.35, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- PommelMesh = Instance.new("FileMesh", Pommel)
- PommelMesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
- PommelMesh.Scale = Vector3.new(0.9, 0.9, 0.9)
- Cone2 = Instance.new("Part", SwordModel)
- Cone2.CanCollide = false
- Cone2.Anchored = false
- Cone2.FormFactor = "Custom"
- Cone2.Size = Vector3.new(1, 1, 1)
- Cone2.TopSurface = "Smooth"
- Cone2.BottomSurface = "Smooth"
- Cone2.BrickColor = BrickColor.new("Really black")
- Weld(Cone2, Pommel, CFrame.new(0, -0.65, 0) *CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-40)))
- Con2M2 = Instance.new("FileMesh", Cone2)
- Con2M2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- Con2M2.Scale = Vector3.new(0.06, 0.6, 0.06)
- Cone3 = Instance.new("Part", SwordModel)
- Cone3.CanCollide = false
- Cone3.Anchored = false
- Cone3.FormFactor = "Custom"
- Cone3.Size = Vector3.new(1, 1, 1)
- Cone3.TopSurface = "Smooth"
- Cone3.BottomSurface = "Smooth"
- Cone3.BrickColor = BrickColor.new("Really black")
- Weld(Cone3, Pommel, CFrame.new(0, -0.65, 0) *CFrame.fromEulerAnglesXYZ(0, 0, math.rad(40)))
- Con3M2 = Instance.new("FileMesh", Cone3)
- Con3M2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- Con3M2.Scale = Vector3.new(0.06, 0.6, 0.06)
- Cone4 = Instance.new("Part", SwordModel)
- Cone4.CanCollide = false
- Cone4.Anchored = false
- Cone4.FormFactor = "Custom"
- Cone4.Size = Vector3.new(1, 1, 1)
- Cone4.TopSurface = "Smooth"
- Cone4.BottomSurface = "Smooth"
- Cone4.BrickColor = BrickColor.new("Really black")
- Weld(Cone4, Pommel, CFrame.new(0, -0.65, 0) *CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-80)))
- Con4M2 = Instance.new("FileMesh", Cone4)
- Con4M2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- Con4M2.Scale = Vector3.new(0.06, 0.6, 0.06)
- Cone5 = Instance.new("Part", SwordModel)
- Cone5.CanCollide = false
- Cone5.Anchored = false
- Cone5.FormFactor = "Custom"
- Cone5.Size = Vector3.new(1, 1, 1)
- Cone5.TopSurface = "Smooth"
- Cone5.BottomSurface = "Smooth"
- Cone5.BrickColor = BrickColor.new("Really black")
- Weld(Cone5, Pommel, CFrame.new(0, -0.65, 0) *CFrame.fromEulerAnglesXYZ(0, 0, math.rad(80)))
- Con5M2 = Instance.new("FileMesh", Cone5)
- Con5M2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- Con5M2.Scale = Vector3.new(0.06, 0.6, 0.06)
- Cone6 = Instance.new("Part", SwordModel)
- Cone6.CanCollide = false
- Cone6.Anchored = false
- Cone6.FormFactor = "Custom"
- Cone6.Size = Vector3.new(1, 1, 1)
- Cone6.TopSurface = "Smooth"
- Cone6.BottomSurface = "Smooth"
- Cone6.BrickColor = BrickColor.new("Really black")
- Weld(Cone6, Pommel, CFrame.new(0, -0.65, 0) *CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-120)))
- Con4M2 = Instance.new("FileMesh", Cone6)
- Con4M2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- Con4M2.Scale = Vector3.new(0.06, 0.6, 0.06)
- Cone7 = Instance.new("Part", SwordModel)
- Cone7.CanCollide = false
- Cone7.Anchored = false
- Cone7.FormFactor = "Custom"
- Cone7.Size = Vector3.new(1, 1, 1)
- Cone7.TopSurface = "Smooth"
- Cone7.BottomSurface = "Smooth"
- Cone7.BrickColor = BrickColor.new("Really black")
- Weld(Cone7, Pommel, CFrame.new(0, -0.65, 0) *CFrame.fromEulerAnglesXYZ(0, 0, math.rad(120)))
- Con5M2 = Instance.new("FileMesh", Cone7)
- Con5M2.MeshId = "http://www.roblox.com/asset/?id=1033714"
- Con5M2.Scale = Vector3.new(0.06, 0.6, 0.06)
- Chakram = Instance.new("Part", SwordModel)
- Chakram.CanCollide = false
- Chakram.Anchored = false
- Chakram.FormFactor = "Custom"
- Chakram.Size = Vector3.new(0, 0, 0)
- Chakram.TopSurface = "Smooth"
- Chakram.BottomSurface = "Smooth"
- Chakram.BrickColor = BrickColor.new("Navy blue")
- Weld(Chakram, Pommel, CFrame.new(0, 0, 0))
- ChakramMesh = Instance.new("FileMesh", Chakram)
- ChakramMesh.MeshId = "http://www.roblox.com/asset/?id=47260990"
- ChakramMesh.Scale = Vector3.new(0.9, 0.9, 0.9)
- Motor = Instance.new("Motor", Chakram)
- Motor.DesiredAngle = 1000000000
- Motor.MaxVelocity = 0.1
- Motor.Part1 = Chakram
- Motor.Part0 = Pommel
- Motor.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
- -- GUARD --
- Guard = Instance.new("Part", SwordModel)
- Guard.CanCollide = false
- Guard.Anchored = false
- Guard.FormFactor = "Custom"
- Guard.Size = Vector3.new(1.3, 0.15, 0.5)
- Guard.TopSurface = "Smooth"
- Guard.BottomSurface = "Smooth"
- Weld(Guard, Handle, CFrame.new(0, 0.65, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- Hilt = Instance.new("Part", SwordModel)
- Hilt.CanCollide = false
- Hilt.Anchored = false
- Hilt.FormFactor = "Custom"
- Hilt.Size = Vector3.new(0.3, 0.15, 0.5)
- Hilt.TopSurface = "Smooth"
- Hilt.BottomSurface = "Smooth"
- Weld(Hilt, Guard, CFrame.new(-0.54, -0.43, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(45)))
- Hilt2 = Instance.new("Part", SwordModel)
- Hilt2.CanCollide = false
- Hilt2.Anchored = false
- Hilt2.FormFactor = "Custom"
- Hilt2.Size = Vector3.new(0.3, 0.15, 0.5)
- Hilt2.TopSurface = "Smooth"
- Hilt2.BottomSurface = "Smooth"
- Weld(Hilt2, Guard, CFrame.new(0.54, -0.43, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-45)))
- HiltC = Instance.new("Part", SwordModel)
- HiltC.CanCollide = false
- HiltC.Anchored = false
- HiltC.FormFactor = "Custom"
- HiltC.Size = Vector3.new(1, 1, 1)
- HiltC.TopSurface = "Smooth"
- HiltC.BottomSurface = "Smooth"
- Weld(HiltC, Hilt, CFrame.new(-0.15, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HiltCMesh = Instance.new("CylinderMesh", HiltC)
- HiltCMesh.Scale = Vector3.new(0.5, 0.2, 0.5)
- HiltC2 = Instance.new("Part", SwordModel)
- HiltC2.CanCollide = false
- HiltC2.Anchored = false
- HiltC2.FormFactor = "Custom"
- HiltC2.Size = Vector3.new(1, 1, 1)
- HiltC2.TopSurface = "Smooth"
- HiltC2.BottomSurface = "Smooth"
- Weld(HiltC2, Hilt2, CFrame.new(0.15, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- HiltC2Mesh = Instance.new("CylinderMesh", HiltC2)
- HiltC2Mesh.Scale = Vector3.new(0.5, 0.2, 0.5)
- -- BLADE --
- Blade = Instance.new("Part", SwordModel)
- Blade.CanCollide = false
- Blade.Anchored = false
- Blade.FormFactor = "Custom"
- Blade.Size = Vector3.new(0.7, 3.5, 0.35)
- Blade.TopSurface = "Smooth"
- Blade.BottomSurface = "Smooth"
- Weld(Blade, Guard, CFrame.new(0, 1.8, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- BladeT = Instance.new("Part", SwordModel)
- BladeT.CanCollide = false
- BladeT.Anchored = false
- BladeT.FormFactor = "Custom"
- BladeT.Size = Vector3.new(1, 1, 1)
- BladeT.TopSurface = "Smooth"
- BladeT.BottomSurface = "Smooth"
- Weld(BladeT, Blade, CFrame.new(0, -0.175, 2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(90), 0))
- BladeTM = Instance.new("SpecialMesh", BladeT)
- BladeTM.MeshType = "Wedge"
- BladeTM.Scale = Vector3.new(0.35, 0.35, 0.5)
- BladeT2 = Instance.new("Part", SwordModel)
- BladeT2.CanCollide = false
- BladeT2.Anchored = false
- BladeT2.FormFactor = "Custom"
- BladeT2.Size = Vector3.new(1, 1, 1)
- BladeT2.TopSurface = "Smooth"
- BladeT2.BottomSurface = "Smooth"
- Weld(BladeT2, Blade, CFrame.new(0, -0.175, 2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(-90), 0))
- BladeT2M = Instance.new("SpecialMesh", BladeT2)
- BladeT2M.MeshType = "Wedge"
- BladeT2M.Scale = Vector3.new(0.35, 0.35, 0.5)
- -- BLADE'S EDGE --
- BladeE = Instance.new("Part", SwordModel)
- BladeE.CanCollide = false
- BladeE.Anchored = false
- BladeE.FormFactor = "Custom"
- BladeE.Size = Vector3.new(1, 1, 1)
- BladeE.TopSurface = "Smooth"
- BladeE.BottomSurface = "Smooth"
- Weld(BladeE, Blade, CFrame.new(0, -0.0875, 0.45) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(90)))
- BladeEM = Instance.new("SpecialMesh", BladeE)
- BladeEM.MeshType = "Wedge"
- BladeEM.Scale = Vector3.new(3.5, 0.175, 0.2)
- BladeE2 = Instance.new("Part", SwordModel)
- BladeE2.CanCollide = false
- BladeE2.Anchored = false
- BladeE2.FormFactor = "Custom"
- BladeE2.Size = Vector3.new(1, 1, 1)
- BladeE2.TopSurface = "Smooth"
- BladeE2.BottomSurface = "Smooth"
- Weld(BladeE2, Blade, CFrame.new(0, -0.0875, 0.45) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(-90)))
- BladeE2M = Instance.new("SpecialMesh", BladeE2)
- BladeE2M.MeshType = "Wedge"
- BladeE2M.Scale = Vector3.new(3.5, 0.175, 0.2)
- BladeE3 = Instance.new("Part", SwordModel)
- BladeE3.CanCollide = false
- BladeE3.Anchored = false
- BladeE3.FormFactor = "Custom"
- BladeE3.Size = Vector3.new(1, 1, 1)
- BladeE3.TopSurface = "Smooth"
- BladeE3.BottomSurface = "Smooth"
- Weld(BladeE3, Blade, CFrame.new(0, -0.0875, 0.45) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, math.rad(-90)))
- BladeE3M = Instance.new("SpecialMesh", BladeE3)
- BladeE3M.MeshType = "Wedge"
- BladeE3M.Scale = Vector3.new(3.5, 0.175, 0.2)
- BladeE4 = Instance.new("Part", SwordModel)
- BladeE4.CanCollide = false
- BladeE4.Anchored = false
- BladeE4.FormFactor = "Custom"
- BladeE4.Size = Vector3.new(1, 1, 1)
- BladeE4.TopSurface = "Smooth"
- BladeE4.BottomSurface = "Smooth"
- Weld(BladeE4, Blade, CFrame.new(0, -0.087, 0.45) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(90)))
- BladeE4M = Instance.new("SpecialMesh", BladeE4)
- BladeE4M.MeshType = "Wedge"
- BladeE4M.Scale = Vector3.new(3.5, 0.175, 0.2)
- -- BLADE TIP EDGE --
- BladeTE3 = Instance.new("Part", SwordModel)
- BladeTE3.CanCollide = false
- BladeTE3.Anchored = false
- BladeTE3.FormFactor = "Custom"
- BladeTE3.Size = Vector3.new(1, 1, 1)
- BladeTE3.TopSurface = "Smooth"
- BladeTE3.BottomSurface = "Smooth"
- BladeTE3.Transparency = 1
- Weld(BladeTE3, BladeT, CFrame.new(0, -0.087, 0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(-55), math.rad(90)))
- BladeTE3M = Instance.new("SpecialMesh", BladeTE3)
- BladeTE3M.MeshType = "Wedge"
- BladeTE3M.Scale = Vector3.new(0.61, 0.175, 0.2)
- BladeTE4 = Instance.new("Part", SwordModel)
- BladeTE4.CanCollide = false
- BladeTE4.Anchored = false
- BladeTE4.FormFactor = "Custom"
- BladeTE4.Size = Vector3.new(1, 1, 1)
- BladeTE4.TopSurface = "Smooth"
- BladeTE4.BottomSurface = "Smooth"
- BladeTE4.Transparency = 1
- Weld(BladeTE4, BladeTE3, CFrame.new(0, -0.175, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(180)))
- BladeTE4M = Instance.new("SpecialMesh", BladeTE4)
- BladeTE4M.MeshType = "Wedge"
- BladeTE4M.Scale = Vector3.new(0.62, 0.175, 0.2)
- --
- BladeTE32 = Instance.new("Part", SwordModel)
- BladeTE32.CanCollide = false
- BladeTE32.Anchored = false
- BladeTE32.FormFactor = "Custom"
- BladeTE32.Size = Vector3.new(1, 1, 1)
- BladeTE32.TopSurface = "Smooth"
- BladeTE32.BottomSurface = "Smooth"
- BladeTE32.Transparency = 1
- Weld(BladeTE32, BladeT, CFrame.new(0.2, -0.087, 0.385) * CFrame.fromEulerAnglesXYZ(0, math.rad(-55), math.rad(-90)))
- BladeTE32M = Instance.new("SpecialMesh", BladeTE32)
- BladeTE32M.MeshType = "Wedge"
- BladeTE32M.Scale = Vector3.new(0.61, 0.175, 0.2)
- BladeTE42 = Instance.new("Part", SwordModel)
- BladeTE42.CanCollide = false
- BladeTE42.Anchored = false
- BladeTE42.FormFactor = "Custom"
- BladeTE42.Size = Vector3.new(1, 1, 1)
- BladeTE42.TopSurface = "Smooth"
- BladeTE42.BottomSurface = "Smooth"
- BladeTE42.Transparency = 1
- Weld(BladeTE42, BladeTE32, CFrame.new(0, -0.175, 0) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-180)))
- BladeTE42M = Instance.new("SpecialMesh", BladeTE42)
- BladeTE42M.MeshType = "Wedge"
- BladeTE42M.Scale = Vector3.new(0.61, 0.175, 0.2)
- -- POINT --
- Point = Instance.new("Part", SwordModel)
- Point.CanCollide = false
- Point.Anchored = false
- Point.FormFactor = "Custom"
- Point.Size = Vector3.new(1, 1, 1)
- Point.TopSurface = "Smooth"
- Point.BottomSurface = "Smooth"
- Point.Reflectance = 0
- Weld(Point, Blade, CFrame.new(0, 1.75, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0))
- PointM = Instance.new("FileMesh", Point)
- PointM.MeshId = "http://www.roblox.com/asset/?id=9756362"
- PointM.Scale = Vector3.new(0.78, 3, 0.31)
- for i,v in pairs(SwordModel:getChildren()) do
- if v.ClassName == "Part" then
- v.Material = "SmoothPlastic"
- end
- end
- --//-- MOVEMENT ANIMATION LOCATED HERE --//--
- function WalkAnim()
- RARM.C0 = clerp(RARM.C0, CFrame.new(1.3, 0.2, -0.75) * CFrame.fromEulerAnglesXYZ(0, 1.9, 1), .2)
- LARM.C0 = clerp(LARM.C0, CFrame.new(-1.5, 0.3, 0.5) * CFrame.fromEulerAnglesXYZ(0, .9, -.6), .1)
- ROOTPART.C0 = clerp(ROOTPART.C0, CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0.25,0,0), .1)
- RLEG.C0 = clerp(RLEG.C0, CFrame.new(.5, -1.9, math.sin(sine*3)) * CFrame.fromEulerAnglesXYZ(-math.sin(sine*3), 0, 0),.2)
- LLEG.C0 = clerp(LLEG.C0, CFrame.new(-.5, -1.9, -math.sin(sine*3)) * CFrame.fromEulerAnglesXYZ(math.sin(sine*3), 0, 0),.2)
- HEAD.C0 = clerp(HEAD.C0, CFrame.new(0,1.5,0) * CFrame.fromEulerAnglesXYZ(0.3, 0, 0), .1)
- sine = sine + math.rad(3.5)
- end
- --//-- JUMPING/FALLING ANIMATION LOCATED HERE --//--
- function SprintJumpAnim()
- RARM.C0 = clerp(RARM.C0, CFrame.new(2, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0.5, 1), .15)
- LARM.C0 = clerp(LARM.C0, CFrame.new(-2, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, -0.5, -1), .15)
- ROOTPART.C0 = clerp(ROOTPART.C0, CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0.35,0,0), .15)
- RLEG.C0 = clerp(RLEG.C0, CFrame.new(0.5, -2, 0),.15)
- LLEG.C0 = clerp(LLEG.C0, CFrame.new(-0.55, -1, -0.3) * CFrame.fromEulerAnglesXYZ(-0.4, 0, 0),.15)
- HEAD.C0 = clerp(HEAD.C0, CFrame.new(0, 1.5, 0) * CFrame.fromEulerAnglesXYZ(0.5, 0, 0), .15)
- end
- function FallAnim()
- RARM.C0 = clerp(RARM.C0, CFrame.new(1.5, 1.5, 0.35) * CFrame.fromEulerAnglesXYZ(0, -0.5, 2.3), .15)
- LARM.C0 = clerp(LARM.C0, CFrame.new(-1.5, 1.5, 0.35) * CFrame.fromEulerAnglesXYZ(0, 0.5, -2.3), .15)
- ROOTPART.C0 = clerp(ROOTPART.C0, CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(-0.4, 0, 0), .15)
- RLEG.C0 = clerp(RLEG.C0, CFrame.new(0.5, -2, 0),.15)
- LLEG.C0 = clerp(LLEG.C0, CFrame.new(-0.55, -1, -0.3) * CFrame.fromEulerAnglesXYZ(-0.4, 0, 0),.15)
- HEAD.C0 = clerp(HEAD.C0, CFrame.new(0, 1.5, -0.3) * CFrame.fromEulerAnglesXYZ(-0.6, 0, 0), .15)
- end
- function AddForce(part)
- if(not part:FindFirstChild("BodyForce"))then
- bf = Instance.new("BodyForce")
- bf.force = Vector3.new ( 0, part.Size.X * part.Size.Y * part.Size.Z * 85, 0)
- bf.Parent = part
- end
- end
- function Gather(model)
- local m = model:GetChildren()
- local i = 1
- for i = 1, #m do
- if(m[i]:IsA("Part"))then
- AddForce(m[i])
- elseif(m[i]:IsA("Model"))then
- Gather(m[i])
- end
- end
- end
- Gather(Character)
- --//-- SPRINT ANIMATIONS LOCATED HERE --//--
- function SprintAnim()
- Humanoid.WalkSpeed = 65
- RARM.C0 = clerp(RARM.C0, CFrame.new(1.6, 0.2, -0.2) * CFrame.fromEulerAnglesXYZ(0, 1, 1), .2)
- LARM.C0 = clerp(LARM.C0, CFrame.new(-1.5, 0.3, 0.5) * CFrame.fromEulerAnglesXYZ(0, 1.1, -1), .2)
- ROOTPART.C0 = clerp(ROOTPART.C0, CFrame.new(0, 0.3, 0) * CFrame.fromEulerAnglesXYZ(0.4,0,0), .1)
- RLEG.C0 = clerp(RLEG.C0, CFrame.new(.5, -1.8, math.sin(sine*3)) * CFrame.fromEulerAnglesXYZ(-math.sin(sine*3), 0, 0),.2)
- LLEG.C0 = clerp(LLEG.C0, CFrame.new(-.5, -1.8, -math.sin(sine*3)) * CFrame.fromEulerAnglesXYZ(math.sin(sine*3), 0, 0),.2)
- HEAD.C0 = clerp(HEAD.C0, CFrame.new(0,1.5,0) * CFrame.fromEulerAnglesXYZ(0.35, 0, 0), .2)
- sine = sine + math.rad(4)
- end
- --//-- STAND-BY ANIMATIONS LOCATED HERE --//--
- function Stand()
- RARM.C0 = clerp(RARM.C0, CFrame.new(1.3, 0.2, -0.75) * CFrame.fromEulerAnglesXYZ(0, 1.9, 1), .4)
- LARM.C0 = clerp(LARM.C0, CFrame.new(-1.5, 0.1, 0.2) * CFrame.fromEulerAnglesXYZ(0, .5, -.4), .4)
- ROOTPART.C0 = clerp(ROOTPART.C0, CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0), .4)
- RLEG.C0 = clerp(RLEG.C0, CFrame.new(0.5, -2, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0),.2)
- LLEG.C0 = clerp(LLEG.C0, CFrame.new(-0.45, -1, -0.7) * CFrame.fromEulerAnglesXYZ(-0.4, -0.3, 0.6),.4)
- HEAD.C0 = clerp(HEAD.C0, CFrame.new(0, 1.55, - .2) * CFrame.fromEulerAnglesXYZ(-0.25, -0.35, 0), .4)
- end
- function Breathe()
- RARM.C0 = clerp(RARM.C0, CFrame.new(1.3, 0.2, -0.75) * CFrame.fromEulerAnglesXYZ(0, 1.9, 1), .1)
- LARM.C0 = clerp(LARM.C0, CFrame.new(-1.5, 0.1, 0.2) * CFrame.fromEulerAnglesXYZ(0, .5, -.4), .1)
- ROOTPART.C0 = clerp(ROOTPART.C0, CFrame.new(0, math.sin(sine*3)*.02, 0) * CFrame.fromEulerAnglesXYZ(0,0,0), .1)
- RLEG.C0 = clerp(RLEG.C0, CFrame.new(0.5, -2 + math.sin(sine*3)*.02, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0) , .1)
- LLEG.C0 = clerp(LLEG.C0, CFrame.new(-0.45, -1 + math.sin(sine*3)*.02, -0.7) * CFrame.fromEulerAnglesXYZ(-0.4, -0.3, 0.6), .1)
- HEAD.C0 = clerp(HEAD.C0, CFrame.new(0, 1.55, - .2) * CFrame.fromEulerAnglesXYZ(-0.25, -0.35, 0), .1)
- sine = sine + math.rad(1.5)
- end
- --//-- SHEATHE/SHEATHEUP (rn in testing) --//--
- function Sheathe()
- for i = 0, 0.1, 1 do
- RARM.C0 = clerp(RARM.C0, CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0), .1)
- end
- end
- function SheatheUp()
- RARM.C0 = clerp(RARM.C0, CFrame.new(1.3, 0.2, -0.75) * CFrame.fromEulerAnglesXYZ(0, 1.9, 1), .4)
- end
- --//-- ATTACKS (oh wait need to do sheathing first) --//
- Mouse.KeyDown:connect(function(key)
- if string.byte(key) == 48 then
- sprinting = true
- SprintAnim()
- end
- end)
- Mouse.KeyUp:connect(function(key)
- if string.byte(key) == 48 then
- sprinting = false
- Humanoid.WalkSpeed = 16
- end
- end)
- game:service("RunService").RenderStepped:connect(function()
- if (Humanoid.Jump) then
- SprintJumpAnim()
- elseif Vector3.new(0,Torso.Velocity.y,0).magnitude > 2 then
- FallAnim()
- animPlaying = true
- elseif Vector3.new(Torso.Velocity.x, 0, Torso.Velocity.z).magnitude > 2 and sprinting == false then
- lasttick = nil;
- WalkAnim()
- animPlaying = true
- elseif Vector3.new(Torso.Velocity.x, 0, Torso.Velocity.z).magnitude > 2 and sprinting == true then
- lasttick = nil;
- SprintAnim()
- breath = false
- animPlaying = true
- elseif Vector3.new(Torso.Velocity.x, 0, Torso.Velocity.z).magnitude < 2 then
- if (lasttick == nil) then
- lasttick = tick();
- end
- if tick() - lasttick < math.huge then
- breath = true
- Breathe()
- animPlaying = false
- else
- Stand()
- animPlaying = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement