Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
- wait(1)
- local Player = game:GetService("Players").LocalPlayer
- Character=Player.Character
- Humanoid=Character.Humanoid
- Torso=Character.Torso
- Head = Character.Head
- 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"]
- Neck=Torso.Neck
- equipped=true
- local idle=0
- local anim="Idle"
- attack=false
- overload=false
- 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)
- mouse=Player:GetMouse()
- it = Instance.new
- euler=CFrame.fromEulerAnglesXYZ
- angles=CFrame.Angles
- local RbxUtility = LoadLibrary("RbxUtility")
- local Create = RbxUtility.Create
- local m = Create("Model"){
- Parent = Character,
- Name = "WeaponModel",
- }
- function nooutline(part)
- part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
- end
- function part(formfactor,parent,material,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.new(tostring(brickcolor))
- fp.Name=name
- fp.Size=size
- fp.Position=Character.Torso.Position
- nooutline(fp)
- fp.Material=material
- fp:BreakJoints()
- return fp
- end
- function mesh(Mesh,part,meshtype,meshid,offset,scale)
- local mesh=it(Mesh)
- mesh.Parent=part
- if Mesh=="SpecialMesh" then
- mesh.MeshType=meshtype
- mesh.MeshId=meshid
- end
- mesh.Offset=offset
- mesh.Scale=scale
- return mesh
- end
- function weld(parent,part0,part1,c0,c1)
- local weld=it("Weld")
- weld.Parent=parent
- weld.Part0=part0
- weld.Part1=part1
- weld.C0=c0
- weld.C1=c1
- return weld
- end
- local modeloe=Instance.new("Model")
- modeloe.Parent=Character
- modeloe.Name="Shotgun"
- Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
- Partweld=weld(m,Part2,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(3,0,-0,-1,-1,-1,0,10,0,0,0,1))
- shotgun=mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/Asset/?id=2166741820",Vector3.new(0,0,0),Vector3.new(2.01, 2.01,2.01))
- Part2=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Dark blue"),"Part",Vector3.new(1, 0, -2)) -- forward, up, left, rotation?, angle up,
- firePiece=weld(m,Character["Torso"],Part2,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1,0,-0,-1,-0,-1,0,1,0,0,0,1))
- --------------------------------
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Part
- Weld.Parent = Torso
- local Part0Joint = CFrame.new(Vector3.new(1,8.75,0)*1.25)
- local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*1.25)
- local RotationOffset = CFrame.Angles(math.rad(360),math.rad(0),0)
- local Gangster = false
- local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*1.25)
- local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*1.25)
- local RotationOffsetHead = CFrame.Angles(0,0,0)
- game:GetService("RunService"):BindToRenderStep("Shotgun",Enum.RenderPriority.Character.Value,function()
- local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
- if Point.Z > 0 then
- if Point.X > 0 then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
- elseif Point.X < 0 then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
- end
- end
- local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,mouse.Hit.p))--RayEnd))
- Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
- Weld.C1 = Part1Joint
- Weld.Part0 = Torso
- Weld.Part1 = Part
- end)
- -------------------------------------
- ----------------------------------
- -----------------------------------
- function Damage(hit, damage, cooldown, Color1, Color2, HSound, HPitch)
- for i, v in pairs(hit:GetChildren()) do
- if v:IsA("Humanoid") and hit.Name ~= Character.Name then
- local find = v:FindFirstChild("Hitz")
- if not find then
- if v.Parent:findFirstChild("Head") then
- local BillG = Create("BillboardGui"){
- Parent = v.Parent.Head,
- Size = UDim2.new(1, 0, 1, 0),
- Adornee = v.Parent.Head,
- StudsOffset = Vector3.new(math.random(-3, 3), math.random(3, 5), math.random(-3, 3)),
- }
- local TL = Create("TextLabel"){
- Parent = BillG,
- Size = UDim2.new(3, 3, 3, 3),
- BackgroundTransparency = 1,
- Text = tostring(damage).."-",
- TextColor3 = Color1.Color,
- TextStrokeColor3 = Color2.Color,
- TextStrokeTransparency = 0,
- TextXAlignment = Enum.TextXAlignment.Center,
- TextYAlignment = Enum.TextYAlignment.Center,
- FontSize = Enum.FontSize.Size18,
- Font = "ArialBold",
- }
- coroutine.resume(coroutine.create(function()
- wait(1)
- for i = 0, 1, .1 do
- wait(.1)
- BillG.StudsOffset = BillG.StudsOffset + Vector3.new(0, .1, 0)
- end
- BillG:Destroy()
- end))
- end
- v.Health = v.Health - damage
- local bool = Create("BoolValue"){
- Parent = v,
- Name = 'Hitz',
- }
- if HSound ~= nil and HPitch ~= nil then
- CreateSound(HSound, hit, 1, HPitch)
- end
- game:GetService("Debris"):AddItem(bool, cooldown)
- end
- end
- end
- end
- function rayCast(Pos, Dir, Max, Ignore)
- return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
- end
- Effects = { }
- function MagnitudeDamage(Part, magni, mindam, maxdam, Color1, Color2, HitSound)
- for _, c in pairs(workspace:children()) do
- local hum = c:findFirstChild("Humanoid")
- if hum ~= nil then
- local head = c:findFirstChild("Torso")
- if head ~= nil then
- local targ = head.Position - Part.Position
- local mag = targ.magnitude
- if mag <= magni and c.Name ~= Player.Name then
- Damage(head.Parent, math.random(mindam, maxdam), 0, Color1, Color2, HitSound, 1)
- end
- end
- end
- end
- end
- function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt())
- prt.Anchored=true
- prt.CFrame=cframe
- msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
- game:GetService("Debris"):AddItem(prt,5)
- table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay
- end
- function MagicRing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
- prt.Anchored=true
- prt.CFrame=cframe
- msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
- game:GetService("Debris"):AddItem(prt,2)
- coroutine.resume(coroutine.create(function(Part,Mesh,num)
- for i=0,1,delay do
- swait()
- Part.Transparency=i
- Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
- end
- Part.Parent=nil
- end),prt,msh,(math.random(0,1)+math.random())/5)
- end
- function MagicShotgun(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
- prt.Anchored=true
- prt.CFrame=cframe
- msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=2166741820",vt(0,0,0),vt(x1,y1,z1))
- game:GetService("Debris"):AddItem(prt,2)
- coroutine.resume(coroutine.create(function(Part,Mesh,num)
- for i=0,1,delay do
- swait()
- Part.Transparency=i
- Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
- end
- Part.Parent=nil
- end),prt,msh,(math.random(0,1)+math.random())/5)
- end
- --2166741820
- function MagicBlockx(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt())
- prt.Anchored=true
- prt.CFrame=cframe
- msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
- game:GetService("Debris"):AddItem(prt,5)
- table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay
- end
- function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
- prt.Anchored=true
- prt.CFrame=cframe
- prt.CanCollide = false
- msh=mesh("SpecialMesh",prt,"Sphere","",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
- Part.Transparency=i
- Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
- end
- Part.Parent=nil
- end),prt,msh)
- end
- --------------------------------
- ----------------------------
- function Spreadgun()
- attack = true
- for i = 1,5 do
- LaserBarrage(shotgun.Parent) --(CFrame.new(0,-5,-5.5,-10,-0,-1,0,1,0,0,0,1))
- end
- CreateSound("rbxassetid://3074576931", shotgun.Parent, 3, 0.8)
- wait(1.5)
- attack = false
- end
- function Spreadgun2()
- attack = true
- for i = 1,5 do
- LaserBarrage2(shotgun.Parent) --(CFrame.new(0,-5,-5.5,-10,-0,-1,0,1,0,0,0,1))
- end
- CreateSound("rbxassetid://3074576931", shotgun.Parent, 3, 0.7)
- wait(1.8)
- attack = false
- end
- function lazershell()
- attack = true
- --omsh.Scale=omsh.Scale+vt(0.5,0.5,0.5)
- local Pos=cf(shotgun.Parent.Position,Player:GetMouse().Hit.p).lookVector
- wait(.5)
- local hit,pos = rayCast(shotgun.Parent.Position,Pos,999,Character)
- local mag=(shotgun.Parent.Position-pos).magnitude
- MagicCircle(BrickColor.new("Neon orange"),cf(pos),15,15,15,8,8,8,0.02)
- MagicBlock(BrickColor.new("White"),cf(pos),15,15,15,8,8,8,0.02)
- MagicCylinder(BrickColor.new("White"),CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
- for i=1,2 do
- MagicRing(BrickColor.new("Neon orange"),cf(pos)*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),3,3,3,1,1,1,0.04)
- end
- for i=1,5 do
- local tehcf=CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
- MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
- end
- for i=0,5 do
- local tehcf=CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(-mag/5)*(i/2),0)
- MagicRing(BrickColor.new("Neon orange"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
- end
- local ref=part(3,workspace,"Neon",0,1,BrickColor.new("Really black"),"Effect",vt())
- ref.CFrame=cf(pos)
- so("http://roblox.com/asset/?id=203691378",Torso,3,0.6)
- so("http://roblox.com/asset/?id=169445602",Torso,3,0.6)
- so("http://www.roblox.com/Asset?ID=203691282",Torso,3,.7)
- coroutine.resume(coroutine.create(function(Part)
- Part.Parent=nil
- end),ref)
- if hit~=nil then
- MagnitudeDamage(ref, 40, 100, 200, BrickColor.new("Dark stone grey"), BrickColor.new("Navy blue") , "rbxassetid://199149297")
- attack = false
- end
- end
- mouse.KeyDown:connect(function(k)
- k = k:lower()
- if k == "e" and attack==false and overload==false then
- Spreadgun()
- end
- if k == "q" and attack==false and overload==true then
- lazershell()
- end
- if k == "f" and attack==false and overload==false then
- Overload()
- end
- if k == "g" and attack==false and overload==true then
- Normal()
- end
- if k == "z" and attack==false and overload==true then
- Spreadgun2()
- end
- if k == "LeftShift" and attack==false then
- Humanoid.WalkSpeed=(32)
- end
- end)
- function swait(num)
- if num==0 or num==nil then
- game:service'RunService'.Heartbeat:wait(0)
- else
- for i=0,num do
- game:service'RunService'.Heartbeat:wait(0)
- end
- end
- end
- function CreateSound(id, par, vol, pit)
- coroutine.resume(coroutine.create(function()
- local sou = Create("Sound"){
- Parent = par or workspace,
- Volume = vol,
- Pitch = pit or 1,
- SoundId = id,
- }
- wait()
- sou:play()
- end))
- end
- --[[
- function mosic()
- CreateSound("rbxassetid://1607713083", shotgun.Parent, 5, 1)
- end
- mosic()
- ]]--
- function LaserBarrage(Prt,Parent)
- --attack=true
- local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
- efprt.Anchored=true
- local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
- local spread=vt((math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7)*(Prt.Position-mouse.Hit.p).magnitude/40
- coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
- game:GetService("Debris"):AddItem(Part,6)
- local TheHit=mouse.Hit.p
- local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/16)
- local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
- --local pos=rayCast(P.Parent.Position,Player:GetMouse().Hit.p).lookVector
- local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
- tefprt.CFrame=cf(pos)
- MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
- game:GetService("Debris"):AddItem(tefprt,3)
- Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
- if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
- if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
- --hit.Parent.Humanoid:TakeDamage(1000)
- hit:BreakJoints()
- end
- end
- local mag=(Prt.Position-pos).magnitude
- --MagicCylinder(BrickColor.new("Dark blue"),CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
- --MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
- MagicCylinder(BrickColor.new("White"),Part.CFrame,1,mag*5,0.5,0.05,0,0.5,0.05)
- Part.Parent=nil
- end),efprt,efmsh,spread)
- end
- function Machinegun(Prt,Parent)
- --attack=true
- local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
- efprt.Anchored=true
- local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
- local spread=vt((math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7)*(Prt.Position-mouse.Hit.p).magnitude/40
- coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
- game:GetService("Debris"):AddItem(Part,6)
- local TheHit=mouse.Hit.p
- local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/17)
- local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
- --local pos=rayCast(P.Parent.Position,Player:GetMouse().Hit.p).lookVector
- local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
- tefprt.CFrame=cf(pos)
- MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.02)
- game:GetService("Debris"):AddItem(tefprt,3)
- Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
- if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
- if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
- hit.Parent.Humanoid:TakeDamage(1000)
- hit.Parent:Destroy()
- end
- end
- end),efprt,efmsh,spread)
- end
- function LaserBarrage2(Prt,Parent)
- --attack=true
- local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
- --efprt.Anchored=true
- local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
- local spread=vt((math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7)*(Prt.Position-mouse.Hit.p).magnitude/40
- coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
- game:GetService("Debris"):AddItem(Part,6)
- local TheHit=mouse.Hit.p
- local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/16)
- local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
- --local pos=rayCast(P.Parent.Position,Player:GetMouse().Hit.p).lookVector
- local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
- tefprt.CFrame=cf(pos)
- MagicCircle(BrickColor.new("Neon orange"),cf(pos),10.5,10.5,10.5,0.5,0.5,0.5,0.01)
- game:GetService("Debris"):AddItem(tefprt,3)
- Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
- if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
- if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
- hit.Parent.Humanoid:TakeDamage(1000)
- hit:Destroy()
- end
- end
- local mag=(Prt.Position-pos).magnitude
- --MagicCylinder(BrickColor.new("Dark blue"),CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
- --MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
- MagicCylinder(BrickColor.new("White"),Part.CFrame,1,mag*5,2.5,0.05,0,0.5,0.01)
- Part.Parent=nil
- end),efprt,efmsh,spread)
- 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
- swait()
- sou:play()
- game:GetService("Debris"):AddItem(sou,6)
- end))
- end
- function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
- prt.Anchored=true
- prt.CFrame=cframe
- msh=mesh("SpecialMesh",prt,"Head","",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
- Part.Transparency=i
- Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
- end
- Part.Parent=nil
- end),prt,msh)
- end
- function Overload()
- overload=true
- shotgun.Parent:Destroy()
- Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
- Partweld=weld(m,Part2,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(3,0,-0,-1,-1,-1,0,10,0,0,0,1))
- shotgun=mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/Asset/?id=2166741820",Vector3.new(0,0,0),Vector3.new(7.01, 7.01,7.01),CFrame.Angles(math.rad(360),math.rad(0),0))
- CreateSound("rbxassetid://170955412", shotgun.Parent, 5, 1)
- --[[
- local Pos=cf(shotgun.Parent.Position,Player:GetMouse().Hit.p).lookVector
- local hit,pos = rayCast(shotgun.Parent.Position,Pos,30,shotgun.Parent)
- local mag=(shotgun.Parent.Position-pos).magnitude
- for i=1,5 do
- local tehcf=CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
- MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
- local hit2,pos2 = rayCast(shotgun.Parent.Position,Pos,-30,shotgun.Parent)
- local tehcf2=CFrame.new((shotgun.Parent.Position+pos2)/2,pos2)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
- MagicRing(BrickColor.new("Really black"),tehcf2*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
- end
- ]]--
- for i=1,1 do
- local Pos=cf(shotgun.Parent.Position,Player:GetMouse().Hit.p).lookVector
- local hit,pos = rayCast(shotgun.Parent.Position,Pos,30,shotgun.Parent)
- local mag=(shotgun.Parent.Position-pos).magnitude
- local tehcf=CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
- MagicShotgun(BrickColor.new("Really black"),tehcf*euler(0.01,0,0),1,1,1,0.5,0.5,0.5,0.01)
- end
- local particleemitter = Instance.new("ParticleEmitter", shotgun.Parent)
- particleemitter.Texture = "http://www.roblox.com/asset/?id=321556991"
- particleemitter.ZOffset = Vector3.new(1,1,10)
- particleemitter.EmissionDirection = "Front"
- particleemitter.VelocitySpread = 10
- particleemitter.LockedToPart = true
- particleemitter.Lifetime = NumberRange.new(0.65)
- particleemitter.Speed = NumberRange.new(40)
- particleemitter.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 5.563)})
- particleemitter.RotSpeed = NumberRange.new(-180, 180)
- particleemitter.Rate = 180
- particleemitter.Rotation = NumberRange.new(-45, 45)
- particleemitter.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(0.701, 0), NumberSequenceKeypoint.new(1, 1)})
- particleemitter.LightEmission = 0
- particleemitter.Color = ColorSequence.new(Color3.new(0, 0, 0), Color3.new(0, 0, 0))
- end
- function Normal()
- overload=false
- shotgun.Parent:Destroy()
- Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
- Partweld=weld(m,Part2,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(3,0,-0,-1,-1,-1,0,10,0,0,0,1))
- shotgun=mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/Asset/?id=2166741820",Vector3.new(0,0,0),Vector3.new(2.01, 2.01,2.01))
- --CreateSound("rbxassetid://1607713083", shotgun.Parent, 5, 1)
- end
- --[[
- 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
- 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
- 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
- RW=Torso["Right Shoulder"]
- LW=Torso["Left Shoulder"]
- --RW.Name="Right Shoulder" LW.Name="Left Shoulder"
- RW.Name="Right Shoulder"
- RW.Part0=Character.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=Character["Right Arm"]
- RW.Parent=Character.Torso
- --
- LW.Name="Left Shoulder"
- LW.Part0=Character.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=Character["Left Arm"]
- LW.Parent=Character.Torso
- anim = Character.Humanoid:findFirstChild("Animate")
- if anim then
- anim:Destroy()
- end
- local sine = 0
- local change = 1
- local val = 0
- local mananum=0
- 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 Anim=="Idle" and attack==false then
- idle=idle+1
- else
- idle=0
- end
- if Humanoid.Health <=20 then
- if attack == false then
- Humanoid.Health = 500
- end
- end
- if RootPart.Velocity.y > 1 and hitfloor==nil then
- Anim="Jump"
- if attack==false then
- Neck.C0=clerp(Neck.C0,necko*euler(-0.2,0,0),.3)
- Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
- RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0),.3)
- RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.25,0,0.5),.3)
- RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
- LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.25,0,-0.5),.3)
- LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
- RH.C0=clerp(RH.C0,cf(1,0,-.75)*euler(-0.5,1.57,0)*euler(0,0,0),.2)
- LH.C0=clerp(LH.C0,cf(-1,-1,-.3)*euler(-0.5,-1.57,0)*euler(0,0,0),.2)
- end
- elseif RootPart.Velocity.y < -1 and hitfloor==nil then
- Anim="Fall"
- if attack==false then
- Neck.C0=clerp(Neck.C0,necko*euler(0.3,0,0),.3)
- Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
- RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*euler(0,0,0),.3)
- RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0.1,0,1),.3)
- RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
- LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0.1,0,-1),.3)
- LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0.6,1.57,0)*euler(0,0,0),.2)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.8,-1.57,0)*euler(0,0,0),.2)
- end
- elseif torvel<1 and hitfloor~=nil then
- Anim="Idle"
- change=0.5
- if idle>=100 then
- if attack==false then
- Humanoid.WalkSpeed=12
- RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,6-0.25*math.cos(sine/5))*angles(math.rad(0),math.rad(0),math.rad(10)),.1)
- Neck.C0=clerp(Neck.C0,necko*angles(math.rad(5+2*math.cos(sine/5.5)),math.rad(-5-2*math.cos(sine/5.5)),math.rad(-50)),.1)
- Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.1)
- RW.C0=clerp(RW.C0,cf(0.8,0.3,-0.5)*angles(math.rad(70),math.rad(0),math.rad(-85)),.5)
- LW.C0=clerp(LW.C0,cf(-0.6,0.5,-0.7)*angles(math.rad(70),math.rad(0),math.rad(85)),.5)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
- LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
- end
- else
- if attack==false then
- Humanoid.WalkSpeed=12
- RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(6),math.rad(0),math.rad(0)),.3)
- Neck.C0=clerp(Neck.C0,necko*angles(math.rad(3+3*math.cos(sine/36)),math.rad(0),math.rad(0)),.3)
- Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
- RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(10),math.rad(0),math.rad(16-6*math.cos(sine/28))),.3)
- LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(10),math.rad(0),math.rad(-16+6*math.cos(sine/28))),.3)
- RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(16)),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1.1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(24)),.3)
- end
- end
- elseif torvel>2 and torvel<22 and hitfloor~=nil then
- Anim="Walk"
- if attack==false then
- change=0.8
- RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0+0.1*math.cos(sine/2.5))*angles(math.rad(10+1*math.cos(sine/2.5)),math.rad(0),math.rad(1-5*math.cos(sine/5))),.3)
- Neck.C0=clerp(Neck.C0,necko*euler(0+0.075*math.cos(sine/2.5),0,0)*angles(math.rad(0),math.rad(0),math.rad(1+5*math.cos(sine/5))),.3)
- Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
- RW.C0=clerp(RW.C0,cf(1.4+0.25*math.cos(sine/5),0.5+0.25*math.cos(sine/5),-0.2+0.5*math.cos(sine/5))*angles(math.rad(20-60*math.cos(sine/5)),math.rad(0),math.rad(-4+30*math.cos(sine/5))),.3)
- LW.C0=clerp(LW.C0,cf(-1.4+0.25*math.cos(sine/5),0.5-0.25*math.cos(sine/5),-0.2-0.5*math.cos(sine/5))*angles(math.rad(20+60*math.cos(sine/5)),math.rad(0),math.rad(4+30*math.cos(sine/5))),.3)
- RH.C0=clerp(RH.C0,cf(1,-1-0.1*math.cos(sine/5),0-0.25*math.cos(sine/5))*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0+50*math.cos(sine/5))),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1+0.1*math.cos(sine/5),0+0.25*math.cos(sine/5))*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0+50*math.cos(sine/5))),.3)
- end
- elseif torvel>=22 and hitfloor~=nil then
- Anim="Run"
- change=1
- if attack==false then
- RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0+0.1*math.cos(sine/2.5))*angles(math.rad(20+1*math.cos(sine/2.5)),math.rad(0),math.rad(0)),.3)
- Neck.C0=clerp(Neck.C0,necko*euler(-0.2+0.075*math.cos(sine/2.5),0,0),.3)
- Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
- RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(-40),math.rad(0),math.rad(24)),.3)
- LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(-40),math.rad(0),math.rad(-24)),.3)
- RH.C0=clerp(RH.C0,cf(1,-1-0.1*math.cos(sine/5),0-0.5*math.cos(sine/5))*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(0+70*math.cos(sine/5))),.3)
- LH.C0=clerp(LH.C0,cf(-1,-1+0.1*math.cos(sine/5),0+0.5*math.cos(sine/5))*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(0+70*math.cos(sine/5))),.3)
- end
- end
- end
- end
- ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement