Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- > CREATED BY WULFBUG9 2014
- -- > Seriously, I made this. (wulfbug9)
- -- > I'm releasing a ton of my other scripts on this pastebin, too. So go check them out.
- -- > THIS SCRIPT WAS NEVER FINISHED SO IT'S A FAIL :(
- function rand(a)return (math.random()-.5)*2*a end
- function q(f,arg)return coroutine.resume(coroutine.create(f),unpack(arg or {}))end
- function fade(p,s)q(function(part,start)for i=s,1,.05 do part.Transparency = part.Transparency+0.05 wait(1/30)end end,{p,s})end
- function appear(p)q(function(part)for i=1,0,-.05 do part.Transparency = part.Transparency-0.05 wait(1/30)end end,{p})end
- function Part(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
- local p = Instance.new("Part",Parent)p.Name = Name
- p.FormFactor = "Custom"p.Size = Size
- p.Anchored = Anch p.CFrame = CFrame
- p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
- p.TopSurface = 0 p.CanCollide = Can
- p.BottomSurface = 0 p.Material = Mat
- p.Reflectance = Ref or 0;p:BreakJoints()
- p.Locked = true;return p
- end
- function WedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
- local p = Instance.new("WedgePart",Parent)p.Name = Name
- p.FormFactor = "Custom"p.Size = Size
- p.Anchored = Anch p.CFrame = CFrame
- p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
- p.TopSurface = 0 p.CanCollide = Can
- p.BottomSurface = 0 p.Material = Mat
- p.Reflectance = Ref or 0;p:BreakJoints()
- p.Locked = true;return p
- end
- function Mesh(Parent,Type,Scale,ID,TID)
- local m = Instance.new("SpecialMesh",Parent)m.MeshType = Type
- m.Scale = Scale or Vector3.new(1,1,1)
- if ID then m.MeshId = ID end if TID then m.TextureId = TID end
- return m
- end
- function Weld(p1,p2,c0,c1)
- local w = Instance.new("Weld",p1)w.Part0 = p1;w.Part1 = p2
- w.C0,w.C1 = c0 or CFrame.new(),c1 or CFrame.new()
- return w
- end
- function lerp(a,b,c)
- return a+(b-a)*c
- end
- do
- local function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5/s
- return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
- else
- local i = 0
- if m11 > m00 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00-m11-m22+1)
- local recip = 0.5/s
- return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
- elseif i == 1 then
- local s = math.sqrt(m11-m22-m00+1)
- local recip = 0.5/s
- return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
- elseif i == 2 then
- local s = math.sqrt(m22-m00-m11+1)
- local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
- end
- end
- end
- local function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w*xs, w*ys, w*zs
- local xx = x*xs
- local xy = x*ys
- local xz = x*zs
- local yy = y*ys
- local yz = y*zs
- local zz = z*zs
- return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
- end
- local function QuaternionSlerp(a, b, t)
- local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = math.acos(cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((1-t)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = 1-t
- finishInterp = t
- end
- else
- if (1+cosTheta) > 0.0001 then
- local theta = math.acos(-cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((t-1)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = t-1
- finishInterp = t
- end
- end
- return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
- end
- function clerp(a,b,t)
- local qa = {QuaternionFromCFrame(a)}
- local qb = {QuaternionFromCFrame(b)}
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1-t
- return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
- end
- end
- ---------------------------------------------
- player = game:service("Players").LocalPlayer
- local char
- repeat wait() char = player.Character until char
- root = char:WaitForChild("HumanoidRootPart")
- torso = char:WaitForChild("Torso")
- humanoid = char:WaitForChild("Humanoid")
- rarm = char:WaitForChild("Right Arm")
- mouse = player:GetMouse()
- step = game:service("RunService").Stepped
- Mode = ""
- LastMode = ""
- asset = "http://www.roblox.com/asset/?id="
- meshes = {["blast"] = 20329976,["ring"] = 3270017,["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["cloud"] = 1095708,["diamond"] = 9756362}
- sounds = {["gun"] = 131070686;}
- mcolor = "Lime green"--"Deep orange"--"Dark Royal blue"--"Toothpaste"--"Institutional white"--"Tr. Yellow"--"Magenta"--
- Trailing = Instance.new("BoolValue",script)
- c0 = {
- ls = CFrame.new(-1,0.5,0),
- rs = CFrame.new(1,0.5,0),
- lh = CFrame.new(-1,-1,0),
- rh = CFrame.new(1,-1,0),
- nk = CFrame.new(0,1,0),
- tw = CFrame.new(0,0,0),
- }
- c1 = {
- ls = CFrame.new(0.5,0.5,0),
- rs = CFrame.new(-0.5,0.5,0),
- lh = CFrame.new(-.5,1,0),
- rh = CFrame.new(.5,1,0),
- nk = CFrame.new(0,-.5,0),
- tw = CFrame.new(0,0,0),
- }
- rs = Weld(torso,char:WaitForChild("Right Arm"),c0.rs,c1.rs)
- ls = Weld(torso,char:WaitForChild("Left Arm"),c0.ls,c1.ls)
- local lastPos
- lastSwing = tick()
- local top;
- ---------------------------------------------
- function Trail(par)
- lastPos = par.CFrame.p
- q(function()
- while Trailing.Value do
- wait(1/30)
- local obj = par:Clone()
- obj.Transparency = 0
- obj.Parent = workspace
- obj.Anchored = true
- obj.CanCollide = false
- distance = (lastPos-par.CFrame.p).magnitude
- obj.Size = Vector3.new(0,0,distance)
- obj.CFrame = CFrame.new(lastPos,par.Position)*CFrame.new(0,0,-distance/2)
- lastPos = par.CFrame.p
- q(function(p)wait(0.5)fade(p,0)for i=0,1,0.1 do wait(1/30)if p:FindFirstChild("Mesh") then local m = p:FindFirstChild("Mesh")local s = m.Scale
- if s.x>0 then
- m.Scale = s-Vector3.new(.075,0.075,0)
- end
- end end end,{obj})
- end
- end)
- end
- function Smoke(origin,color)
- local p = Part("Effect",workspace,Vector3.new(2,2,2),origin*CFrame.new(rand(5),-1,rand(5)),color or "Black",.25,false,false,"SmoothPlastic")
- local m = Mesh(p,"Sphere",Vector3.new(1.25,1.25,1.25))
- local bp = Instance.new("BodyPosition",p)bp.D = 100 bp.P = 100 bp.position = p.Position+Vector3.new(0,7,0)
- q(function(pa,me)
- fade(pa,.25)
- for i=25,100 do
- me.Scale = me.Scale+Vector3.new(0.15,0.1,0.15)
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function brickMagic(origin,color,size)
- local p = Part("Effect",workspace,Vector3.new(size,size,size),origin*CFrame.Angles(rand(5),rand(5),rand(5)),color,.2,true,false,"SmoothPlastic")
- local m = Mesh(p,"Brick")
- q(function(pa,me)
- fade(pa,.2)
- for i=20,100 do
- me.Scale = me.Scale-Vector3.new(0.05,0.05,0.05)
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function spikeMagic(origin,size,color)
- local p = Part("Effect",workspace,Vector3.new(1,1,1),origin*CFrame.new(0,-size,0),color,1,true,false,"SmoothPlastic")
- local m = Mesh(p,"FileMesh",Vector3.new(size/2,size*2,size/2),asset..meshes["spike"])
- q(function(pa,me)
- appear(pa)
- for i=1,size,.5 do
- wait(1/30)
- pa.CFrame = pa.CFrame*CFrame.new(0,.5,0)
- end
- wait(math.random(2,3))fade(pa,0)
- Delay(3,function()pa:Destroy()end)
- end,{p,m})
- end
- function placePart(origin,size,color,material)
- local p = Part("Effect",workspace,Vector3.new(size,size,size),origin*CFrame.Angles(rand(5),rand(5),rand(5)),color,0,true,true,material)
- local m = Mesh(p,"Brick")
- q(function(pa,me)
- wait(5)
- fade(pa,0)
- Delay(1.25,function()pa:Destroy()end)
- end,{p,m})
- end
- function crater(origin,dist)
- local b = workspace.Base
- local bc = b and tostring(b.BrickColor) or "Bright green"
- local m = b and b.Material or "Grass"
- for i=0,360,30 do
- local cf = origin*CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,dist)*CFrame.Angles(math.rad(i/30),0,rand(5))
- placePart(cf,math.random(10,12),bc,m)
- end
- end
- function ringExplode(origin,color,size)
- local p = Part("Effect",workspace,Vector3.new(size,size,1),origin,color,.2,true,false,"SmoothPlastic")
- local m = Mesh(p,"FileMesh",Vector3.new(),asset..meshes["ring"])
- q(function(pa,me)
- fade(pa,.2)
- for i=.2,1,.025 do
- me.Scale = me.Scale-Vector3.new(0.5,0.5,0)
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function crownExplode(origin,color,size)
- local p = Part("Effect",workspace,Vector3.new(size,size,size),origin,color,.2,true,false,"SmoothPlastic")
- local m = Mesh(p,"FileMesh",Vector3.new(size/2,size/2,size/2),asset..meshes["crown"])
- q(function(pa,me)
- fade(pa,.2)
- for i=.2,1,.025 do
- me.Scale = me.Scale+Vector3.new(0.75,0.75,0.75)
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function glitter(origin,color)
- local p = Part("Effect",workspace,Vector3.new(0.75,0.75,0.75),origin*CFrame.new(rand(5),rand(5),rand(5))*CFrame.Angles(rand(5),rand(5),rand(5)),color,0,true,false,"SmoothPlastic")
- local m = Mesh(p,"Brick",Vector3.new(1,1,1))
- q(function(pa,me)
- fade(pa,0)
- for i=0,1,.05 do
- me.Scale = me.Scale-Vector3.new(0.05,0.05,0.05)
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function quickSound(id,v)
- local s = Instance.new("Sound",workspace)
- s.SoundId = id
- s.PlayOnRemove = true
- s.Volume = v or 1
- delay(0.025,function()s:remove()end)
- end
- function Shoot()
- quickSound(asset..sounds["gun"],.2)
- local start = top.CFrame*CFrame.Angles(math.pi/2,0,0)
- ringExplode(CFrame.new(start.p,start.p-(start.lookVector*-4)),mcolor,5)
- local vel = start.lookVector
- local p = Part("Bullet",workspace,Vector3.new(1,1,5),start,mcolor,0.4,true,false,"SmoothPlastic")
- local m = Mesh(p,"Sphere")
- local num = 0
- local ign = sword:children()
- local connect
- connect = step:connect(function()
- num = num + 1
- local pp = p.Position
- local h,po
- repeat
- local r = Ray.new(pp,vel.unit*math.min(999.5,vel.magnitude/30+20))
- h,po = workspace:FindPartOnRayWithIgnoreList(r,ign)
- if h then
- if h.CanCollide then
- break
- else
- table.insert(ign,h)
- h = nil
- end
- else
- break
- end
- until false
- p.CFrame = CFrame.new(po,po+vel)
- if h or num > 300 then
- local cf = p.CFrame
- q(function(cfz)
- for i=1,math.random(1,3)do
- Smoke(cfz,mcolor)
- end
- if h~=nil then
- local obj = h.CFrame:pointToObjectSpace(po)
- local siz = h.Size/2
- local svec = obj/siz
- svec = Vector3.new(math.floor(math.abs(svec.X)+.01)*svec.X/math.abs(svec.X),
- math.floor(math.abs(svec.Y))*svec.Y/math.abs(svec.Y) ,
- math.floor(math.abs(svec.Z))*svec.Z/math.abs(svec.Z))
- if svec.magnitude ~= 1 then return end
- local dir = h.CFrame:vectorToWorldSpace(svec)
- for i=1,math.random(1,3)do
- spikeMagic(CFrame.new(po,po-dir)*CFrame.new(math.random(-3,3),0,math.random(-3,3))*CFrame.Angles(math.pi/2,0,0),math.random(5,7),mcolor)
- end
- end
- end,{cf})
- if h and h.Parent~=char then
- local hum;
- for i,v in pairs(h.Parent:children())do if v:IsA("Humanoid")then hum = v end end
- if hum then hum:TakeDamage(25)end
- end
- p:Destroy()
- connect:disconnect()
- end
- end)
- end
- function dmgGui(player,dmg)
- end
- function checkDmgArea(origin,dmg,d)
- for i,v in pairs(workspace:children())do
- if v~=char and v:FindFirstChild("Torso") then
- local h;
- for _,k in pairs(v:children())do if k:IsA("Humanoid") then h = k end end
- local dist = (origin.p - v:FindFirstChild("Torso").CFrame.p).magnitude
- if dist < d and h~=nil then
- h.Health = h.Health - dmg
- end
- end
- end
- end
- --------------------------------------------- make the sword
- pcall(function()char:FindFirstChild("Sword"):Destroy()end)
- sword = Instance.new("Model",char)
- sword.Name = "Sword"
- handle = Part("Handle",sword,Vector3.new(0,1,0),torso.CFrame,mcolor,.4,false,false,"SmoothPlastic",.1)
- Mesh(handle,"Brick",Vector3.new(.75,1,.25))
- hweld = Weld(rarm,handle,CFrame.new(0,-1.1,0)*CFrame.Angles(-math.pi/2,math.pi/2,0))
- p1 = Part("P1",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p1m = Instance.new("CylinderMesh",p1)
- p1m.Scale = Vector3.new(1.5,.3,1.5)
- p1w = Weld(handle,p1,CFrame.new(0,-.5,0))
- p2 = Part("P2",sword,Vector3.new(0,.5,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p2m = Mesh(p2,"Brick",Vector3.new(.5,1.1,.5))
- p2w = Weld(handle,p2,CFrame.new(.05,-.25,0)*CFrame.Angles(0,0,-.1))
- p3 = Part("P3",sword,Vector3.new(0,.5,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p3m = Mesh(p3,"Brick",Vector3.new(.5,1,.5))
- p3w = Weld(handle,p3,CFrame.new(.0765,.25,0)*CFrame.Angles(0,0,0))
- p4 = Part("P4",sword,Vector3.new(0,.5,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p4m = Mesh(p4,"Brick",Vector3.new(.5,1.1,.5))
- p4w = Weld(handle,p4,CFrame.new(-.05,-.25,0)*CFrame.Angles(0,0,.1))
- p5 = Part("P5",sword,Vector3.new(0,.5,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p5m = Mesh(p5,"Brick",Vector3.new(.5,1,.5))
- p5w = Weld(handle,p5,CFrame.new(-.0765,.25,0)*CFrame.Angles(0,0,0))
- p6 = Part("P6",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p6m = Instance.new("CylinderMesh",p6)
- p6m.Scale = Vector3.new(1.5,.3,1.5)
- p6w = Weld(handle,p6,CFrame.new(.25,.5,0))
- p7 = Part("P7",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p7m = Instance.new("CylinderMesh",p7)
- p7m.Scale = Vector3.new(1.5,.3,1.5)
- p7w = Weld(handle,p7,CFrame.new(-.25,.5,0))
- p8 = Part("P8",sword,Vector3.new(.5,0,.25),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p8m = Mesh(p8,"Brick",Vector3.new(1,.3,1.185))
- p8w = Weld(handle,p8,CFrame.new(0,.5,0))
- p9 = Part("P9",sword,Vector3.new(0,0,0),torso.CFrame,mcolor,0.4,false,false,"SmoothPlastic")
- p9m = Instance.new("CylinderMesh",p9)
- p9m.Scale = Vector3.new(1.3,.3,1.3)
- p9w = Weld(handle,p9,CFrame.new(.25,.55,0))
- p10 = Part("P10",sword,Vector3.new(0,0,0),torso.CFrame,mcolor,0.4,false,false,"SmoothPlastic")
- p10m = Instance.new("CylinderMesh",p10)
- p10m.Scale = Vector3.new(1.3,.3,1.3)
- p10w = Weld(handle,p10,CFrame.new(-.25,.55,0))
- p11 = Part("P11",sword,Vector3.new(.5,0,.25),torso.CFrame,mcolor,0.4,false,false,"SmoothPlastic")
- p11m = Mesh(p11,"Brick",Vector3.new(1,.3,1.025))
- p11w = Weld(handle,p11,CFrame.new(0,.55,0))
- p12 = Part("P12",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p12m = Instance.new("CylinderMesh",p12)
- p12m.Scale = Vector3.new(1.5,.3,1.5)
- p12w = Weld(handle,p12,CFrame.new(.25,.6,0))
- p13 = Part("P13",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p13m = Instance.new("CylinderMesh",p13)
- p13m.Scale = Vector3.new(1.5,.3,1.5)
- p13w = Weld(handle,p13,CFrame.new(-.25,.6,0))
- p14 = Part("P14",sword,Vector3.new(.5,0,.25),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p14m = Mesh(p14,"Brick",Vector3.new(1,.3,1.185))
- p14w = Weld(handle,p14,CFrame.new(0,.6,0))
- blade = Part("Blade",sword,Vector3.new(.75,4,0),torso.CFrame,mcolor,.4,false,false,"SmoothPlastic",.1)
- bladem = Mesh(blade,"Brick",Vector3.new(1,1,.1))
- bladew = Weld(handle,blade,CFrame.new(0,2.625,0))
- blight = Instance.new("PointLight",blade)
- blight.Color = BrickColor.new(mcolor).Color
- p15 = WedgePart("P15",sword,Vector3.new(4,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p15m = Mesh(p15,"Wedge",Vector3.new(1,.1,1.25))
- p15w = Weld(blade,p15,CFrame.new(-.25,0,-0.02)*CFrame.Angles(-math.pi/2,math.pi/2,0))
- p16 = WedgePart("P16",sword,Vector3.new(4,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p16m = Mesh(p16,"Wedge",Vector3.new(1,.1,1.25))
- p16w = Weld(blade,p16,CFrame.new(-.25,0,0.02)*CFrame.Angles(math.pi/2,math.pi/2,0))
- p17 = WedgePart("P17",sword,Vector3.new(4,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p17m = Mesh(p17,"Wedge",Vector3.new(1,.1,1.25))
- p17w = Weld(blade,p17,CFrame.new(.25,0,0.02)*CFrame.Angles(math.pi/2,-math.pi/2,0))
- p18 = WedgePart("P18",sword,Vector3.new(4,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p18m = Mesh(p18,"Wedge",Vector3.new(1,.1,1.25))
- p18w = Weld(blade,p18,CFrame.new(.25,0,-0.02)*CFrame.Angles(-math.pi/2,-math.pi/2,0))
- p19 = Part("P19",sword,Vector3.new(.75,0,0),torso.CFrame,"Grey",1,false,false,"SmoothPlastic")
- p19m = Mesh(p19,"Brick",Vector3.new(1,.625,.1))
- p19w = Weld(blade,p19,CFrame.new(0,2.2,0))
- p20 = WedgePart("P20",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p20m = Mesh(p20,"Wedge",Vector3.new(.1,3.6,1.25))
- p20w = Weld(p19,p20,CFrame.new(-.25,.16,0)*CFrame.Angles(0,math.pi/2,0))
- p21 = WedgePart("P20",sword,Vector3.new(0,0,0),torso.CFrame,"Grey",0,false,false,"SmoothPlastic")
- p21m = Mesh(p21,"Wedge",Vector3.new(.1,3.6,1.25))
- p21w = Weld(p19,p21,CFrame.new(.25,.16,0)*CFrame.Angles(0,-math.pi/2,0))
- top = Part("Tip",sword,Vector3.new(0,0,0),torso.CFrame,mcolor,1,false,false,"SmoothPlastic")
- topm = Mesh(top,"Brick")
- topw = Weld(p19,top,CFrame.new(0,1,0))
- ohw = hweld.C0
- --------------------------------------------- events and main loop
- mouse.Button1Down:connect(function()
- if Mode=="" then
- Mode = "Swing1"
- coroutine.wrap(function()
- for i=1,math.random(3,4)do
- local cf = torso.CFrame*CFrame.new(rand(5),0,rand(5))
- checkDmgArea(cf,20,5)
- spikeMagic(cf,math.random(4,6),mcolor)
- end
- end)()
- elseif Mode=="Swing1" then
- Delay(0.2,function()ringExplode(top.CFrame*CFrame.Angles(math.pi/2,0,0),mcolor,1)end)
- Mode = "Swing2"
- elseif Mode=="Swing2" then
- Delay(0.2,function()
- for i=1,math.random(2,4)do
- Smoke(top.CFrame,mcolor)
- checkDmgArea(top.CFrame,20,5)
- end
- end)
- Mode = "Swing3"
- elseif Mode=="Swing3" then
- Mode = ""
- elseif Mode=="Shoot" then
- Shoot()
- end
- lastSwing = tick()
- end)
- mouse.KeyDown:connect(function(key)
- key:lower()
- if key=="l"then
- if Mode~="Shoot" then
- Mode = "Shoot"
- elseif Mode=="Shoot" then
- Mode = ""
- end
- end
- end)
- Trailing.Changed:connect(function()
- if Trailing.Value then
- Trail(top)
- end
- end)
- count = 0
- angle = 0
- counttime = 70
- countspeed = 1
- speed = .3
- step:connect(function() -- main loop
- count = (count%counttime)+countspeed
- angle = math.pi*math.cos((math.pi*2)/counttime*count)
- torVel = Vector3.new(torso.Velocity.x,0,torso.Velocity.z)
- if (tick()-lastSwing) > .8 and Mode:match("Swing") then
- Mode = ""
- end
- if Mode=="" then
- Trailing.Value = false
- rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(math.pi/4,0,-math.pi/6),.2)
- ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-math.pi/6,0,0),.2)
- hweld.C0 = clerp(hweld.C0,ohw,.5)
- elseif Mode=="Swing1" then
- Trailing.Value = true
- glitter(top.CFrame,mcolor)
- rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(math.pi,0,0),.5)
- ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(math.pi/6,0,math.pi/5),.2)
- hweld.C0 = clerp(hweld.C0,ohw*CFrame.Angles(0,0,-math.pi/2),.5)
- elseif Mode=="Swing2" then
- Trailing.Value = true
- glitter(top.CFrame,mcolor)
- rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(math.pi/6,0,math.pi/5),.5)
- ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(math.pi/6,0,math.pi/4),.2)
- hweld.C0 = clerp(hweld.C0,ohw*CFrame.Angles(0,0,-math.pi/8),.5)
- elseif Mode=="Swing3" then
- Trailing.Value = true
- glitter(top.CFrame,mcolor)
- rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(math.pi/2,0,-math.pi/3),.5)
- ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(math.pi/2,0,math.pi/8),.5)
- hweld.C0 = clerp(hweld.C0,ohw*CFrame.Angles(0,0,-math.pi/2),.5)
- elseif Mode=="Shoot" then
- Trailing.Value = true
- local mpos = torso.CFrame * rs.c0 -- thx doogle <3
- local cf = CFrame.new(mpos.p,mouse.Hit.p) * CFrame.Angles(math.pi/2,0,0)
- local x,y,z = torso.CFrame:toObjectSpace(cf):toEulerAnglesXYZ()
- rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(x,y,z),.5)
- ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-math.pi/6,0,0),.5)
- hweld.C0 = clerp(hweld.C0,ohw*CFrame.Angles(0,0,-math.pi/2),.5)
- elseif Mode=="Summoning" then
- Trailing.Value = false
- rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(math.pi,0,0),.2)
- ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(math.pi,0,0),.2)
- hweld.C0 = clerp(hweld.C0,ohw*CFrame.Angles(0,0,-math.pi/2),.5)
- end
- LastMode = Mode
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement