Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local asin = math.asin
- local atan2 = math.atan2
- local rad = math.rad
- local sin = math.sin
- local abs = math.abs
- local ceil = math.ceil
- local function getAngles(cf)
- local sx,sy,sz,m00,m01,m02,m10,m11,m12,m20,m21,m22 = cf:components()
- return atan2(-m12,m22),asin(m02),atan2(-m01,m00)
- end
- Lerp = {
- Number = function(C1,C2,inc)
- return C1 + (C2 - C1) * inc
- end;
- CFrame = function(a,b,m)
- local c,d={a:components()},{b:components()}
- table.foreach(c,function(a,b)c[a]=c[a]+(d[a]-c[a])*m end)
- return CFrame.new(unpack(c))
- end;
- }
- local function genWeld(a,b)
- local w = Instance.new("Weld",a)
- w.Part0 = a
- w.Part1 = b
- return w
- end
- Part = function(x,y,z,color,tr,cc,an,parent)
- local p = Instance.new('Part',parent or Weapon)
- p.formFactor = 'Custom'
- p.Size = Vector3.new(x,y,z)
- p.BrickColor = BrickColor.new(color)
- p.CanCollide = cc
- p.Transparency = tr
- p.Anchored = an
- p.TopSurface,p.BottomSurface = 0,0
- p:BreakJoints()
- return p
- end
- Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
- local w = Instance.new('Motor',par or p0)
- w.Part0 = p0
- w.Part1 = p1
- w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
- return w
- end
- Mesh = function(par,num,x,y,z)
- local msh = nil
- if num == 1 then
- msh = Instance.new("CylinderMesh",par)
- elseif num == 2 then
- msh = Instance.new("SpecialMesh",par)
- msh.MeshType = 'Wedge'
- elseif num == 3 then
- msh = Instance.new("BlockMesh",par)
- elseif type(num) == 'string' then
- msh = Instance.new("SpecialMesh",par)
- msh.MeshId = num
- end
- msh.Scale = Vector3.new(x,y,z)
- return msh
- end
- anglespeed = 1
- yeet = 0
- dnc=0
- count = 0
- angle = 0
- counttime = 50
- countspeed = 1
- speed = 1
- hats={}
- song={}
- local plr=game.Players.LocalPlayer
- local pchar=plr.Character
- local torso=pchar.Torso
- local mouse=plr:GetMouse()
- local Neck = genWeld(pchar.Torso,pchar.Head)
- Neck.C0 = CFrame.new(0,1,0)
- Neck.C1 = CFrame.new(0,-0.5,0)
- local LeftShoulder = genWeld(pchar.Torso,pchar['Left Arm'])
- LeftShoulder.C0 = CFrame.new(-1,0.5,0)
- LeftShoulder.C1 = CFrame.new(0.5,0.5,0)
- RightShoulder = genWeld(pchar.Torso,pchar['Right Arm'])
- RightShoulder.C0 = CFrame.new(1,0.5,0)
- RightShoulder.C1 = CFrame.new(-0.5,0.5,0)
- local LeftHip = genWeld(pchar.Torso,pchar['Left Leg'])
- LeftHip.C0 = CFrame.new(-1,-1,0)
- LeftHip.C1 = CFrame.new(-0.5,1,0)
- local RightHip = genWeld(pchar.Torso,pchar['Right Leg'])
- RightHip.C0 = CFrame.new(1,-1,0)
- RightHip.C1 = CFrame.new(0.5,1,0)
- local RootJoint = genWeld(pchar.HumanoidRootPart,pchar.Torso)
- RootJoint.C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
- RootJoint.C1 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
- local w1 = Instance.new("Part",pchar)
- w1.CanCollide = false
- w1.FormFactor="Custom"
- w1.Size=Vector3.new(.2,.2,.2)
- w1mesh = Instance.new("SpecialMesh",w1)
- w1mesh.MeshId="rbxassetid://90821133"
- w1mesh.Scale=Vector3.new(2,2,1)
- wing1 = Weld(w1,pchar.Torso,-2.75,1,.75,0,0,0,w1)
- local w2 = Instance.new("Part",pchar)
- w2.CanCollide = false
- w2.FormFactor="Custom"
- w2.Size=Vector3.new(.2,.2,.2)
- w2mesh = Instance.new("SpecialMesh",w2)
- w2mesh.MeshId="rbxassetid://90821193"
- w2mesh.Scale=Vector3.new(2,2,1)
- wing2 = Weld(w2,pchar.Torso,2.75,1,.75,0,0,0,w2)
- -- hair
- for i,v in pairs(pchar:GetChildren()) do
- if v:IsA("Hat") then
- v:Destroy()
- end
- end
- hat = Instance.new("Part",pchar)
- hat.CanCollide=false
- hat.TopSurface="Smooth"
- hat.BottomSurface="Smooth"
- hat.Size=Vector3.new(1.67, 2.18, 1.9)
- hat.BrickColor=BrickColor.new("Bright red")
- Weld(hat,pchar.Head,0,-1.2,0,0,0,0,hat)
- hatmesh = Instance.new("SpecialMesh",hat)
- hatmesh.MeshId="http://www.roblox.com/asset/?id=164382853"
- hatmesh.Scale = Vector3.new(1.1, 1.6, 1.1)
- local function newLerpTo(weld)
- return {
- Weld = weld; -- The weld that will lerp
- To = weld.C0; -- Where it will lerp to; a CFrame
- Cache = weld.C0; -- Cache of original position; it helps when making anim keyframes
- Speed = 0.1; -- Speed of lerp. 0.1 or 0.2 is best
- }
- end
- LerpTo = {
- Neck = newLerpTo(Neck);
- LeftArm = newLerpTo(LeftShoulder);
- RightArm = newLerpTo(RightShoulder);
- LeftLeg = newLerpTo(LeftHip);
- RightLeg = newLerpTo(RightHip);
- RootJoint = newLerpTo(RootJoint);
- Wing1 = newLerpTo(wing1);
- Wing2 = newLerpTo(wing2);
- }
- local anim = true
- local function updateanims()
- if anim==true then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
- anglespeed = 1/3
- LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(sin(angle)*0.05,0,0)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(45),rad(15),rad(15))
- LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(45),rad(-15),rad(-15))
- LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(0,0,abs(sin(angle))*0.1)
- LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(0,0,-abs(sin(angle))*0.1)
- end
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
- anglespeed = 1.5
- LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,math.sin(angle)*0.05)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(sin(angle)*.8,0,0)
- LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
- LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
- LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(sin(angle)*.8,0,0)
- end
- end
- end
- local attacking = false
- mouse.Button1Down:connect(function()
- if attacking == false then
- attacking = true
- anim = false
- LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(sin(angle)*0.05,0,0)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(0),rad(0),0)
- LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(0),0,0)
- LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(0,0,abs(sin(angle))*0.1)
- LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(0,0,-abs(sin(angle))*0.1)
- LerpTo.RightArm.To=LerpTo.RightArm.Cache * CFrame.Angles(rad(170),rad(0),rad(0))
- wait(.5)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(0),rad(0),rad(0))
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(rad(170),rad(0),rad(0))
- wait(.5)
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(rad(0),rad(0),rad(0))
- wait(.5)
- anim = true
- attacking = false
- end
- end)
- mouse.KeyDown:connect(function(key)
- if key == "q" and attacking == false then
- attacking = true
- anim = false
- anglespeed = 3
- LerpTo.RightArm.To = LerpTo.RightArm.Cache*CFrame.Angles(rad(170),rad(0),rad(15))
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(rad(170),rad(0),rad(-15))
- wait(.25)
- LerpTo.RightArm.To=LerpTo.RightArm.Cache*CFrame.Angles(rad(25),rad(0),rad(-25))*CFrame.new(-.75,-.30,0)
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(rad(25),rad(0),rad(25))*CFrame.new(.75,-.30,0)
- wait(.25)
- LerpTo.RightArm.To=LerpTo.RightArm.Cache*CFrame.Angles(rad(25),rad(90),rad(25))*CFrame.new(-.75,-.30,0)
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(rad(25),rad(-90),rad(-25))*CFrame.new(.75,-.30,0)
- wait(.25)
- LerpTo.RightArm.To=LerpTo.RightArm.Cache*CFrame.Angles(rad(170),rad(180),rad(-25))*CFrame.new(-.75,-.30,0)
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(rad(170),rad(180),rad(25))*CFrame.new(.75,-.30,0)
- wait(.5)
- attacking = false
- anim = true
- end
- end)
- local sword = Instance.new("Model",pchar)
- sword.Name="XXEpicoBladeXX"
- handlep1 = Instance.new("Part",sword)
- handlep1.CanCollide=false
- handlep1.FormFactor="Custom"
- handlep1.Size=Vector3.new(0.2,0.2,1.3)
- handlep1.TopSurface="Smooth"
- handlep1.BottomSurface="Smooth"
- handlep1.BrickColor=BrickColor.new("Really black")
- Weld(handlep1,pchar['Right Arm'],0,-1,0,0,0,0,handlep1)
- bladep1 = Instance.new("Part",sword)
- bladep1.CanCollide=false
- bladep1.FormFactor="Custom"
- bladep1.Size=Vector3.new(0.2,0.5,3.4)
- bladep1.TopSurface="Smooth"
- bladep1.BottomSurface="Smooth"
- bladep1.BrickColor=BrickColor.new("Really black")
- Weld(bladep1,handlep1,0,0,-2.2,0,0,0,bladep1)
- bladep2=Instance.new("WedgePart",sword)
- bladep2.CanCollide=false
- bladep2.FormFactor="Custom"
- bladep2.Size=Vector3.new(0.2,0.5,0.5)
- bladep2.TopSurface="Smooth"
- bladep2.BottomSurface="Smooth"
- bladep2.BrickColor=BrickColor.new("Really black")
- Weld(bladep2,bladep1,0,0,-1.95,0,0,math.pi/1,bladep1)
- bladep1.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") and attacking == true then
- hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
- end
- end)
- bladep2.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") and attacking == true then
- hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
- end
- end)
- handlep2 = Instance.new("Part",sword)
- handlep2.CanCollide=false
- handlep2.FormFactor="Custom"
- handlep2.Size=Vector3.new(0.2,0.2,1.3)
- handlep2.TopSurface="Smooth"
- handlep2.BottomSurface="Smooth"
- handlep2.BrickColor=BrickColor.new("Really black")
- Weld(handlep2,pchar['Left Arm'],0,-1,0,0,0,0,handlep2)
- bladep3 = Instance.new("Part",sword)
- bladep3.CanCollide=false
- bladep3.FormFactor="Custom"
- bladep3.Size=Vector3.new(0.2,0.5,3.4)
- bladep3.TopSurface="Smooth"
- bladep3.BottomSurface="Smooth"
- bladep3.BrickColor=BrickColor.new("Really black")
- Weld(bladep3,handlep2,0,0,-2.2,0,0,0,bladep3)
- bladep4=Instance.new("WedgePart",sword)
- bladep4.CanCollide=false
- bladep4.FormFactor="Custom"
- bladep4.Size=Vector3.new(0.2,0.5,0.5)
- bladep4.TopSurface="Smooth"
- bladep4.BottomSurface="Smooth"
- bladep4.BrickColor=BrickColor.new("Really black")
- Weld(bladep4,bladep3,0,0,-1.95,0,0,math.pi/1,bladep3)
- bladep3.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") and attacking == true then
- hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
- end
- end)
- bladep4.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") and attacking == true then
- hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
- end
- end)
- Spawn(function()
- while wait()do
- angle = (angle % 100) + anglespeed/10 -- no matter whut it has to be in a loop or its on exticy
- end
- end)
- meo=0
- sdeb=false
- game:service'RunService'.RenderStepped:connect(function()
- meo=meo+1
- for _,v in pairs(LerpTo) do
- v.Weld.C0 = Lerp.CFrame(v.Weld.C0,v.To,v.Speed)end
- updateanims()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement