Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- yo this was made by Wulfchow (formerly wulfbug9)
- -- i made this in anywhere from 2014 to 2015
- -- enjoy this incomplete mess haha
- local Character
- CN, CA, V3, BC, C3 = CFrame.new, CFrame.Angles, Vector3.new, BrickColor.new, Color3.new
- Ins, Abs, Sin, Cos, Rad, Pi = Instance.new, math.abs, math.sin, math.cos, math.rad, math.pi
- Random = function(A)
- return ( math.random() - .5) * 2 * (A or 1)
- end
- Part = function(Parent, CFrame, Size, Colour, Material, Transparency, Anchored, CanCollide, Type)
- local P = Ins(Type or "Part")
- P.FormFactor = "Custom"
- P.Size = Size
- P.Anchored = Anchored
- P.Material = Material
- P.BrickColor = BC(Colour)
- P.Transparency = Transparency
- P.CanCollide = CanCollide
- P.TopSurface, P.BottomSurface, P.LeftSurface, P.RightSurface, P.FrontSurface, P.BackSurface = 10, 10, 10, 10, 10, 10
- P.CFrame = CFrame
- P.Parent = Parent
- P.Locked = true
- P:BreakJoints()
- return P
- end
- Weld = function(P0, P1, C0, C1)
- local W = Ins("Motor", P0)
- W.Part0 = P0
- W.Part1 = P1
- W.C0 = C0 or CN()
- W.C1 = C1 or CN()
- local Loop = game:service("RunService").RenderStepped:connect(function()
- W.CurrentAngle = 0
- W.DesiredAngle = 0
- W.MaxVelocity = 0
- end)
- return W
- end
- New = function(Object, Parent, Data)
- local Object = Ins(Object)
- for Index, Value in pairs(Data or {}) do
- Object[Index] = Value
- end
- Object.Parent = Parent
- return Object
- end
- GetComplementingColour = function(Colour3)
- local R, G, B = Colour3.r, Colour3.g, Colour3.b
- local NR, NG, NB = R * 255, G * 255, B * 255
- local R2, G2, B2 = Abs(Random(255)), Abs(Random(255)), Abs(Random(255))
- R2, G2, B2 = (R2 + NR) / 2, (G2 + NG) / 2, (B2 + NB) / 2
- return C3(R2 / 255, G2 / 255, B2 / 255)
- end
- Midpoint = function(CF0, CF1)
- local C0, C1 = {CF0.X, CF0.Y, CF0.Z, CF0:toEulerAnglesXYZ()}, {CF1.X, CF1.Y, CF1.Z, CF1:toEulerAnglesXYZ()}
- for i, v in pairs(C0) do
- C0[i] = (v + C1[i]) / 2
- end
- return CN(C0[1], C0[2], C0[3]) * CA(C0[4], C0[5], C0[6])
- end
- function SLerp(A, B, Alpha)
- return (1-Alpha) * A + (Alpha * B)
- end
- function CSLerp(C0, C1, Alpha)
- local ax, ay, az = C0:toEulerAnglesXYZ()
- local bx, by, bz = C1:toEulerAnglesXYZ()
- return CFrame.new(
- SLerp(C0.X, C1.X, Alpha),
- SLerp(C0.Y, C1.Y, Alpha),
- SLerp(C0.Z, C1.Z, Alpha)
- ) * CFrame.Angles(
- SLerp(ax, bx, Alpha),
- SLerp(ay, by, Alpha),
- SLerp(az, bz, Alpha)
- )
- end
- function GetMass(Model)
- local Mass = 0
- for i, v in pairs(Model:children()) do
- if v:IsA("BasePart") then Mass = Mass + v:GetMass() end
- Mass = Mass + GetMass(v)
- end
- return Mass
- end
- function Raycast(Start, End, Ignore)
- return workspace:FindPartOnRayWithIgnoreList( Ray.new( Start, End.unit * End.magnitude ), Ignore )
- end
- do -- > Triangle Trail.
- local Trailing = false
- local Last = {
- [1] = nil,
- [2] = nil,
- }
- local TConnect
- local function Modify(Data)
- for i, v in pairs(Data) do
- if i ~= 1 then
- Data[1][i] = v
- end
- end
- return Data[1]
- end
- local function CFrameFromTopBack(At, Top, Back)
- local Right = Top:Cross(Back)
- return CFrame.new(At.x, At.y, At.z,
- Right.x, Top.x, Back.x,
- Right.y, Top.y, Back.y,
- Right.z, Top.z, Back.z)
- end
- function Triangle(Parent, A, B, C, Colour)
- local P1 = Modify{Instance.new("WedgePart"), Anchored = true, FormFactor = "Custom", TopSurface = 10, BottomSurface = 10, BrickColor = BrickColor.new(Colour),
- Transparency = .3, CanCollide = false,
- BottomSurface = 10, TopSurface = 10, FrontSurface = 10, BackSurface = 10, LeftSurface = 10, RightSurface = 10}
- local P2 = Modify{Instance.new("WedgePart"), Anchored = true, FormFactor = "Custom", TopSurface = 10, BottomSurface = 10, BrickColor = BrickColor.new(Colour),
- Transparency = .3, CanCollide = false,
- BottomSurface = 10, TopSurface = 10, FrontSurface = 10, BackSurface = 10, LeftSurface = 10, RightSurface = 10}
- Modify{Instance.new("SpecialMesh",P1), MeshType = "Wedge", Scale = Vector3.new(0,1,1)}
- Modify{Instance.new("SpecialMesh",P2), MeshType = "Wedge", Scale = Vector3.new(0,1,1)}
- local AB, BC, CA = B-A, C-B, A-C
- local ABM, BCM, CAM = AB.magnitude, BC.magnitude, CA.magnitude
- local Edge1 = math.abs(0.5 + CA:Dot(AB)/(ABM*ABM))
- local Edge2 = math.abs(0.5 + AB:Dot(BC)/(BCM*BCM))
- local Edge3 = math.abs(0.5 + BC:Dot(CA)/(CAM*CAM))
- if Edge1 < Edge2 then
- if Edge1 < Edge3 then
- else
- A, B, C = C, A, B
- AB, BC, CA = CA, AB, BC
- ABM = CAM
- end
- else
- if Edge2 < Edge3 then
- A, B, C = B, C, A
- AB, BC, CA = BC, CA, AB
- ABM = BCM
- else
- A, B, C = C, A, B
- AB, BC, CA = CA, AB, BC
- ABM = CAM
- end
- end
- local Len1 = -CA:Dot(AB)/ABM
- local Len2 = ABM - Len1
- local Width = (CA + AB.unit*Len1).magnitude
- local MainCF = CFrameFromTopBack(A, AB:Cross(BC).unit, -AB.unit)
- P1.Name = "WulfEffect"
- P1.Parent = Parent
- P1.Size = Vector3.new(0.2, Width, Len1)
- P1.CFrame = MainCF * CFrame.Angles(math.pi, 0, math.pi/2) * CFrame.new(0, Width/2, Len1/2)
- P2.Name = "WulfEffect"
- P2.Parent = Parent
- P2.Size = Vector3.new(0.2, Width, Len2)
- P2.CFrame = MainCF * CFrame.Angles(math.pi, math.pi, -math.pi/2) * CFrame.new(0, Width/2, -Len1 - Len2/2)
- return P1, P2
- end
- function StartTrail(Part, Colour)
- Colour = Colour or "White"
- Trailing = true
- TConnect = game:service("RunService").RenderStepped:connect(function()
- local P0 = Part.CFrame * CFrame.new(0, Part.Size.Y/2, 0)
- local P1 = Part.CFrame * CFrame.new(0, -Part.Size.Y/2, 0)
- if Last[1] and Last[2] then
- local A, B = Triangle(workspace, P0.p, Last[1].p, Last[2].p, Colour)
- local C, D = Triangle(workspace, P0.p, P1.p, Last[2].p, Colour)
- Delay(0, function()
- for i = .4, 1, .1 do
- wait()
- A.Transparency, B.Transparency, C.Transparency, D.Transparency = i, i, i, i
- end
- A:Destroy()
- B:Destroy()
- C:Destroy()
- D:Destroy()
- end)
- end
- Last[1] = P0
- Last[2] = P1
- end)
- end
- function StopTrail()
- TConnect:disconnect()
- Trailing = false
- Last[1] = nil
- Last[2] = nil
- end
- end
- Player = game:service("Players").LocalPlayer
- Mouse = Player:GetMouse()
- Util = assert(LoadLibrary("RbxUtility"))
- Backpack = Player:WaitForChild("Backpack")
- Character = Player.Character
- Torso = Character:WaitForChild("Torso")
- HRP = Character:WaitForChild("HumanoidRootPart")
- RA = Character:WaitForChild("Right Arm")
- LA = Character:WaitForChild("Left Arm")
- RL = Character:WaitForChild("Right Leg")
- LL = Character:WaitForChild("Left Leg")
- Head = Character:WaitForChild("Head")
- ORS = Torso:WaitForChild("Right Shoulder")
- OLS = Torso:WaitForChild("Left Shoulder")
- ORH = Torso:WaitForChild("Right Hip")
- OLH = Torso:WaitForChild("Left Hip")
- Humanoid = Character:WaitForChild("Humanoid")
- Asset = "rbxassetid://"
- Meshes = {Cone = "1033714", Ring = "3270017", Blast = "20329976", Diamond = "9756362", Spike = "1033714", Skull = "4770583"}
- C0 = {
- LS = CN(-1, 0.5, 0),
- RS = CN(1, 0.5, 0),
- LH = CN(-1, -1, 0),
- RH = CN(1, -1, 0),
- NK = CN(0, 1, 0),
- TW = CN(0, 0, 0),
- HW = CA(-Pi/2, 0, 0) * CN(-.25, 0, -1) * CA(0, -Pi/2, 0),
- }
- C1 = {
- LS = CN(0.5, 0.5, 0),
- RS = CN(-0.5, 0.5, 0),
- LH = CN(-.5, 1, 0),
- RH = CN(.5, 1, 0),
- NK = CN(0, -.5, 0),
- TW = CN(0, 0, 0),
- }
- OC0 = {
- RS = CN(1, .5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
- LS = CN(-1, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- RH = CN(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
- LH = CN(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- NK = CN(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
- TW = CN(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, -0)
- }
- OC1 = {
- RS = CN(.5, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- LS = CN(-.5, .5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
- RH = CN(-.5, .5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
- LH = CN(.5, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- NK = CN(0, -.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- TW = CN(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- }
- Desired = {
- LS = C0.LS,
- RS = C0.RS,
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK,
- TW = C0.TW,
- HW = C0.HW,
- }
- Speed = .2
- Attacking = false
- LH, RH = nil, nil
- Down = false
- Falling = false
- Twist = false
- MagicMode = false
- Keysdown = { }
- AllowSprint = true
- Magic_Event = nil
- pcall(game.Destroy, Character:FindFirstChild("Weapon"))
- Model = New("Model", Character, { Name = "Weapon" })
- Handle = Part(Model, CN(), V3(.3, 1, .3), "Grey", "SmoothPlastic", 0, false, false)
- New("CylinderMesh", Handle)
- HandleW = Weld(Torso, Handle, CN(1.5, 1.5, .5) * CA(0, 0, Pi) * CA(0, 0, -Pi/4))
- P1 = Part(Model, CN(), V3(.4, .3, .4), "Black", "SmoothPlastic", 0, false, false)
- New("SpecialMesh", P1)
- Weld(Handle, P1, CN(0, -.625, 0))
- for i = 0, 1, .125 do
- local P = Part(Model, CN(), V3(.3, 0, .3), "White", "SmoothPlastic", 0, false, false)
- New("CylinderMesh", P, { Scale = V3(1.1, .5, 1.1) })
- Weld(Handle, P, CN(0, -.5 + i, 0) * CA(Random(.1), Random(Pi*2), 0))
- end
- Div = Part(Model, CN(), V3(.5, .3, .5), "Black", "SmoothPlastic", 0, false, false)
- New("SpecialMesh", Div)
- Weld(Handle, Div, CN(0, .625, 0))
- P2 = Part(Model, CN(), V3(.4, .5, .4), "Black", "SmoothPlastic", 0, false, false)
- New("FileMesh", P2, { MeshId = Asset .. Meshes.Skull })
- Weld(Div, P2, CN(0, .15, 0) * CA(0, Pi/2, 0))
- P3 = Part(Model, CN(), V3(.6, 0, .6), "Black", "SmoothPlastic", 0, false, false)
- New("FileMesh", P3, { MeshId = Asset .. Meshes.Ring, Scale = V3(.5, .5, .5) })
- Weld(Div, P3, CN(0, -.075, 0) * CA(Pi/2, 0, 0))
- for i = 1, 8 do
- P4 = Part(Model, CN(), V3(0, .5, 0), "Black", "SmoothPlastic", 0, false, false)
- New("FileMesh", P4, { MeshId = Asset .. Meshes.Spike, Scale = V3(.05, .5, .05) })
- Weld(P3, P4, CA(Pi/2, Pi*2/8*i, 0) * CN(0, 0, -.45) * CA(-Pi/2, 0, 0))
- end
- Blade = Part(Model, CN(), V3(.3, 3.5, 0), "Dark stone grey", "SmoothPlastic", 0, false, false)
- New("BlockMesh", Blade, { Scale = V3(1, 1, .25) })
- Weld(Div, Blade, CN(0, 1.75, 0))
- Tip = Part(Model, CN(), V3(0, .5, .3), "Dark stone grey", "SmoothPlastic", 0, false, false, "WedgePart")
- New("SpecialMesh", Tip, { MeshType = "Wedge", Scale = V3(.25, 1, 1) })
- Weld(Blade, Tip, CN(0, 2, 0) * CA(0, Pi/2, 0))
- Blade2 = Part(Model, CN(), V3(.45, 3.75, 0), "Really black", "SmoothPlastic", 0.4, false, false)
- New("BlockMesh", Blade2, { Scale = V3(1, 1, 0) })
- Weld(Div, Blade2, CN(0, 1.75, 0))
- Tip2 = Part(Model, CN(), V3(0, .75, .45), "Really black", "SmoothPlastic", 0.4, false, false, "WedgePart")
- New("SpecialMesh", Tip2, { MeshType = "Wedge", Scale = V3(0, 1, 1) })
- Weld(Blade2, Tip2, CN(0, 3.75/2 + .375, 0) * CA(0, Pi/2, 0))
- BladeCover = Part(Model, CN(), V3(.3, 3.75, 0), "Dark stone grey", "SmoothPlastic", 1, false, false)
- Weld(Blade, BladeCover, CN(0, .375, 0))
- function ThrowSpike(CF, Direction, Size, Colour, Speed)
- local Speed = Speed or 1
- local Part = Part(workspace, CF, V3(Size / 2, Size * 2, Size / 2), Colour, "SmoothPlastic", 0.4, false, false)
- Part.Name = "WulfEffect"
- local Mesh = New("FileMesh", Part, { MeshId = Asset .. Meshes.Spike, Scale = V3(Size / 2, Size * 2, Size / 2) })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- local BV = New("BodyVelocity", Part, { velocity = Direction * 5, maxForce = V3(1, 1, 1) * 10 ^ 6, P = 10 ^ 4 })
- local BG = New("BodyGyro", Part, { cframe = CN(CF.p, Direction) * CA(-Pi/2, 0, 0), maxTorque = V3(1, 1, 1) * 10 ^ 6, P = 10 ^ 4 })
- Spawn(function()
- for i = .4, 1.05, .0125 do
- Part.Transparency = i
- wait()
- end
- Part:Destroy()
- end)
- end
- function CrownExplode(CF, Size, Colour, Scale)
- local Scale = Scale or 1
- local Part = Part(workspace, CF, V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("FileMesh", Part, { MeshId = Asset .. Meshes.Blast, Scale = V3(Size, Size, Size) })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + V3(Scale, Scale, Scale)
- wait()
- end
- Part:Destroy()
- end)
- end
- function BrickExplode(CF, Size, Colour, Scale)
- local Scale = Scale or 1
- local Part = Part(workspace, CF * CA(Random(Pi * 2), Random(Pi * 2), Random(Pi * 2)), V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("BlockMesh", Part, { Scale = V3(1, 1, 1) })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + V3(Scale, Scale, Scale)
- wait()
- end
- Part:Destroy()
- end)
- end
- function BrickImplode(CF, Size, Colour, Scale)
- local Scale = Scale or 1
- local Part = Part(workspace, CF * CA(Random(Pi * 2), Random(Pi * 2), Random(Pi * 2)), V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("BlockMesh", Part, { Scale = V3(1, 1, 1) })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- if Mesh.Scale.X > 0 and Mesh.Scale.Y > 0 and Mesh.Scale.Z > 0 then
- Mesh.Scale = Mesh.Scale - V3(Scale, Scale, Scale)
- end
- wait()
- end
- Part:Destroy()
- end)
- end
- function CrownSpin(CF, Size, Colour)
- local Part = Part(workspace, CF, V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("FileMesh", Part, { MeshId = Asset .. Meshes.Blast, Scale = V3(Size, Size, Size) })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- local Rot = 0
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Part.CFrame = CF * CA(0, Rad(Rot), 0)
- wait()
- Rot = Rot + 2
- end
- Part:Destroy()
- end)
- end
- function CrownSpinAndExplode(CF, Size, Colour, Scale)
- local Scale = Scale or 1
- local Part = Part(workspace, CF, V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("FileMesh", Part, { MeshId = Asset .. Meshes.Blast, Scale = V3(Size, Size, Size) })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- local Rot = 0
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Part.CFrame = CF * CA(0, Rad(Rot), 0)
- Mesh.Scale = Mesh.Scale + V3(Scale, Scale, Scale)
- wait()
- Rot = Rot + 2
- end
- Part:Destroy()
- end)
- end
- function BrickTo(CF, To, Size, Colour, Scale)
- local Scale = Scale or .125
- local Part = Part(workspace, CF, V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- local Mesh = New("SpecialMesh", Part, { MeshType = "Brick" })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + V3(Scale, Scale, Scale)
- Part.CFrame = (CF + (Part.Position - To.p) * .9) * CA(i, -i, i)
- wait()
- end
- Part:Destroy()
- end)
- end
- function SphereExplode(CF, Size, Colour, Scale)
- local Scale = Scale or .5
- local Part = Part(workspace, CF, V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("SpecialMesh", Part, { MeshType = "Sphere" })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + V3(Scale, Scale, Scale)
- wait()
- end
- Part:Destroy()
- end)
- end
- function DiamondExplode(CF, Size, Colour, Scale)
- local Scale = Scale or .5
- local Part = Part(workspace, CF * CA(Random(Pi*2), Random(Pi*2), Random(Pi*2)), V3(Size, Size, Size), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("FileMesh", Part, { MeshId = Asset .. Meshes.Diamond })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + V3(Scale, Scale, Scale)
- wait()
- end
- Part:Destroy()
- end)
- end
- function Glitter(CF, Colour, RelSize)
- local RelSize = RelSize or .75
- local SizeX, SizeY, SizeZ = Abs(Random(RelSize)), Abs(Random(RelSize)), Abs(Random(RelSize))
- local Part = Part(workspace, CN(CF.X, CF.Y, CF.Z), V3(SizeX, SizeY, SizeZ), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("BlockMesh", Part)
- New("PointLight", Part, { Color = BC(Colour).Color, Range = ( (SizeX + SizeY + SizeZ) / 3 ) * 2 })
- Spawn(function()
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + V3(.125, .125, .125)
- wait()
- end
- Part:Destroy()
- end)
- end
- function SpikeUp(CF, Size, Colour)
- local Part = Part(workspace, CF * CN(0, -(Size * 2) / 2, 0), V3(Size / 2, Size * 4, Size / 2), Colour, "SmoothPlastic", 0.4, true, false)
- Part.Name = "WulfEffect"
- local Mesh = New("FileMesh", Part, { MeshId = Asset .. Meshes.Spike, Scale = Part.Size / 2 })
- New("PointLight", Part, { Color = BC(Colour).Color, Range = Size * 2 })
- Spawn(function()
- for i = 1, Size - 1, 1 do
- Part.CFrame = CF * CN(0, i, 0)
- wait()
- end
- wait(math.random(5, 8))
- for i = .4, 1.05, .05 do
- Part.Transparency = i
- wait()
- end
- Part:Destroy()
- end)
- end
- function CreateCrater(UseRay, Start, SearchIn, Size, Radius, Number, Wait)
- local CF = Start
- local Ray, Position = Raycast(Start.p, SearchIn.p, { })
- if Ray then
- if UseRay then
- local OBJ = Ray.CFrame:pointToObjectSpace(Position)
- local SZ = Ray.Size / 2
- local SVEC = OBJ / SZ
- SVEC = V3(Floor(Abs(SVEC.X)+.01)*SVEC.X/Abs(SVEC.X),
- Floor(Abs(SVEC.Y)+.01)*SVEC.Y/Abs(SVEC.Y),
- Floor(Abs(SVEC.Z)+.01)*SVEC.Z/Abs(SVEC.Z)
- )
- if SVEC.magnitude ~= 1 then return end
- local Direction = Ray.CFrame:vectorToWorldSpace(SVEC)
- CF = CN(Position, Position - Direction)
- end
- local T = { }
- local Wait = Wait or 10
- local Size, Radius = Size or 5, Radius or 7.5
- local Number = Number or 10
- for i = 1, Number do
- local P = Part(workspace, CF * CA(0, Pi*2/Number*i, 0) * CN(0, 0, -Radius) * CA(Random(Pi/2), Random(Pi), 0), V3(math.random(Size, Size), math.random(Size/2, Size), Size), tostring(Ray.BrickColor), Ray.Material, 0, true, true)
- table.insert(T, P)
- end
- Spawn(function()
- wait(Wait)
- repeat wait()
- local Num = math.random(1, #T)
- local P = T[Num]
- table.remove(T, Num)
- P.Anchored = false
- P.CanCollide = false
- until #T == 0
- end)
- end
- end
- function Lightning(Start, Stop, Colour, Parts, Diff)
- local T = { }
- local Diff = Diff or 1
- local Parts = Parts or 10
- local Size = (Start.p - Stop.p).magnitude
- local LV = CN(Start.p, Stop.p).lookVector
- local DB = Size / Parts
- local lastPos = Start.p
- for i = 1, Parts do
- local X = Random(Diff) / Diff * DB / 2
- local Y = Random(Diff) / Diff * DB / 2
- local Pos = CN(Start.p + LV * (i * DB), Stop.p + LV) * CN(X, Y, 0)
- local Mid = (Pos.p + lastPos) / 2
- local Dist = (Pos.p - lastPos).magnitude
- local P = Part(workspace, CN(Mid, Pos.p), V3(0, 0, Dist), Colour, "SmoothPlastic", 0.4, true, false)
- lastPos = Pos.p
- table.insert(T, P)
- end
- local Fade = function(Part)
- for i = Part.Transparency, 1.1, .1 do
- wait()
- Part.Transparency = i
- end
- Part:Destroy()
- end
- Spawn(function()
- wait(.25)
- for i, v in pairs(T) do
- Spawn(function() Fade(v) end)
- end
- end)
- end
- function Beam(Start, End, Size, Colour, InsideColour, Scale)
- local Scale = Scale or .05
- local Magnitude = (End.p - Start.p).magnitude
- local P0 = Part(workspace, CN(Start.p, End.p) * CN(0, 0, -Magnitude / 2) * CA(Pi/2, 0, 0), V3(Size / 2, Magnitude, Size / 2), InsideColour or "Phosph. White", "SmoothPlastic", 0.4, true, false)
- local P1 = Part(workspace, CN(Start.p, End.p) * CN(0, 0, -Magnitude / 2) * CA(Pi/2, 0, 0), V3(Size, Magnitude, Size), Colour, "SmoothPlastic", 0.4, true, false)
- local M0 = New("CylinderMesh", P0)
- local M1 = New("CylinderMesh", P1)
- Spawn(function()
- wait()
- for i = .4, 1.05, .05 do
- wait()
- P0.Transparency = i
- P1.Transparency = i
- M0.Scale = M0.Scale + V3(Scale, 0, Scale)
- M1.Scale = M1.Scale + V3(Scale, 0, Scale)
- end
- P0:Destroy()
- P1:Destroy()
- end)
- end
- function DamageNearby(CF, Damage, Distance)
- local Humanoids = { }
- for i, v in pairs(workspace:children()) do
- if v:IsA("Model") and v~=Character and v:FindFirstChild("Torso") and v:FindFirstChild("Humanoid") and
- (v:FindFirstChild("Torso").CFrame.p - CF.p).magnitude < Distance then
- table.insert(Humanoids, v:FindFirstChild("Humanoid"))
- end
- end
- for i, v in pairs(Humanoids) do
- v.Health = v.Health - Damage
- end
- end
- function DamageByBladeWhileAttacking(Damage)
- Spawn(function()
- while Attacking and wait() do
- DamageNearby(Blade.CFrame, Damage, 4)
- end
- end)
- end
- function CreateIgnoreList()
- local Ignore = { }
- for i, v in pairs(workspace:children()) do
- if v.Name == "WulfEffect" then
- table.insert(Ignore, v)
- end
- end
- for i, v in pairs(Character:children()) do
- if v:IsA("Part") then
- table.insert(Ignore, v)
- end
- end
- return Ignore
- end
- function WaitBySpeed()
- return wait(((1/60)*Speed)*15)
- end
- function SetDesired(Table)
- Desired.RS = Table.RS
- Desired.LS = Table.LS
- Desired.NK = Table.NK
- Desired.TW = Table.TW
- Desired.HW = Table.HW
- if Table.LH and Table.RH then
- Desired.RH = Table.RH
- Desired.LH = Table.LH
- end
- end
- function GiveLegWelds()
- OLH.Parent = nil
- ORH.Parent = nil
- LH = Weld(Torso, LL, C0.LH, C1.LH)
- RH = Weld(Torso, RL, C0.RH, C1.RH)
- end
- function RemoveLegWelds()
- LH:Destroy()
- LH = nil
- RH:Destroy()
- RH = nil
- OLH.Parent = Torso
- OLH.Part0 = Torso
- OLH.Part1 = LL
- ORH.Parent = Torso
- ORH.Part0 = Torso
- ORH.Part1 = RL
- end
- function SetNormal()
- Speed = .2
- SetDesired({
- LS = C0.LS * CN(.5, 0 , 0) * CA(Pi/3, 0, Pi/6),
- RS = C0.RS * CN(-.5, 0 , 0) * CA(Pi/3, 0, -Pi/12),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/8, 0),
- TW = C0.TW * CA(0, -Pi/8, 0),
- HW = C0.HW,
- })
- end
- function Slash1()
- Attacking = true
- DamageByBladeWhileAttacking(8)
- Speed = .5
- SetDesired({
- LS = C0.LS * CN(.625, 0 , 0) * CA(Pi/1.375, 0, Pi/4),
- RS = C0.RS * CN(-.125, 0 , 0) * CA(Pi/1.375, 0, Pi/10),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/3, 0),
- TW = C0.TW * CA(0, -Pi/3, 0),
- HW = C0.HW * CA(0, 0, Pi/3),
- })
- Delay(.075, function() StartTrail(BladeCover, "Really black") end)
- WaitBySpeed()
- SetDesired({
- LS = C0.LS * CN(.25, 0 , 0) * CA(Pi/4, 0, -Pi/10),
- RS = C0.RS * CN(-.25, 0 , 0) * CA(Pi/4, 0, -Pi/3),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/10, 0),
- TW = C0.TW * CA(0, -Pi/10, 0),
- HW = C0.HW * CA(0, 0, Pi/2.125),
- })
- Delay(.075, function() StopTrail() end)
- WaitBySpeed()
- SetNormal()
- wait(.125)
- Attacking = false
- end
- function Slash2()
- Attacking = true
- DamageByBladeWhileAttacking(8)
- Speed = .5
- SetDesired({
- LS = C0.LS * CN(.625, 0 , 0) * CA(Pi/8, 0, -Pi/10),
- RS = C0.RS * CN(-.125, 0 , 0) * CA(Pi/8, 0, -Pi/4),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/10, 0),
- TW = C0.TW * CA(0, -Pi/10, 0),
- HW = C0.HW * CA(0, 0, Pi/3),
- })
- Delay(.075, function() StartTrail(BladeCover, "Really black") end)
- WaitBySpeed()
- SetDesired({
- LS = C0.LS * CN(.25, 0 , 0) * CA(Pi/1.375, 0, Pi/3),
- RS = C0.RS * CN(-.25, 0 , 0) * CA(Pi/1.375, 0, Pi/10),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/3, 0),
- TW = C0.TW * CA(0, -Pi/3, 0),
- HW = C0.HW * CA(0, 0, -Pi/3),
- })
- Delay(.075, function() StopTrail() end)
- WaitBySpeed()
- SetNormal()
- wait(.125)
- Attacking = false
- end
- function Slash3()
- Attacking = true
- DamageByBladeWhileAttacking(8)
- Speed = .5
- SetDesired({
- LS = C0.LS * CN(.625, 0 , 0) * CA(Pi/2, 0, Pi/6),
- RS = C0.RS * CN(-.5, 0 , 0) * CA(Pi/2, 0, Pi/3),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/10, 0),
- TW = C0.TW * CA(0, -Pi/10, 0),
- HW = C0.HW * CA(0, 0, Pi/2),
- })
- Delay(.075, function() StartTrail(BladeCover, "Really black") end)
- WaitBySpeed()
- SetDesired({
- LS = C0.LS * CN(.25, 0 , 0) * CA(Pi/2.5, 0, -Pi/3),
- RS = C0.RS * CN(-.25, 0 , 0) * CA(Pi/2.5, 0, Pi/20),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, -Pi/3, 0),
- TW = C0.TW * CA(0, Pi/3, 0),
- HW = C0.HW * CA(0, 0, Pi/2),
- })
- Delay(.075, function() StopTrail() end)
- WaitBySpeed()
- SetNormal()
- wait(.125)
- Attacking = false
- end
- function Jump()
- AllowSprint = false
- Attacking = true
- GiveLegWelds()
- SetDesired({
- LS = C0.LS * CA(Pi/7, 0, Pi/10),
- RS = C0.RS * CA(Pi/3, 0, -Pi/3),
- LH = C0.LH * CN(0, .625, -.25) * CA(-Pi/6, 0, 0),
- RH = C0.RH * CN(0, .625, -.25) * CA(-Pi/20, 0, 0),
- NK = C0.NK * CA(-Pi/25, 0, 0),
- TW = C0.TW * CN(0, -1.25, 0) * CA(-Pi/20, 0, 0),
- HW = C0.HW * CA(0, 0, -Pi/3),
- })
- wait(.25)
- Speed = .4
- SetDesired({
- LS = C0.LS * CA(0, 0, -Pi/10),
- RS = C0.RS * CA(Pi/3, 0, -Pi/3),
- LH = C0.LH * CN(0, .25, -.25) * CA(-Pi/20, 0, 0),
- RH = C0.RH * CN(0, .75, -.25) * CA(-Pi/4, 0, 0),
- NK = C0.NK,
- TW = C0.TW * CN(0, 0, 0) * CA(-Pi/40, 0, 0),
- HW = C0.HW,
- })
- local BV = New("BodyVelocity", HRP, { maxForce = V3(0, 1, 0) * 10^6, P = 10^4 })
- BV.velocity = V3(0, GetMass(Character)*4, 0)
- wait()
- BV:Destroy()
- Falling = true
- repeat wait()
- local Hit, Pos = Raycast(Torso.Position, Vector3.new(0, -4, 0), CreateIgnoreList())
- until Hit
- Falling = false
- local CF = CFrame.new(HRP.Position.X, HRP.Position.Y, HRP.Position.Z)
- SphereExplode(CF, 3.5, "Really black")
- CrownExplode(CF * CN(0, -1, 0), math.random(1, 4), "Really black")
- Spawn(function()
- for i = 1, 5 do
- wait()
- BrickExplode(CF, 3, i % 2 == 0 and "Really black" or "White", .25)
- BrickTo(CF * CN(0, -1, 0) * CA(Random(Pi*2), Random(Pi*2), Random(Pi*2)), CF * CN(Random(10), -math.random(1, 10), Random(10)), math.random(2, 5), i % 2 and "Really black" or "White")
- end
- end)
- RemoveLegWelds()
- SetNormal()
- Attacking = false
- AllowSprint = true
- end
- function Spin()
- Twist = true
- local BG = New("BodyGyro", HRP, { maxTorque = V3(1, 1, 1) * 10^6, P = 10^4.25 })
- local Rotate = 0
- StartTrail(BladeCover, "Really black")
- SetDesired({
- LS = C0.LS * CA(Pi/2, 0, Pi/5),
- RS = C0.RS * CA(Pi/2, 0, -Pi/5),
- LH = C0.LH * CA(0, 0, -Pi/20),
- RH = C0.RH * CA(0, 0, Pi/20),
- NK = C0.NK,
- TW = C0.TW * CA(0, 0, -Pi/20),
- HW = C0.HW * CA(-Pi/2, 0, 0),
- })
- repeat wait()
- Rotate = Rotate + 40
- BG.cframe = CA(0, Rad(Rotate), 0)
- DamageNearby(Blade.CFrame, 10, 4)
- --ThrowSpike(HRP.CFrame, (CA(0, Rad(Rotate), 0) * HRP.CFrame).p, 4, "Really black")
- until not Falling
- StopTrail()
- BG:Destroy()
- Twist = false
- end
- function ClipForward()
- Attacking = true
- local CF = HRP.CFrame
- local NextPos = CF + (CF.lookVector*50)
- BrickImplode(CF, 5, "Really black", .175)
- Character:MoveTo(NextPos.p)
- local NewCF = HRP.CFrame
- BrickExplode(NewCF, 1, "Really black", .375)
- local Mag = (NewCF.p - CF.p).magnitude
- Beam(CF, NewCF, 2, "Really black", "White", .25)
- for i = 1, 1 do Lightning(CF, NewCF, "Really black", Mag/2, 25) end
- Attacking = false
- end
- function Activate_Magic()
- MagicMode = true
- Magic_Event = Util.CreateSignal()
- local Connection, Count = nil, 0
- SetDesired({
- LS = C0.LS * CN(0, 0 , 0) * CA(Pi/3, 0, -Pi/6),
- RS = C0.RS * CN(-.25, 0 , 0) * CA(Pi/4, 0, -Pi/24),
- LH = C0.LH,
- RH = C0.RH,
- NK = C0.NK * CA(0, Pi/8, 0),
- TW = C0.TW * CA(0, -Pi/8, 0),
- HW = C0.HW * CN(0, .4, 0) * CA(0, 0, -Pi/3),
- })
- Connection = game:service("RunService").RenderStepped:connect(function()
- Count = Count + 1
- if Count % 5 == 0 then
- BrickImplode(LA.CFrame * CN(0, -1, 0), 1.25, "Really black", 0.03)
- end
- end)
- Magic_Event:connect(function(Request, ...)
- local Data = { ... }
- -- attak activation and handling event hurr
- if Request == "release" then
- Connection:disconnect()
- MagicMode = false
- SetNormal()
- Magic_Event:disconnect()
- end
- end)
- end
- TW = HRP:WaitForChild("RootJoint")
- TW.C0 = CN()
- TW.C1 = CN()
- NK = Weld(Torso, Head, C0.NK, C1.NK)
- Connect = nil
- LastSlash = { tick(), Slash1 }
- Sprinting = false
- Equip = function(Mouse)
- if not Attacking and not MagicMode then
- SetNormal()
- HandleW.Part0 = RA
- OLS.Parent = nil
- ORS.Parent = nil
- TW.C0 = CN()
- TW.C1 = CN()
- NK.C0 = C0.NK
- RS = Weld(Torso, RA, C0.RS, C1.RS)
- LS = Weld(Torso, LA, C0.LS, C1.LS)
- end
- Mouse.Button1Down:connect(function()
- if Attacking then return end
- Down = true
- if not MagicMode then
- if (tick()-LastSlash[1]) < .25 then
- LastSlash[2] = LastSlash[2] == Slash1 and Slash2
- or LastSlash[2] == Slash2 and Slash3
- or Slash1
- else
- LastSlash[2] = Slash1
- end
- LastSlash[2]()
- LastSlash[1] = tick()
- else
- end
- end)
- Mouse.Button1Up:connect(function()
- Down = false
- end)
- Mouse.KeyDown:connect(function(Key)
- Key:lower()
- Keysdown[Key] = true
- Keysdown[Key:byte()] = true
- if Key == "x" and Falling and not Twist and not MagicMode then
- Spin()
- end
- if Attacking then return end
- if Key == "z" and not MagicMode then
- Jump()
- elseif Key == "m" then
- if MagicMode and Magic_Event then
- Magic_Event:fire("release")
- else
- Activate_Magic()
- end
- elseif Key == "q" then
- ClipForward()
- end
- end)
- Mouse.KeyUp:connect(function(Key)
- Key:lower()
- Keysdown[Key] = false
- Keysdown[Key:byte()] = false
- if Attacking then return end
- end)
- Connect = game:service("RunService").RenderStepped:connect(function()
- local Is_Sprinting = Keysdown[48] and AllowSprint
- Humanoid.WalkSpeed = Is_Sprinting and 50 or 18
- local Moving = V3(HRP.Velocity.X, 0, HRP.Velocity.Z).magnitude > 2
- RS.C0 = CSLerp(RS.C0, Desired.RS, Speed)
- LS.C0 = CSLerp(LS.C0, Desired.LS, Speed)
- NK.C0 = CSLerp(NK.C0, Desired.NK * CA(Moving and Is_Sprinting and Pi/20 or 0, 0, 0), Speed)
- TW.C0 = CSLerp(TW.C0, Desired.TW * CA(Moving and Is_Sprinting and -Pi/20 or 0, 0, 0), Speed)
- HandleW.C0 = CSLerp(HandleW.C0, Desired.HW, Speed)
- if LH and RH then
- RH.C0 = CSLerp(RH.C0, Desired.RH, Speed)
- LH.C0 = CSLerp(LH.C0, Desired.LH, Speed)
- end
- end)
- end
- Unequip = function()
- Down = false
- if Attacking or MagicMode then
- repeat wait() until not Attacking and not MagicMode
- end
- Connect:disconnect()
- RS:Destroy()
- LS:Destroy()
- OLS.Parent = Torso
- OLS.Part0, OLS.Part1 = Torso, LA
- ORS.Parent = Torso
- ORS.Part0, ORS.Part1 = Torso, RA
- TW.C0 = C0.TW
- NK.C0 = C0.NK
- HandleW.Part0 = Torso
- HandleW.C0 = CN(1.5, 1.5, .5) * CA(0, 0, Pi) * CA(0, 0, -Pi/4)
- Humanoid.WalkSpeed = 16
- end
- pcall(game.Destroy, Backpack:FindFirstChild("Weapon"))
- Tool = New("HopperBin", Backpack, { Name = "Weapon" })
- Tool.Selected:connect(Equip)
- Tool.Deselected:connect(Unequip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement