Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- > Dumb scythe by wulfbug9.
- -- > Released cause I never finished, nor will.
- -- > Enjoy.
- ------------------------------------------------------------------------ useful functions
- function r(n) return (math.random()-.5)*2*n end
- function c(func,args) coroutine.resume(coroutine.create(func),unpack(args or {})) end
- function Part(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat)
- local surfaces = {"Front","Back","Left","Right","Top","Bottom"}
- 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.CanCollide = Can;p.Material = Mat
- p:BreakJoints();p.Locked = true
- for i=1,#surfaces do p[surfaces[i].."Surface"] = 10 end
- return p
- end
- function WedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat)
- local surfaces = {"Front","Back","Left","Right","Top","Bottom"}
- 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.CanCollide = Can;p.Material = Mat
- p:BreakJoints();p.Locked = true
- for i=1,#surfaces do p[surfaces[i].."Surface"] = 10 end
- 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 rayCast(pos,dir,ign)
- ign = ign or {char}
- return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos,dir),ign)
- end
- ------------------------------------------------------------------------
- Tween = {}
- function slerp(a,b,c)return (1-c)*a+(c*b)end
- function cslerp(start,destination,increment)
- local c1 = {start.X,start.Y,start.Z,start:toEulerAnglesXYZ()}
- local c2 = {destination.X,destination.Y,destination.Z,destination:toEulerAnglesXYZ()}
- for i,v in pairs(c1)do c1[i] = slerp(v,c2[i],increment)end
- return CFrame.new(c1[1],c1[2],c1[3])*CFrame.Angles(c1[4],c1[5],c1[6])
- end
- function TweenWeld(weld,type,start,finish,speed,sync)
- if Tween[weld] and Tween[weld][1] == true then return end
- Tween[weld] = {weld,true}
- local function T()
- for i=1,speed do
- local s = i/speed
- weld[type] = cslerp(start,finish,s)
- game:service("RunService").Stepped:wait()
- end
- Tween[weld] = {weld,false}
- end
- if sync then coroutine.wrap(T)() else T() end
- end
- ------------------------------------------------------------------------ variables
- 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")
- head = char:WaitForChild("Head")
- bodycolours = char:WaitForChild("Body Colors")
- mouse = player:GetMouse()
- step = game:service("RunService").RenderStepped
- camera = workspace.CurrentCamera
- asset = "http://www.roblox.com/asset/?id="
- meshes = {["blast"] = 20329976,["ring"] = 3270017,["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["cloud"] = 1095708,["diamond"] = 9756362}
- sounds = {["explode"] = 130792180;["spin"] = 147722227;["patrick"] = 135290668}
- Attacking = false
- Trailing = true
- Spin = false
- target = nil
- Rad = 0
- c0 = {
- ls = CFrame.new(-1,0.5,0)*CFrame.Angles(math.pi/4,0,0),
- rs = CFrame.new(1,0.5,0)*CFrame.Angles(math.pi/3,0,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),
- }
- c0NA = {
- 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),
- }
- bg = Instance.new("BodyGyro",root)
- bg.maxTorque = Vector3.new(1,1,1)*10^6
- bg.P = 10^4
- rs = Weld(torso,char:WaitForChild("Right Arm"),c0.rs,c1.rs)
- ls = Weld(torso,char:WaitForChild("Left Arm"),c0.ls,c1.ls)
- tw = Weld(root,torso,c0.tw)
- hw = Weld(torso,head,c0.nk,c1.nk)
- colours = {"Brown","Black","Dark stone grey","White","Bright red"}
- local model,ohw
- ------------------------------------------------------------------------ effects & functions
- function quickSound(id,v,p)
- local s = Instance.new("Sound",workspace)
- s.SoundId = id
- s.PlayOnRemove = true
- s.Volume = v or 1
- s.Pitch = p or 1
- delay(0.025,function()s:remove()end)
- end
- function doDmg(cf,hum,dmg)
- for i=1,math.random(2,3)do
- local cfz = cf*CFrame.new(r(2),-2.9,r(2))
- local p = Part("Blood",workspace,Vector3.new(0,0,0),cfz,"Bright red",0,true,false,"SmoothPlastic")
- local m = Instance.new("CylinderMesh",p)
- m.Scale = Vector3.new(0,.1,0)
- c(function(pa,ma)
- for i=1,math.random(10,20)do
- ma.Scale = ma.Scale + Vector3.new(.75,0,.75)
- wait()
- end
- wait(math.random(1,3))
- for i=0,1,.1 do
- wait()
- pa.Transparency = i
- end
- pa:Destroy()
- end,{p,m})
- end
- hum.Health = hum.Health - 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
- doDmg(v:FindFirstChild("Torso").CFrame,h,dmg)
- end
- end
- end
- end
- function findClosestPlayer(origin,d)
- local bdist,plr = d,nil
- 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 < bdist and h~=nil and h.Health~=0 then
- bdist,plr = dist,v
- end
- end
- end
- return plr,bdist
- end
- function drawLine(mag,one,two)
- local t = Part("",char,Vector3.new(.5,mag,.5),CFrame.new(one,two)*CFrame.new(0,0,-mag/2)*CFrame.Angles(math.pi/2,0,0),"White",0,true,false,"Plastic")
- c(function(p,m)
- for i=1,0,-.05 do
- m.Scale = Vector3.new(i,1,i)
- wait(1/30)
- end
- p:Destroy()
- end,{t,Instance.new("CylinderMesh",t)})
- end
- function Trail(part)
- Trailing = true
- local lastPos = part.CFrame.p
- local tik = tick()
- local tim = .025
- local loop;
- loop = game:service("RunService").RenderStepped:connect(function()
- if (tick()-tik)>tim and Trailing then
- local dist = (lastPos-part.CFrame.p).magnitude
- drawLine(dist,lastPos,part.CFrame.p)
- lastPos = part.CFrame.p
- tik = tick()
- elseif not Trailing then
- loop:disconnect()
- end
- end)
- end
- function modelCloneTrail(model)
- for i,v in pairs(model:children())do
- if v:IsA("BasePart") then
- local p = v:Clone()
- p.Anchored = true
- p.Parent = workspace
- c(function(part)
- for i=0,1,.2 do
- part.Transparency = i
- wait(1/30)
- end
- part:Destroy()
- end,{p})
- end
- end
- end
- ------------------------------------------------------------------------ build the weapon
- pcall(function()char:FindFirstChild("DScythe"):Destroy()end)
- model = Instance.new("Model",char)
- model.Name = "DScythe"
- blademodel = Instance.new("Model",model)
- blademodel.Name = "bladeModel"
- handle = Part("",model,Vector3.new(.3,7.5,.3),torso.CFrame,colours[1],0,false,false,"Plastic")
- handlem = Instance.new("CylinderMesh",handle)
- handlew = Weld(char:FindFirstChild("Right Arm"),handle,CFrame.new(-3.25,-1.1,0)*CFrame.Angles(-math.pi/2.5,0,math.pi/2))
- l1 = Part("",model,Vector3.new(0,7.55,0),torso.CFrame,colours[3],0,false,false,"Plastic")
- l1m = Mesh(l1,"Brick",Vector3.new(.2,1,1.5))
- l1w = Weld(handle,l1)
- l2 = Part("",model,Vector3.new(0,7.55,0),torso.CFrame,colours[3],0,false,false,"Plastic")
- l2m = Mesh(l2,"Brick",Vector3.new(1.5,1,.2))
- l2w = Weld(handle,l2)
- l3 = Part("",model,Vector3.new(0,7.55,0),torso.CFrame,colours[2],0,false,false,"Plastic")
- l3m = Mesh(l3,"Brick",Vector3.new(.2,1,1.5))
- l3w = Weld(handle,l3,CFrame.Angles(0,math.pi/4,0))
- l4 = Part("",model,Vector3.new(0,7.55,0),torso.CFrame,colours[2],0,false,false,"Plastic")
- l4m = Mesh(l4,"Brick",Vector3.new(.2,1,1.5))
- l4w = Weld(handle,l4,CFrame.Angles(0,-math.pi/4,0))
- p1 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[2],0,false,false,"Plastic")
- p1m = Instance.new("CylinderMesh",p1)
- p1m.Scale = Vector3.new(1.55,1,1.55)
- p1w = Weld(handle,p1,CFrame.new(0,2,0))
- p2 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[3],0,false,false,"Plastic")
- p2m = Instance.new("CylinderMesh",p2)
- p2m.Scale = Vector3.new(1.55,1,1.55)
- p2w = Weld(handle,p2,CFrame.new(0,1.5,0))
- p3 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[2],0,false,false,"Plastic")
- p3m = Instance.new("CylinderMesh",p3)
- p3m.Scale = Vector3.new(1.55,1,1.55)
- p3w = Weld(handle,p3,CFrame.new(0,1,0))
- p4 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[3],0,false,false,"Plastic")
- p4m = Instance.new("CylinderMesh",p4)
- p4m.Scale = Vector3.new(1.55,1,1.55)
- p4w = Weld(handle,p4,CFrame.new(0,.5,0))
- p5 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[2],0,false,false,"Plastic")
- p5m = Instance.new("CylinderMesh",p5)
- p5m.Scale = Vector3.new(1.55,1,1.55)
- p5w = Weld(handle,p5)
- p6 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[3],0,false,false,"Plastic")
- p6m = Instance.new("CylinderMesh",p6)
- p6m.Scale = Vector3.new(1.55,1,1.55)
- p6w = Weld(handle,p6,CFrame.new(0,-.5,0))
- p7 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[2],0,false,false,"Plastic")
- p7m = Instance.new("CylinderMesh",p7)
- p7m.Scale = Vector3.new(1.55,1,1.55)
- p7w = Weld(p4,p7,CFrame.new(0,-1,0))
- p8 = Part("",model,Vector3.new(0,0,0),torso.CFrame,colours[3],0,false,false,"Plastic")
- p8m = Instance.new("CylinderMesh",p8)
- p8m.Scale = Vector3.new(1.55,1,1.55)
- p8w = Weld(p3,p8,CFrame.new(0,-1.5,0))
- p9 = Part("",model,Vector3.new(.4,1.25,.4),torso.CFrame,colours[2],0,false,false,"Plastic")
- p9m = Instance.new("CylinderMesh",p9)
- p9w = Weld(handle,p9,CFrame.new(0,3.85,0))
- p10 = Part("",model,Vector3.new(.35,1.25,.35),torso.CFrame,colours[3],0,false,false,"Plastic")
- p10m = Instance.new("CylinderMesh",p10)
- p10w = Weld(p9,p10,CFrame.new(0,.025,0))
- p11 = Part("",blademodel,Vector3.new(0,.75,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic") --<
- p11m = Mesh(p11,"Brick",Vector3.new(.25,1,2))
- p11w = Weld(p10,p11,CFrame.new(0,-.125,-1))
- p12 = WedgePart("",blademodel,Vector3.new(0,.25,2),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p12m = Mesh(p12,"Wedge",Vector3.new(.25,1,1))
- p12w = Weld(p11,p12,CFrame.new(0,.5,0))
- p13 = WedgePart("",blademodel,Vector3.new(0,.25,2),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p13m = Mesh(p13,"Wedge",Vector3.new(.25,1,1))
- p13w = Weld(p11,p13,CFrame.new(0,-.5,0)*CFrame.Angles(math.pi,0,0))
- p14 = Part("",blademodel,Vector3.new(0,.75,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p14m = Mesh(p14,"Brick",Vector3.new(.25,1,1))
- p14w = Weld(p11,p14,CFrame.new(0,-.25,-1.5))
- p15 = WedgePart("",blademodel,Vector3.new(0,.5,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p15m = Mesh(p15,"Wedge",Vector3.new(.25,1,1))
- p15w = Weld(p14,p15,CFrame.new(0,-.625,0)*CFrame.Angles(math.pi,0,0))
- p16 = WedgePart("",blademodel,Vector3.new(0,.25,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p16m = Mesh(p16,"Wedge",Vector3.new(.25,1,1))
- p16w = Weld(p14,p16,CFrame.new(0,.5,0))
- p17 = Part("",blademodel,Vector3.new(0,.75,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p17m = Mesh(p17,"Brick",Vector3.new(.25,1,1))
- p17w = Weld(p14,p17,CFrame.new(0,-.5,-1))
- p18 = WedgePart("",blademodel,Vector3.new(0,.5,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p18m = Mesh(p18,"Wedge",Vector3.new(.25,1,1))
- p18w = Weld(p17,p18,CFrame.new(0,-.625,0)*CFrame.Angles(math.pi,0,0))
- p19 = WedgePart("",blademodel,Vector3.new(0,.5,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p19m = Mesh(p19,"Wedge",Vector3.new(.25,1,1))
- p19w = Weld(p17,p19,CFrame.new(0,.625,0))
- p20 = Part("",blademodel,Vector3.new(0,.5,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p20m = Mesh(p20,"Brick",Vector3.new(.25,1,1))
- p20w = Weld(p17,p20,CFrame.new(0,-.625,-1))
- p21 = WedgePart("",blademodel,Vector3.new(0,.75,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p21m = Mesh(p21,"Wedge",Vector3.new(.25,1,1))
- p21w = Weld(p20,p21,CFrame.new(0,-.625,0)*CFrame.Angles(math.pi,0,0))
- p22 = WedgePart("",blademodel,Vector3.new(0,.75,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p22m = Mesh(p22,"Wedge",Vector3.new(.25,1,1))
- p22w = Weld(p20,p22,CFrame.new(0,.625,0))
- p23 = WedgePart("",blademodel,Vector3.new(0,1.25,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p23m = Mesh(p23,"Wedge",Vector3.new(.25,1,1))
- p23w = Weld(p20,p23,CFrame.new(0,-.375,-1))
- p24 = WedgePart("",blademodel,Vector3.new(0,1.25,1),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p24m = Mesh(p24,"Wedge",Vector3.new(.25,1,1))
- p24w = Weld(p23,p24,CFrame.new(0,-1.25,0)*CFrame.Angles(math.pi,0,0))
- p25 = Part("",blademodel,Vector3.new(.25,1,1),torso.CFrame,colours[5],0,false,false,"SmoothPlastic")
- p25m = Mesh(p25,"Sphere",Vector3.new(.4,1,1))
- p25w = Weld(p11,p25)
- p26 = Part("",blademodel,Vector3.new(.25,.5,.5),torso.CFrame,colours[4],0,false,false,"SmoothPlastic")
- p26m = Mesh(p26,"Sphere",Vector3.new(.5,1,1))
- p26w = Weld(p25,p26)
- p27 = Part("",blademodel,Vector3.new(.25,.2,.2),torso.CFrame,colours[2],0,false,false,"SmoothPlastic")
- p27m = Mesh(p27,"Sphere",Vector3.new(.6,1,1))
- p27w = Weld(p25,p27)
- ohw = handlew.C0
- ohwNA = CFrame.new(0,-1.1,0)
- ------------------------------------------------------------------------ functions + attacks
- function returnToOriginal(speed)
- ----- reset some settings
- Rad = 0
- target = nil
- -----
- TweenWeld(rs,"C0",rs.C0,c0.rs,speed,true)
- TweenWeld(ls,"C0",ls.C0,c0.ls,speed,true)
- TweenWeld(tw,"C0",tw.C0,c0.tw,speed,true)
- TweenWeld(hw,"C0",hw.C0,c0.nk,speed,true)
- TweenWeld(handlew,"C0",handlew.C0,ohw,speed)
- end
- function stab(victim)
- local t = victim:FindFirstChild("Torso")
- target = t
- checkDmgArea(t.CFrame,20,3)
- end
- function swing()
- Attacking = true
- Spin = true
- TweenWeld(rs,"C0",rs.C0,c0NA.rs*CFrame.new(.5,0,-.5)*CFrame.Angles(math.pi/2,0,math.pi/2),5,true)
- TweenWeld(ls,"C0",ls.C0,c0NA.ls*CFrame.Angles(0,0,-math.pi/8),5,true)
- TweenWeld(tw,"C0",tw.C0,c0.tw,5,true)
- TweenWeld(hw,"C0",hw.C0,c0.nk,5,true)
- TweenWeld(handlew,"C0",handlew.C0,ohwNA*CFrame.new(0,-2.5,0)*CFrame.Angles(math.pi,math.pi/2,0),5)
- local victim
- repeat wait()
- modelCloneTrail(blademodel)
- victim = findClosestPlayer(p24.CFrame,2)
- until Rad >= 360*2 or victim~=nil
- Spin = false
- if victim then
- Rad = 0
- stab(victim)
- end
- returnToOriginal(10)
- Attacking = false
- end
- ------------------------------------------------------------------------
- mouse.Button1Down:connect(function()
- end)
- mouse.KeyDown:connect(function(key)
- key:lower()
- if key=="q" and not Attacking then
- swing()
- end
- end)
- ------------------------------------------------------------------------
- step:connect(function()
- if target and not Spin then
- bg.cframe = CFrame.new(CFrame.new(root.CFrame.x,root.CFrame.y,root.CFrame.z).p,CFrame.new(target.CFrame.x,root.CFrame.y,target.CFrame.z).p)
- elseif not target and not Spin then
- bg.cframe = CFrame.new(CFrame.new(root.CFrame.x,root.CFrame.y,root.CFrame.z).p,CFrame.new(camera.CoordinateFrame.x,root.CFrame.y,camera.CoordinateFrame.z).p)*CFrame.Angles(0,math.pi,0)
- elseif Spin then
- Rad = Rad + 10
- bg.cframe = CFrame.new(root.CFrame.x,root.CFrame.y,root.CFrame.z)*CFrame.Angles(0,math.rad(Rad),0)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement