Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player=game:GetService("Players").LocalPlayer
- Character=Player.Character
- PlayerGui=Player.PlayerGui
- Backpack=Player.Backpack
- Torso=Character.Torso
- Head=Character.Head
- Humanoid=Character.Humanoid
- LeftArm=Character["Left Arm"]
- LeftLeg=Character["Left Leg"]
- RightArm=Character["Right Arm"]
- RightLeg=Character["Right Leg"]
- LS=Torso["Left Shoulder"]
- LH=Torso["Left Hip"]
- RS=Torso["Right Shoulder"]
- RH=Torso["Right Hip"]
- Face = Head.face
- Neck=Torso.Neck
- it=Instance.new
- attacktype=1
- vt=Vector3.new
- cf=CFrame.new
- euler=CFrame.fromEulerAnglesXYZ
- angles=CFrame.Angles
- cloaked=false
- necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
- LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
- RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
- RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
- RootPart=Character.HumanoidRootPart
- RootJoint=RootPart.RootJoint
- RootCF=euler(-1.57,0,3.14)
- attack = false
- attackdebounce = false
- deb=false
- equipped=true
- hand=false
- MMouse=nil
- combo=0
- mana=0
- trispeed=.2
- attackmode='none'
- local idle=0
- local Anim="Idle"
- local Effects={}
- local gun=false
- local shoot=false
- player=nil
- mana=0
- cam = workspace.CurrentCamera
- ZTarget = nil
- RocketTarget = nil
- local m = Instance.new("Model",Character)
- m.Name = "WeaponModel"
- local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
- local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
- local LHCF = (CFrame.fromEulerAnglesXYZ(0, -1.6, 0))
- Humanoid.Animator:Destroy()
- Character.Animate:Destroy()
- mouse=Player:GetMouse()
- --save shoulders
- RSH, LSH=nil, nil
- --welds
- RW, LW=Instance.new("Weld"), Instance.new("Weld")
- RW.Name="Right Shoulder" LW.Name="Left Shoulder"
- LH=Torso["Left Hip"]
- RH=Torso["Right Hip"]
- TorsoColor=Torso.BrickColor
- function NoOutline(Part)
- Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
- end
- player=Player
- ch=Character
- RSH=ch.Torso["Right Shoulder"]
- LSH=ch.Torso["Left Shoulder"]
- --
- RSH.Parent=nil
- LSH.Parent=nil
- --
- RW.Name="Right Shoulder"
- RW.Part0=ch.Torso
- RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
- RW.C1=cf(0, 0.5, 0)
- RW.Part1=ch["Right Arm"]
- RW.Parent=ch.Torso
- --
- LW.Name="Left Shoulder"
- LW.Part0=ch.Torso
- LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
- LW.C1=cf(0, 0.5, 0)
- LW.Part1=ch["Left Arm"]
- LW.Parent=ch.Torso
- local RbxUtility = LoadLibrary("RbxUtility")
- local Create = RbxUtility.Create
- ArtificialHB = Instance.new("BindableEvent", Player.PlayerGui)
- ArtificialHB.Name = "Heartbeat"
- Player.PlayerGui:WaitForChild("Heartbeat")
- frame = 0.033333333333333
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- Player.PlayerGui.Heartbeat:Fire()
- local gg = false
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- if Player.PlayerGui:FindFirstChild("Heartbeat") == nil then
- gg = true
- end
- if gg == true then
- return
- end
- tf = tf + s
- if frame <= tf then
- if allowframeloss then
- Player.PlayerGui.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- Player.PlayerGui.Heartbeat:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end
- )
- swait = function(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- NoOutline = function(Part)
- Part.TopSurface = 10
- end
- part = function(formfactor, parent, reflectance, transparency, brickcolor, name, size)
- local fp = it("Part")
- fp.formFactor = formfactor
- fp.Parent = parent
- fp.Reflectance = reflectance
- fp.Transparency = transparency
- fp.CanCollide = false
- fp.Locked = true
- fp.BrickColor = brickcolor
- fp.Name = name
- fp.Size = size
- fp.Position = Torso.Position
- NoOutline(fp)
- fp.Material = "SmoothPlastic"
- fp:BreakJoints()
- return fp
- end
- mesh = function(Mesh, part, meshtype, meshid, offset, scale)
- local mesh = it(Mesh)
- mesh.Parent = part
- if Mesh == "SpecialMesh" then
- mesh.MeshType = meshtype
- if meshid ~= "nil" then
- mesh.MeshId = "http://www.roblox.com/asset/?id=" .. meshid
- end
- end
- mesh.Offset = offset
- mesh.Scale = scale
- return mesh
- end
- weld = function(parent, part0, part1, c0)
- local weld = it("Motor")
- weld.Parent = parent
- weld.Part0 = part0
- weld.Part1 = part1
- weld.C0 = c0
- return weld
- end
- ---maek efokts hurrrrrLOOOL
- WaveEffect = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
- local prt = part(3, Character, 0, 0, brickcolor, "Effect", vt())
- prt.Anchored = true
- prt.CFrame = cframe
- msh = mesh("SpecialMesh", prt, "FileMesh", "20329976", vt(0, 0, 0), vt(x1, y1, z1))
- game:GetService("Debris"):AddItem(prt, 2)
- coroutine.resume(coroutine.create(function(Part, Mesh)
- for i = 0, 1, delay do
- swait()
- Part.CFrame = Part.CFrame * cf(0, y3 / 2, 0)
- Part.Transparency = i
- Mesh.Scale = Mesh.Scale + vt(x3, y3, z3)
- end
- Part.Parent = nil
- end
- ), prt, msh)
- end
- so = function(id,par,vol,pit)
- coroutine.resume(coroutine.create(function()
- local sou = Instance.new("Sound",par or workspace)
- sou.Volume=vol
- sou.Pitch=pit or 1
- sou.SoundId=id
- wait()
- sou:play()
- game:GetService("Debris"):AddItem(sou,6)
- end))
- end
- function clerp(a,b,t)
- return a:lerp(b,t)
- end
- function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
- return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
- end
- function attackone()
- attack = true
- for i = 0,1,0.1 do
- swait()
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(-20),math.rad(0),math.rad(0)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(20),math.rad(0),math.rad(0)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(10)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(-10)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-0.5,-1)*RHCF*angles(math.rad(0),math.rad(0),math.rad(-20)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*LHCF*angles(math.rad(0),math.rad(0),math.rad(20)),.3)
- end
- WaveEffect(BrickColor.new('Royal purple'), cf(RightLeg.Position) * cf(0, -1, 0), 1, 0.4, 1, 0.8, 0, 0.8, 0.1)
- so("rbxassetid://541909913", RightLeg, 3, 1)
- for i = 0,1,0.1 do
- swait()
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(20),math.rad(0),math.rad(0)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-20),math.rad(0),math.rad(0)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-30),math.rad(0),math.rad(20)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30),math.rad(0),math.rad(-20)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-1,-1)*RHCF*angles(math.rad(0),math.rad(0),math.rad(20)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*LHCF*angles(math.rad(0),math.rad(0),math.rad(-20)),.3)
- end
- attack = false
- end
- function attacktwo()
- attack = true
- for i = 0,1,0.1 do
- swait()
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(-40)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(40)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0),math.rad(110),math.rad(30)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(-30),math.rad(-100)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*RHCF*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*LHCF*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- end
- for i = 0,1,0.1 do
- swait()
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(90)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(-90)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(90)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(0)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*RHCF*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*LHCF*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- end
- attack = false
- end
- function TEST_TEST()
- attack = true
- for i = 0, 1, 0.1 do
- swait()
- RootJoint.C0 = clerp(RootJoint.C0, CFrame.new(0, 0, 0, 0.961833477, -0.00788648799, -0.27352196, 0.0523625501, 0.986416817, 0.155690223, 0.268578887, -0.164070383, 0.949181795), 0.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0, CFrame.new(-0.00688448548, 1.51605177, -0.114893898, 0.954184473, -0.0946972966, 0.283838987, 0.0260075796, 0.971256316, 0.236610562, -0.298086852, -0.218388155, 0.929220438), 0.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.52784705, -0.00666735694, 0.0751213133, 0.954337537, 0.0342054293, -0.296765685, -0.00165810436, 0.994013786, 0.10923858, 0.298725665, -0.103758499, 0.948681593), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.65858412, 0.279855609, 0.138465181, -0.467972785, 0.634874582, 0.614764869, 0.487056375, -0.395170778, 0.778855443, 0.737412691, 0.663908362, -0.124290556), 0.3)
- RH.C0 = clerp(RH.C0, CFrame.new(0.43218857, -1.95232046, -0.147927433, 0.969767928, 0.00492880493, -0.243979692, -0.00197404251, 0.99992156, 0.0123538077, 0.244021446, -0.0114987046, 0.969701529), 0.3)
- LH.C0 = clerp(LH.C0, CFrame.new(-0.612137794, -2.06104279, -0.148482472, 0.970677614, 0.177090734, 0.16255492, -0.165461957, 0.982751429, -0.0825935081, -0.174377695, 0.0532749891, 0.983236551), 0.3)
- end
- for i = 0, 1, 0.1 do
- swait()
- RootJoint.C0 = clerp(RootJoint.C0, CFrame.new(0, 0, 0, 0.995687187, -0.0635262504, 0.0676127002, 0.0523625501, 0.986416817, 0.155690223, -0.0765848011, -0.15147838, 0.98548907), 0.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0, CFrame.new(0.117683239, 1.51080942, -0.123570919, 0.964007199, -0.0818148404, 0.252975434, 0.0202799924, 0.971332371, 0.236858353, -0.26510185, -0.223202825, 0.938030601), 0.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.41027629, -0.0812128484, 0.586966157, 0.796212673, 0.123129472, -0.592355013, -0.0413837768, 0.987862349, 0.149715379, 0.603599668, -0.0946914554, 0.791644216), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.58970571, 0.366315603, -0.432485044, -0.697778463, 0.360251397, 0.619131863, 0.332571715, -0.602596223, 0.725447118, 0.634429932, 0.712107122, 0.300669193), 0.3)
- RH.C0 = clerp(RH.C0, CFrame.new(0.366373658, -1.96062434, -0.073182106, 0.829126179, 0.0648658425, -0.555285811, -0.0439591445, 0.997735023, 0.0509130061, 0.557330608, -0.0178034008, 0.830099642), 0.3)
- LH.C0 = clerp(LH.C0, CFrame.new(-0.641470313, -2.03103423, -0.328743041, 0.961717844, 0.203884661, -0.183112353, -0.218594894, 0.973721504, -0.0638933629, 0.165273502, 0.101474784, 0.981013477), 0.3)
- end
- attack = false
- end
- mouse.Button1Down:connect(function()
- if attack == false and attacktype == 1 then
- attacktype = 2
- attackone()
- elseif attack == false and attacktype == 2 then
- attacktype = 1
- attacktwo()
- end
- end)
- mouse.KeyDown:connect(function(k)
- k=k:lower()
- if attack == false and k == 'q' then
- TEST_TEST()
- end
- end)
- local sine = 0
- local change = 1
- local val = 0
- z=Instance.new('Sound',Torso)
- z.Name="hi"
- z.SoundId="rbxassetid://605319592"
- z.Pitch=1
- z.Volume=3
- z.Looped=true
- z:Play()
- while true do
- swait()
- sine = sine + change
- local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
- local velderp=RootPart.Velocity.y
- hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
- if equipped==true or equipped==false then
- if attack==false then
- idle=idle+1
- else
- idle=0
- end
- if idle>=500 then
- if attack==false then
- end
- end
- if RootPart.Velocity.y > 1 and hitfloor==nil then
- Anim="Jump"
- if attack==false then
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(0)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(0)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- end
- elseif RootPart.Velocity.y < -1 and hitfloor==nil then
- Anim="Fall"
- if attack==false then
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(0)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(0),math.rad(0)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
- end
- elseif torvel<1 and hitfloor~=nil then
- Anim="Idle"
- change=1
- if attack==false then
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0 - 0.1 * math.cos((sine) / 20))* angles(math.rad(0),math.rad(0),math.rad(-60)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(60)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(110),math.rad(0),math.rad(-20)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(-20),math.rad(-120)), 0.3)
- RH.C0=clerp(RH.C0,cf(1,-1 + 0.1 * math.cos((sine) / 20),-0.2)*RHCF*angles(math.rad(0),math.rad(-20),math.rad(0)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1 + 0.1 * math.cos((sine) / 20),-0.5)*LHCF*angles(math.rad(0),math.rad(0),math.rad(30)),.3)
- end
- elseif torvel>2 and hitfloor~=nil then
- Anim="Walk"
- if attack==false then
- RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0 - 0.1 * math.cos((sine) / 20))* angles(math.rad(10),math.rad(0),math.rad(-60)),.3)
- Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(-10),math.rad(60)),.3)
- RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(120),math.rad(0),math.rad(-30)), 0.3)
- LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0),math.rad(-30),math.rad(-130)), 0.3)
- RH.C0 = clerp(RH.C0, cf(1, -1 + 0.1 * math.cos((sine) / 20), 0) * RHCF * angles(math.rad(0), math.rad(0), math.rad(0 - 50 * math.cos((sine) / 3))), 0.3)
- LH.C0 = clerp(LH.C0, cf(-1, -1 + 0.1 * math.cos((sine) / 20), 0) * LHCF * angles(math.rad(0), math.rad(0), math.rad(0 - 50 * math.cos((sine) / 3))), 0.3)
- end
- end
- end
- if #Effects>0 then
- for e=1,#Effects do
- if Effects[e]~=nil then
- local Thing=Effects[e]
- if Thing~=nil then
- local Part=Thing[1]
- local Mode=Thing[2]
- local Delay=Thing[3]
- local IncX=Thing[4]
- local IncY=Thing[5]
- local IncZ=Thing[6]
- if Thing[1].Transparency<=1 then
- if Thing[2]=="Block1" then
- Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
- Mesh=Thing[1].Mesh
- Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
- Thing[1].Transparency=Thing[1].Transparency+Thing[3]
- elseif Thing[2]=="Cylinder" then
- Mesh=Thing[1].Mesh
- Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
- Thing[1].Transparency=Thing[1].Transparency+Thing[3]
- elseif Thing[2]=="Blood" then
- Mesh=Thing[7]
- Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0)
- Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
- Thing[1].Transparency=Thing[1].Transparency+Thing[3]
- elseif Thing[2]=="Elec" then
- Mesh=Thing[1].Mesh
- Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
- Thing[1].Transparency=Thing[1].Transparency+Thing[3]
- elseif Thing[2]=="Disappear" then
- Thing[1].Transparency=Thing[1].Transparency+Thing[3]
- end
- else
- Part.Parent=nil
- table.remove(Effects,e)
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment