Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --holy sword
- local lp = game.Players.LocalPlayer
- local chr = lp.Character
- local lp = game.Players.LocalPlayer
- local chr = lp.Character
- local mouse = lp:GetMouse()
- local soulsteal = false
- local percent = 0
- local plr=game.Players.LocalPlayer
- local chr=plr.Character
- 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 dmg = 3
- 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
- anglespeed = 1
- yeet = 0
- count = 0
- angle = 0
- local attacking = false
- speed = 1
- local plr=game.Players.LocalPlayer
- local chr=plr.Character
- local torso=chr.Torso
- local mouse=plr:GetMouse()
- local Neck = genWeld(chr.Torso,chr.Head)
- Neck.C0 = CFrame.new(0,1,0)
- Neck.C1 = CFrame.new(0,-0.5,0)
- local LeftShoulder = genWeld(chr.Torso,chr['Left Arm'])
- LeftShoulder.C0 = CFrame.new(-1,0.5,0)
- LeftShoulder.C1 = CFrame.new(0.5,0.5,0)
- RightShoulder = genWeld(chr.Torso,chr['Right Arm'])
- RightShoulder.C0 = CFrame.new(1,0.5,0)
- RightShoulder.C1 = CFrame.new(-0.5,0.5,0)
- local LeftHip = genWeld(chr.Torso,chr['Left Leg'])
- LeftHip.C0 = CFrame.new(-1,-1,0)
- LeftHip.C1 = CFrame.new(-0.5,1,0)
- local RightHip = genWeld(chr.Torso,chr['Right Leg'])
- RightHip.C0 = CFrame.new(1,-1,0)
- RightHip.C1 = CFrame.new(0.5,1,0)
- local RootJoint = genWeld(chr.HumanoidRootPart,chr.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 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
- Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency)
- local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
- for i=1,Times do
- local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = Transparency or 0.4 li.BrickColor = BrickColor.new(Color)
- li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(Thickness,Thickness,magz/Times) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
- local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
- if Times == i then
- local magz2 = (curpos - End).magnitude li.Size = Vector3.new(Thickness,Thickness,magz2)
- li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
- else
- li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
- end
- curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.25)
- end
- end
- local it = Instance.new
- local bc = BrickColor.new
- local c3 = Color3.new
- local cf = CFrame.new
- local ca = CFrame.Angles
- local rad = math.rad
- local cos = math.cos
- local weld = function(p0,p1,x,y,z,ax,ay,az)
- p0.Position=p1.Position
- local w = it("Motor",p0)
- w.Part0=p0
- w.Part1=p1
- w.C0=cf(x,y,z)*ca(ax,ay,az)
- return w
- end
- for i,v in pairs(chr:GetChildren()) do
- if v:IsA("Hat") or v:IsA("ShirtGraphic") or v:IsA("Pants") or v:IsA("Shirt") then
- v:Destroy()
- end
- end
- local shirt = it("Shirt",chr)
- shirt.ShirtTemplate="http://www.roblox.com/asset/?id=72663531"
- local pants = it("Pants",chr)
- pants.PantsTemplate="http://www.roblox.com/asset/?id=72664330"
- if chr.Torso:FindFirstChild("roblox") then
- chr.Torso.roblox:Destroy()
- end
- for i,v in pairs(chr:GetChildren()) do
- if v.Name == "BodyColors" then
- v.HeadColor=BrickColor.new("Pastel brown")
- else
- Instance.new("BodyColors",chr).HeadColor=BrickColor.new("Pastel brown")
- end
- end
- local m = it("Model",chr)
- m.Name="MYSTOGAN"
- local hat = it("Part",m)
- hat.CanCollide=false
- hat.FormFactor="Custom"
- hat.TopSurface='Smooth'
- hat.BottomSurface='Smooth'
- hat.Size=Vector3.new(1.5,1.5,1.5)
- weld(hat,chr.Head,0,-.3,-.25,0,0,0)
- local hatm = it("SpecialMesh",hat)
- hatm.MeshId="http://www.roblox.com/asset/?id=62246019"
- hatm.TextureId="http://www.roblox.com/asset/?id=65303611"
- local bagp1 = it("Part",m)
- bagp1.CanCollide=false
- bagp1.FormFactor='Custom'
- bagp1.TopSurface='Smooth'
- bagp1.BottomSurface='Smooth'
- bagp1.BrickColor=bc("Pastel brown")
- bagp1.Size=Vector3.new(2,2,2)
- local p1m = it("CylinderMesh",bagp1)
- weld(bagp1,chr['Torso'],0,0,-1.5,0,0,0)
- local staff1 = it("Part",m)
- staff1.FormFactor='Custom'
- staff1.TopSurface='Smooth'
- staff1.BottomSurface='Smooth'
- staff1.CanCollide=false
- staff1.Size=Vector3.new(1, 5.6, 1)
- staff1m = it("SpecialMesh",staff1)
- staff1m.MeshId="http://www.roblox.com/asset/?id=11383425"
- staff1m.TextureId="http://www.roblox.com/asset/?id=11383671"
- local staff1w = weld(staff1,bagp1,0,-1.25,0,0,0,0)
- local staff2 = it("Part",m)
- staff2.FormFactor='Custom'
- staff2.TopSurface='Smooth'
- staff2.BottomSurface='Smooth'
- staff2.CanCollide=false
- staff2.Size=Vector3.new(1, 5.6, 1)
- staff2m = it("SpecialMesh",staff2)
- staff2m.MeshId="http://www.roblox.com/asset/?id=11383425"
- staff2m.TextureId="http://www.roblox.com/asset/?id=11383671"
- local staff2w = weld(staff2,bagp1,0,-1.25,0,0,0,0)
- local staff3 = it("Part",m)
- staff3.FormFactor='Custom'
- staff3.TopSurface='Smooth'
- staff3.BottomSurface='Smooth'
- staff3.CanCollide=false
- staff3.Size=Vector3.new(1, 5.6, 1)
- staff3m = it("SpecialMesh",staff3)
- staff3m.MeshId="http://www.roblox.com/asset/?id=11383425"
- staff3m.TextureId="http://www.roblox.com/asset/?id=11383671"
- local staff3w = weld(staff3,bagp1,0,-1.25,0,0,0,0)
- local staff4 = it("Part",m)
- staff4.FormFactor='Custom'
- staff4.TopSurface='Smooth'
- staff4.BottomSurface='Smooth'
- staff4.CanCollide=false
- staff4.Size=Vector3.new(1, 5.6, 1)
- staff4m = it("SpecialMesh",staff4)
- staff4m.MeshId="http://www.roblox.com/asset/?id=11383425"
- staff4m.TextureId="http://www.roblox.com/asset/?id=11383671"
- local staff4w = weld(staff4,bagp1,0,-1.25,0,0,0,0)
- LerpTo = {
- Neck = newLerpTo(Neck);
- LeftArm = newLerpTo(LeftShoulder);
- RightArm = newLerpTo(RightShoulder);
- LeftLeg = newLerpTo(LeftHip);
- RightLeg = newLerpTo(RightHip);
- RootJoint = newLerpTo(RootJoint);
- Staff1 = newLerpTo(staff1w);
- Staff2 = newLerpTo(staff2w);
- Staff3 = newLerpTo(staff3w);
- Staff4 = newLerpTo(staff4w);
- }
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(25),0,rad(25))
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(25),0,-rad(25))
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(25),0,-rad(25))
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(25),0,rad(25))
- local effects = Instance.new("Model",chr)--so we can get rid of effects easily, with for i,v
- local sound = function(id,looped,parent,pitch)--for effects and stuff :)
- local s = Instance.new("Sound",parent)
- s.Volume=math.huge
- s.Looped=looped
- if pitch ~= nil then
- s.Pitch=pitch
- end
- s.SoundId="rbxassetid://"..id
- s:Play()
- return s
- end
- local anim = true
- local equipped = false
- local bin = Instance.new("HopperBin",game.Players.LocalPlayer.Backpack)
- bin.Name="Mystogan"
- bin.Selected:connect(function()
- equipped = true
- sound("195464092",true,chr)
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(90),rad(45),0)*CFrame.new(-5,0,7)*CFrame.Angles(-rad(25),0,0)
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(90),-rad(45),0)*CFrame.new(5,0,7)*CFrame.Angles(-rad(25),0,0)
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(90),rad(45),0)*CFrame.new(5,0,-7)*CFrame.Angles(rad(25),0,0)
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(90),-rad(45),0)*CFrame.new(-5,0,-7)*CFrame.Angles(rad(25),0,0)
- end)
- bin.Deselected:connect(function()
- equipped = false
- for i,v in pairs(chr:GetChildren()) do
- if v:IsA("Sound") then
- v:Stop()
- v:Pause()
- v:Destroy()
- end
- end
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(25),0,rad(25))
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(25),0,-rad(25))
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(25),0,-rad(25))
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(25),0,rad(25))
- end)
- local function updateanims()
- if anim==true and equipped == false then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
- anglespeed = 1
- LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,0)
- LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(sin(angle)*.2,0,0)
- LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(sin(angle)*.2,0,0)
- LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(0),0,rad(0))
- LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(-rad(0),0,-rad(0))
- end
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
- anglespeed = 3
- LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(-rad(25),0,0)
- LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
- 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
- elseif anim==true and equipped == 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(0,0,0)
- LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(5),0,rad(5))
- LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-rad(5),0,-rad(5))
- LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(5),0,rad(5))
- LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(-rad(5),0,-rad(5))
- end
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
- anglespeed = 3
- LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(rad(15),0,0)
- LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(rad(15),0,sin(angle)*.2)
- LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(-rad(25),0,rad(15))
- LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-rad(25),0,-rad(15))
- 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
- mouse.KeyDown:connect(function(key)
- if key == "q" and anim == true and attacking == false and equipped == true then
- attacking = true
- anim = false
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(25),0,rad(25))
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(25),0,-rad(25))
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(25),0,-rad(25))
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(25),0,rad(25))
- LerpTo.Neck.To=LerpTo.Neck.Cache*CFrame.Angles(0,0,rad(45))
- LerpTo.RootJoint.To=LerpTo.RootJoint.Cache*CFrame.Angles(0,-rad(75),0)
- LerpTo.RightArm.To=LerpTo.RightArm.Cache*CFrame.Angles(0,0,rad(90))
- LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(0,0,-rad(90))
- LerpTo.RightLeg.To=LerpTo.RightLeg.Cache*CFrame.Angles(rad(25),0,0)
- LerpTo.LeftLeg.To=LerpTo.LeftLeg.Cache*CFrame.Angles(0,0,0)
- for i = 1,36 do
- game:GetService("RunService").Stepped:wait(.15)
- LerpTo.RootJoint.To=LerpTo.RootJoint.Cache*CFrame.Angles(0,0,-rad(i*10))*CFrame.Angles(0,-rad(75),0)
- end
- wait(.5)
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(90),rad(45),0)*CFrame.new(-5,0,7)*CFrame.Angles(-rad(25),0,0)
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(90),-rad(45),0)*CFrame.new(5,0,7)*CFrame.Angles(-rad(25),0,0)
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(90),rad(45),0)*CFrame.new(5,0,-7)*CFrame.Angles(rad(25),0,0)
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(90),-rad(45),0)*CFrame.new(-5,0,-7)*CFrame.Angles(rad(25),0,0)
- anim = true
- attacking = false
- elseif key == "e" and anim == true and attacking == false and equipped == true then
- coroutine.resume(coroutine.create(function()
- attacking = true
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(0,0,0)*CFrame.new(5,0,7)
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(0,0,0)*CFrame.new(-5,0,7)
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(0,0,0)*CFrame.new(5,0,-7)
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(0,0,0)*CFrame.new(-5,0,-7)
- wait(1)
- for i = 1,10 do
- wait()
- chr.Humanoid.Health=chr.Humanoid.Health+5
- Lightning(staff1.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
- Lightning(staff2.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
- Lightning(staff3.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
- Lightning(staff4.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
- end
- wait(1)
- LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(90),rad(45),0)*CFrame.new(-5,0,7)*CFrame.Angles(-rad(25),0,0)
- LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(90),-rad(45),0)*CFrame.new(5,0,7)*CFrame.Angles(-rad(25),0,0)
- LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(90),rad(45),0)*CFrame.new(5,0,-7)*CFrame.Angles(rad(25),0,0)
- LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(90),-rad(45),0)*CFrame.new(-5,0,-7)*CFrame.Angles(rad(25),0,0)
- attacking = false
- end))
- elseif key == "r" and attacking == false and anim == true and equipped == true then
- attacking = true
- anim = false
- for i,v in pairs(chr:GetChildren()) do
- if v:IsA("Part") then
- coroutine.resume(coroutine.create(function()
- for i = 1,10 do
- wait()
- v.Transparency = v.Transparency + .1
- end
- end))
- end
- end
- for i,v in pairs(m:GetChildren()) do
- if v:IsA("Part") then
- coroutine.resume(coroutine.create(function()
- for i = 1,10 do
- wait()
- v.Transparency=v.Transparency+.1
- end
- end))
- end
- end
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key == "r" then
- attacking = false
- anim = true
- for i,v in pairs(chr:GetChildren()) do
- if v:IsA("Part") then
- coroutine.resume(coroutine.create(function()
- for i = 1,10 do
- wait()
- v.Transparency = v.Transparency - .1
- end
- end))
- end
- end
- for i,v in pairs(m:GetChildren()) do
- if v:IsA("Part") then
- coroutine.resume(coroutine.create(function()
- for i = 1,10 do
- wait()
- v.Transparency=v.Transparency-.1
- end
- end))
- end
- end
- 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)
- sdeb=false
- game:service'RunService'.RenderStepped:connect(function()
- 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