Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Created by Nebula_Zorua --
- -- 10mm pistol --
- -- was gonna have VATS --
- -- Discord: Nebula the Zorua#6969
- -- Youtube: https://www.youtube.com/channel/UCo9oU9dCw8jnuVLuy4_SATA
- local S = setmetatable({},{__index = function(s,i) return game:service(i) end})
- local plr = S.Players.LocalPlayer
- local char = plr.Character
- local hum = char.Humanoid
- local rarm = char["Right Arm"]
- local larm= char["Left Arm"]
- local rleg= char["Right Leg"]
- local lleg = char["Left Leg"]
- local root = char:FindFirstChild'HumanoidRootPart'
- local torso = char.Torso
- local head = char.Head
- local sine = 0;
- local combo = 1;
- local lastClick = time()
- local change = 1;
- local runService = S.RunService
- local mouse = plr:GetMouse()
- local Attack = false
- local AbuseMode = false
- local neutralAnims = true
- local PaintBody = nil
- local PlayerSize = 1
- local Debounces = {Debounces={}}
- local Hit = {}
- local BloodPuddles = {}
- local Teamed = {}
- local BloodColor = BrickColor.new'Maroon'
- local BloodMaterial = Enum.Material.Granite
- local FPS = false
- function Debounces:New(name,cooldown)
- local aaaaa = {Usable=true,Cooldown=cooldown or 2,CoolingDown=false,LastUse=0}
- setmetatable(aaaaa,{__index = Debounces})
- Debounces.Debounces[name] = aaaaa
- return aaaaa
- end
- function Debounces:Use(overrideUsable)
- assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use")
- if(self.Usable or overrideUsable)then
- self.Usable = false
- self.CoolingDown = true
- local LastUse = time()
- self.LastUse = LastUse
- delay(self.Cooldown or 2,function()
- if(self.LastUse == LastUse)then
- self.CoolingDown = false
- self.Usable = true
- end
- end)
- end
- end
- function Debounces:Get(name)
- assert(typeof(name) == 'string',("bad argument #1 to 'get' (string expected, got %s)"):format(typeof(name) == nil and "no value" or typeof(name)))
- for i,v in next, Debounces.Debounces do
- if(i == name)then
- return v;
- end
- end
- end
- function Debounces:GetProgressPercentage()
- assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use")
- if(self.CoolingDown and not self.Usable)then
- return math.max(
- math.floor(
- (
- (time()-self.LastUse)/self.Cooldown or 2
- )*100
- )
- )
- else
- return 100
- end
- end
- local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
- local V3 = {N=Vector3.new}
- local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge}
- local Effects,Sounds = {},{};
- --Stop animations
- for _,v in next, hum:GetPlayingAnimationTracks() do
- v:Stop();
- end
- pcall(game.Destroy,char:FindFirstChild'Animate')
- pcall(game.Destroy,hum:FindFirstChild'Animator')
- -- Sounds
- Sounds['Wet'] = {Id=256738023,Loop=false,Pitch=1}
- Sounds['Swoosh1'] = {Id=320557353,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh2'] = {Id=320557382,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh3'] = {Id=320557413,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh4'] = {Id=320557453,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh5'] = {Id=320557487,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh6'] = {Id=320557537,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh7'] = {Id=320557563,Loop=false,Pitch=1,Volume=6}
- Sounds['Swoosh8'] = {Id=320557518,Loop=false,Pitch=1,Volume=6}
- Sounds['SmallBoom'] = {Id=341336485,Loop=false,Volume=5,Pitch=1}
- Sounds['ChaosBuster'] = {Id=333534812,Loop=false,Volume=5,Pitch=0.75}
- Sounds['Magic'] = {Id=315743350,Loop=false,Volume=5,Pitch=1}
- Sounds['ShrekRemix'] = {Id=163306929,Loop=true,Pitch=1,Volume = 4}
- Sounds['CreoDimension'] = {Id=927529620,Loop=true,Pitch=1,Volume=4}
- Sounds['BlackBlizzard'] = {Id=657626121,Loop=true,Pitch=1,Volume=4}
- Sounds['ColbreakzFantasy'] = {Id=876981900,Loop=true,Pitch=1,Volume=4}
- Sounds['NeflCrystals'] = {Id=340106355,Loop=true,Pitch=1,Volume=4}
- Sounds['EvilMortyRemix'] = {Id=1057401232,Loop=true,Pitch=1,Volume=10}
- -- Functions
- local NewInstance = function(instance,parent,properties)
- local inst = Instance.new(instance,parent)
- if(properties)then
- for i,v in next, properties do
- pcall(function() inst[i] = v end)
- end
- end
- return inst;
- end
- ArtificialHB = NewInstance("BindableEvent", script,{
- Parent = script,
- Name = "Heartbeat",
- })
- script:WaitForChild("Heartbeat")
- frame = 1 / 60
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.Heartbeat:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.Heartbeat:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- function clerp(startCF,endCF,alpha)
- return startCF:lerp(endCF, alpha)
- end
- local sndFromData = function(data,parent)
- assert(typeof(data) == 'table',"sndFromData's first argument must be a table!")
- local snd = NewInstance("Sound",parent or char,{SoundId = "rbxassetid://"..data.Id,Looped=data.Loop or false,Pitch = data.Pitch or 1,Volume = data.Volume or 1})
- if(not snd.Looped)then
- snd.Ended:connect(function()
- snd:Stop()
- snd:destroy()
- end)
- end
- return snd;
- end
- local FX = function(ID,vol,pitch,parent)
- return coroutine.wrap(function()
- local snd = NewInstance("Sound",parent or torso, {Pitch=pitch or 1, Volume = vol or 1,SoundId = "rbxassetid://"..ID})
- snd:Play()
- delay(snd.TimeLength+2,function()
- snd:Stop()
- snd:Destroy()
- end)
- return snd
- end)()
- end
- function ClearChildrenWithClass(where,class,recursive)
- local children = (recursive and where:GetDescendants() or where:GetChildren())
- for _,v in next, children do
- if(v:IsA(class))then
- v:destroy()
- end
- end
- end
- function UnbindLoops()
- pcall(runService.UnbindFromRenderStep,runService,"N_Effects")
- pcall(runService.UnbindFromRenderStep,runService,"N_Animations")
- end;
- UnbindLoops() -- Just so if the loops already exist from previously running a script using this template, there's no errors
- -- Model
- New = function(Object, Parent, Name, Data)
- local Object = Instance.new(Object)
- for Index, Value in pairs(Data or {}) do
- Object[Index] = Value
- end
- Object.Parent = Parent
- Object.Name = Name
- return Object
- end
- TenMMPistol = New("Model",char,"10mmPistol",{})
- Handle = New("Part",TenMMPistol,"Handle",{Size = Vector3.new(2.75000048, 1.44999957, 0.660000503),CFrame = CFrame.new(-61.3750038, 1.77841592, 91.8999481, 1, 0, 0, 0, 1, 0, 0, 0, 1),BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,CanCollide=false,})
- Mesh = New("SpecialMesh",Handle,"Mesh",{Scale = Vector3.new(0.00999999978, 0.00999999978, 0.00999999978),MeshId = "rbxassetid://868963093",TextureId = "rbxassetid://868963099",MeshType = Enum.MeshType.FileMesh,})
- Part = New("Part",TenMMPistol,"Part",{Size = Vector3.new(0.730002046, 1.20999968, 0.22000052),CFrame = CFrame.new(-60.4236794, 1.56401443, 91.8717957, 0.996477664, -0.0838589668, 0, 0.0838589668, 0.996477664, 0, 0, 0, 1),CanCollide=false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
- Mesh = New("SpecialMesh",Part,"Mesh",{Scale = Vector3.new(0.0055999998, 0.00600000005, 0.00600000005),MeshId = "rbxassetid://868965101",TextureId = "rbxassetid://868965109",MeshType = Enum.MeshType.FileMesh,})
- MagMot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.996477664, 0.0838589668, 0, -0.0838589668, 0.996477664, 0, 0, 0, 1),C1 = CFrame.new(0.951324463, -0.214401484, -0.0281524658, 1, 0, 0, 0, 1, 0, 0, 0, 1),})
- -- Joints, etc
- if(PaintBody)then
- char['Body Colors'].LeftArmColor = BrickColor.new(PaintBody)
- char['Body Colors'].RightArmColor = BrickColor.new(PaintBody)
- char['Body Colors'].LeftLegColor = BrickColor.new(PaintBody)
- char['Body Colors'].RightLegColor = BrickColor.new(PaintBody)
- char['Body Colors'].TorsoColor = BrickColor.new(PaintBody)
- char['Body Colors'].HeadColor = BrickColor.new(PaintBody)
- end
- if(PlayerSize ~= 1)then
- for _,v in next, char:GetDescendants() do
- if(v:IsA'BasePart')then
- v.Size = v.Size * PlayerSize
- end
- end
- end
- local LS = NewInstance('Motor',char,{Part0=torso,Part1=larm,C0 = CF.N(-1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)})
- local RS = NewInstance('Motor',char,{Part0=torso,Part1=rarm,C0 = CF.N(1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)})
- local NK = NewInstance('Motor',char,{Part0=torso,Part1=head,C0 = CF.N(0,1.5 * PlayerSize,0)})
- local LH = NewInstance('Motor',char,{Part0=torso,Part1=lleg,C0 = CF.N(-.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)})
- local RH = NewInstance('Motor',char,{Part0=torso,Part1=rleg,C0 = CF.N(.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)})
- local RJ = NewInstance('Motor',char,{Part0=root,Part1=torso})
- local HW = NewInstance('Motor',char,{Part0=rarm,Part1=Handle,C0 = CF.N(0,-2,-.25)*CF.A(M.R(-90),M.R(-90),0)})
- -- watevr
- -- Default C0s
- local LSD=LS.C0
- local RSD=RS.C0
- local HD=NK.C0
- local TD=RJ.C0
- local LHD=LH.C0
- local RHD=RH.C0
- -- Check State
- function CheckState(rPart)
- if(rPart.Velocity.y > .35 and hum:GetState() == Enum.HumanoidStateType.Freefall)then
- return 'Jump';
- elseif(rPart.Velocity.y < -.35 and hum:GetState() == Enum.HumanoidStateType.Freefall)then
- return 'Fall';
- elseif(math.abs(rPart.Velocity.x) > 2 or math.abs(rPart.Velocity.z) > 2 and hum:GetState() ~= Enum.HumanoidStateType.Freefall)then
- return 'Walk';
- end
- return 'Idle';
- end
- -- Effect Functions
- function SphereFX(duration,color,scale,pos,endScale)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = color
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1,1,1)
- rng.Transparency = 0
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = pos
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshType = "Sphere"
- rngm.Scale = scale
- table.insert(Effects, {Frame = 0, Effect="Sphere", Duration = duration or 30, Part=rng, Mesh = rngm, Scale = scale, EndScale = endScale or scale*2, Position = pos})
- return rng
- end
- function BlastFX(duration,color,scale,pos,endScale)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = color
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1,1,1)
- rng.Transparency = 0
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = pos
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshType = "FileMesh"
- rngm.MeshId = 'rbxassetid://20329976'
- rngm.Scale = scale
- table.insert(Effects, {Frame = 0, Effect="Sphere", Duration = duration or 30, Part=rng, Mesh = rngm, Scale = scale, EndScale = endScale or scale*2, Position = pos})
- return rng
- end
- function BlockFX(duration,color,scale,pos,endScale)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = color
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1,1,1)
- rng.Transparency = 0
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = pos
- local rngm = Instance.new("BlockMesh", rng)
- rngm.Scale = scale
- table.insert(Effects, {Frame = 0, Effect="Block", Duration = duration or 30, Part=rng, Mesh = rngm, Scale = scale, EndScale = endScale or scale*2, Position = pos})
- return rng
- end
- function BloodDrop(pos,dir,maxsize)
- local owo = NewInstance("Part",char,{Material=BloodMaterial,BrickColor=BloodColor,Shape=Enum.PartType.Ball,Size=V3.N(.25,.25,.25), CanCollide = false})
- owo.CFrame=CF.N(pos,dir)
- local bv = Instance.new("BodyVelocity",owo)
- bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
- bv.velocity = CF.N(pos,dir+V3.N(M.RNG(-3,3)/30,M.RNG(-3,3)/30,M.RNG(-3,3)/30)).lookVector*15
- bv.Name = "MOVE"
- game:service'Debris':AddItem(bv,0.05)
- local touch
- touch = owo.Touched:connect(function(hit)
- if(hit.Anchored==true and hit.CanCollide and not hit.Parent:FindFirstChildOfClass'Humanoid')then
- touch:disconnect()
- BloodPuddle(owo.Position+V3.N(0,1,0),10,maxsize,owo)
- owo:destroy()
- end
- end)
- end
- function BloodPuddle(position,range,maxSize,where)
- local hit, pos, norm = workspace:FindPartOnRayWithIgnoreList(Ray.new(
- position,CF.N(position,position+V3.N(0,-1,0)).lookVector * range
- ),{where,char},false,true)
- if(hit)then
- if(BloodPuddles[hit])then
- BloodPuddles[hit].Frame = 0
- if(hit:FindFirstChild'CylinderMesh' and hit.CylinderMesh.Scale.Z < BloodPuddles[hit].MaxSize)then
- hit.CylinderMesh.Scale = hit.CylinderMesh.Scale + V3.N(.1,0,.1)
- end
- else
- local Puddle = NewInstance('Part',workspace,{Material=BloodMaterial,BrickColor=BloodColor,Size=V3.N(1,.1,1),CFrame=CF.N(pos,pos+norm)*CF.A(90*M.P/180,0,0),Anchored=true,CanCollide=false,Archivable=false,Locked=true,Name='BloodPuddle'})
- local Cyl = NewInstance('CylinderMesh',Puddle,{Name='CylinderMesh'})
- BloodPuddles[Puddle] = {MaxSize=maxSize or 7,Frame=0}
- end
- end
- end
- function LaserFX(duration,color,cframe,scale,endScale)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = color
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Material = Enum.Material.Neon
- rng.Name = "Laser"
- rng.Size = Vector3.new(.5,.5,.5)
- rng.Transparency = 0
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = cframe
- local rngm = Instance.new("CylinderMesh", rng)
- rngm.Scale = scale
- table.insert(Effects, {Frame = 0, Effect="Sphere", Duration = duration or 30, Part=rng, Mesh = rngm, Scale = scale, EndScale = endScale or scale*2, Position = cframe})
- return rng
- end
- function ShatterFX(duration,color,scale,cframe)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = color
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1,1,1)
- rng.Transparency = 0
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = cframe * CF.fEA(M.RNG(-50, 50), M.RNG(-50, 50), M.RNG(-50, 50))
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.Scale = scale
- rngm.MeshType = "Sphere"
- table.insert(Effects, {Frame = 0, Effect="Shatter", Duration = duration or 30, Part=rng, Mesh = rngm, Scale = scale,Position=rng.CFrame})
- end
- function RingFX(duration,color,scale,pos,endScale)
- local type = type
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = color
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1,1,1)
- rng.Transparency = 0
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = pos
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshId = "rbxassetid://3270017"
- rngm.Scale = scale
- table.insert(Effects, {Frame = 0, Effect="Sphere", Duration = duration or 30, Part=rng, Mesh = rngm, Scale = scale, EndScale = endScale or scale*2, Position = pos})
- return rng
- end
- function Shoot(StartCF,EndCF,Spread,Speed,Num,Color,Drop,MinDamage,MaxDamage,HeadshotMult,size)
- local Spread = V3.N(M.RNG(-Spread,Spread),M.RNG(-Spread,Spread),M.RNG(-Spread,Spread))
- local Start = StartCF.p
- local End = EndCF.p
- local SpreadPos = End + Spread
- local Look = CF.N((Start + SpreadPos) / 2, SpreadPos)
- local Count = Num
- spawn(function()
- repeat
- wait()
- local hit, pos = workspace:findPartOnRay(Ray.new(
- Start,(Look.lookVector).unit * Speed
- ),char,false,true)
- local dist = (Start-pos).magnitude
- local yScale = dist * (Speed / (Speed/2))
- local aa = CF.N((Start + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0)
- LaserFX(25,Color,aa,size + Vector3.new(0,yScale,0),Vector3.new(-size.x,yScale,-size.z))
- Start = Start + Look.lookVector * Speed
- Look = Look * CF.A(M.R(Drop or -1),0,0)
- Count = Count - 1
- if(hit)then
- Count = 0
- if(hit.Parent:FindFirstChildOfClass'Humanoid')then
- if(hit.Name == 'Head' or AbuseMode)then
- DealDamage(hit.Parent,MinDamage * (HeadshotMult or 1),MaxDamage * (HeadshotMult or 1),0,'Normal')
- if(hit.Parent:FindFirstChildOfClass'Humanoid'.Health <= 0 or AbuseMode)then
- hit.Parent:breakJoints()
- FX(429400881,1,1,hit).PlayOnRemove = true
- hit:destroy()
- for i = 1, 15 do
- local spread = V3.N(M.RNG(-85,85),M.RNG(-85,85),M.RNG(-85,85))
- BloodDrop(pos,pos+spread,10)
- end
- end
- else
- --MagniDamage(pos,10,MinDamage,MaxDamage,0,'Normal')
- DealDamage(hit.Parent,MinDamage,MaxDamage,0,'Normal')
- end
- end
- end
- if(Count <= 0)then
- BlockFX(30,Color,size,CF.N(pos),V3.N(0,0,0))
- end
- until Count <= 0
- end)
- end
- -- Effect Loop
- runService:BindToRenderStep("N_Effects",Enum.RenderPriority.Character.Value + 2,function()
- for _,data in next, Effects do
- local frame,effect,duration = data.Frame,data.Effect,data.Duration
- local transparency = (frame / duration)
- local opacity = 1 - transparency
- if(frame > duration)then
- Effects[_] = nil
- end
- frame = frame + 1
- data.Frame = frame
- if(effect == 'Sphere')then
- local Part,Mesh,Scale,CF,eScale = data.Part,data.Mesh,data.Scale,data.Position,data.EndScale
- Mesh.Scale = Mesh.Scale:lerp(eScale, transparency/6)
- Part.Transparency = transparency
- if(frame > duration)then
- Part:destroy()
- end
- elseif(effect == 'Shatter')then
- local Part,Mesh,Scale,Position,Thingie,Thingie2,Inc = data.Part,
- data.Mesh,
- data.Scale,
- data.Position,
- (data.Thingie or 0),
- (data.Thingie2 or M.RNG(50, 100) / 100),
- (data.Inc or M.RNG() - M.RNG())
- Part.Transparency = transparency
- Position = Position * CF.N(0,Thingie2,0)
- Part.CFrame = Position * CF.fEA(Thingie,0,0)
- Thingie = Thingie + Inc
- data.Position = Position
- data.Thingie = Thingie
- data.Thingie2 = Thingie2
- data.Inc = Inc
- elseif(effect == 'Block')then
- local Part,Mesh,Scale,CF,eScale = data.Part,data.Mesh,data.Scale,data.Position,data.EndScale
- Mesh.Scale = Mesh.Scale:lerp(eScale, transparency/6)
- Part.Transparency = transparency
- Part.CFrame = CF * CFrame.Angles(M.R(M.RNG(-360,360)),M.R(M.RNG(-360,360)),M.R(M.RNG(-360,360)))
- if(frame > duration)then
- Part:destroy()
- end
- end
- end
- for puddle,data in next, BloodPuddles do
- if(puddle.Transparency > 0.9)then
- BloodPuddles[puddle] = nil
- puddle:destroy()
- end
- data.Frame = data.Frame + 1
- if(data.Frame > 105)then
- local trans = (data.Frame-105)/90
- puddle.Transparency = trans
- if(puddle:FindFirstChild'CylinderMesh' and puddle.CylinderMesh.Scale.Z > 0)then
- puddle.CylinderMesh.Scale = puddle.CylinderMesh.Scale-V3.N(.1,0,.1)
- end
- else
- puddle.Transparency = 0
- end
- end
- end)
- print("This script is best experienced with Shift Lock")
- print("Press F to switch between first and third person (not finished yet)")
- -- Animation Loop
- runService:BindToRenderStep("N_Animations",Enum.RenderPriority.Character.Value + 1,function()
- sine=sine+change
- local wsVal = 5 / (hum.WalkSpeed / 16)
- local exactVel = CFrame.new(root.CFrame:vectorToObjectSpace(root.Velocity))
- local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(root.CFrame.p,((CFrame.new(root.Position,root.Position - Vector3.new(0,1,0))).lookVector).unit * 4), char)
- local State = (not hitfloor and root.Velocity.y < -1 and "Fall" or not hitfloor and root.Velocity.y > 1 and "Jump" or hitfloor and (math.abs(root.Velocity.x) > 1 or math.abs(root.Velocity.z) > 1) and "Walk" or hitfloor and "Idle")
- -- game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Torso.Position,Vector3.new(mouse.Hit.p.x,game.Players.LocalPlayer.Character.Torso.Position.y,mouse.Hit.p.z))
- if(State == 'Walk')then
- change = 2/3
- --CF.N(0,1 * PlayerSize,0)
- RH.C1 = RH.C1:lerp(CF.N(0,.985+.4*M.C(sine/wsVal),-.1*M.S(sine/9)* M.R(exactVel.z) )*CF.A(M.S(sine/wsVal)*-M.R(exactVel.z)*1.5,0,-M.S(sine/wsVal)*-M.R(exactVel.x)),.2)
- LH.C1 = LH.C1:lerp(CF.N(0,.985-.4*M.C(sine/wsVal),.1*-M.S(sine/9)* -M.R(exactVel.z) )*CF.A(-M.S(sine/wsVal)*-M.R(exactVel.z)*1.5,0,M.S(sine/wsVal)*-M.R(exactVel.x)),.2)
- else
- RH.C1 = RH.C1:lerp(CF.N(0,1,0),.2)
- LH.C1 = LH.C1:lerp(CF.N(0,1,0),.2)
- end
- LS.C1 = CF.N(0,.5,0) * CF.fEA(-math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
- RS.C1 = CF.N(0,.5,0) * CF.fEA(-math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
- NK.C1 = CF.fEA(-math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
- if(neutralAnims)then
- if(State == 'Idle')then
- -- Idle anim
- RJ.C0 = RJ.C0:lerp(CF.N(),.1)
- LS.C0 = LS.C0:lerp(LSD*CF.N(1.2,0,-.5)*CF.A(M.R(90),0,M.R(65)),.1)
- RS.C0 = RS.C0:lerp(RSD*CF.N(0,0,.25)*CF.A(M.R(90),0,0),.1)
- RH.C0 = RH.C0:lerp(RHD,.1)
- LH.C0 = LH.C0:lerp(LHD,.1)
- NK.C0 = NK.C0:lerp(HD,.1)
- elseif(State == 'Walk')then
- -- Walk anim
- RJ.C0 = RJ.C0:lerp(CF.A(0,0+.2*M.S(sine/wsVal),0)*CF.N(0,0+.2*M.S(sine/(wsVal/2)),0),.1)
- LS.C0 = LS.C0:lerp(LSD*CF.N(1.2,0,-.5)*CF.A(M.R(90),0,M.R(65)),.1)
- RS.C0 = RS.C0:lerp(RSD*CF.N(0,0,.25)*CF.A(M.R(90),0,0),.1)
- RH.C0 = RH.C0:lerp(RHD,.1)
- LH.C0 = LH.C0:lerp(LHD,.1)
- NK.C0 = NK.C0:lerp(HD,.1)
- elseif(State == 'Jump')then
- RJ.C0 = RJ.C0:lerp(CF.N(),.1)
- LS.C0 = LS.C0:lerp(LSD*CF.A(M.R(25),0,M.R(-25)),.1)
- RS.C0 = RS.C0:lerp(RSD*CF.A(M.R(65),0,M.R(-35)),.1)
- LH.C0 = LH.C0:lerp(LHD*CF.A(M.R(-25),0,0),.1)
- RH.C0 = RH.C0:lerp(RHD*CF.A(M.R(-25),0,0),.1)
- NK.C0 = NK.C0:lerp(HD,.1)
- elseif(State == 'Fall')then
- RJ.C0 = RJ.C0:lerp(CF.N(),.1)
- LS.C0 = LS.C0:lerp(LSD*CF.A(M.R(-25),0,M.R(-25)),.1)
- RS.C0 = RS.C0:lerp(RSD*CF.A(M.R(65),M.R(45),M.R(-35)),.1)
- LH.C0 = LH.C0:lerp(LHD*CF.A(M.R(25),0,M.R(0)),.1)
- RH.C0 = RH.C0:lerp(RHD*CF.A(M.R(25),0,M.R(0)),.1)
- NK.C0 = NK.C0:lerp(HD,.1)
- end
- end
- end)
- -- Died event
- hum.Died:connect(function() -- When the player dies
- UnbindLoops() -- Unbind all of the loops used
- end)
- -- Everything else
- function getMouseDir()
- return {CF.N(root.Position, Vector3.new(mouse.Hit.p.x,root.Position.y,mouse.Hit.p.z))}
- end
- function getDirection()
- local Cam = workspace.CurrentCamera
- return {
- CFrame.new(root.Position, Vector3.new(Cam.CoordinateFrame.x, root.Position.y, Cam.CoordinateFrame.z)) * CFrame.fromEulerAnglesXYZ(0, math.pi, 0),
- Vector3.new(Cam.CoordinateFrame.p.x, root.CFrame.p.y, Cam.CoordinateFrame.p.z)
- }
- end
- function FaceMouse()
- root.CFrame = root.CFrame:lerp(getMouseDir()[1],.1)
- end
- function GetTorso(char)
- return char:FindFirstChild'Torso' or char:FindFirstChild'UpperTorso' or char:FindFirstChild'LowerTorso' or char:FindFirstChild'HumanoidRootPart'
- end
- function DealDamage(who,minDam,maxDam,Knock,Type)
- if(who)then
- local hum = who:FindFirstChildOfClass'Humanoid'
- local Damage = M.RNG(minDam,maxDam)
- local canHit = true
- if(hum)then
- for _, p in pairs(Hit) do
- if p[1] == hum then
- if(time() - p[2] < 0.1) then
- canHit = false
- else
- Hit[_] = nil
- end
- end
- end
- if(canHit)then
- if(hum.Health >= math.huge)then
- who:BreakJoints()
- else
- local player = S.Players:GetPlayerFromCharacter(who)
- if(not player or not Teamed[player])then
- if(Type == "Fire")then
- --idk..
- else
- local c = Instance.new("ObjectValue",hum)
- c.Name = "creator"
- c.Value = plr
- game:service'Debris':AddItem(c,0.35)
- hum.Health = hum.Health - Damage
- if(Type == 'Knockback' and GetTorso(who))then
- local angle = GetTorso(who).Position - root.Position + Vector3.new(0, 0, 0).unit
- local body = NewInstance('BodyVelocity',GetTorso(who),{
- P = 500,
- maxForce = V3.N(math.huge,0,math.huge),
- velocity = root.CFrame.lookVector * Knock + root.Velocity / 1.05
- })
- game:service'Debris':AddItem(body,.5)
- elseif(Type == 'Knockdown' and GetTorso(who))then
- local rek = GetTorso(who)
- print(rek)
- hum.PlatformStand = true
- delay(1,function()
- hum.PlatformStand = false
- end)
- local angle = (GetTorso(who).Position - (root.Position + Vector3.new(0, 0, 0))).unit
- local bodvol = NewInstance("BodyVelocity",rek,{
- velocity = angle * Knock,
- P = 5000,
- maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
- })
- local rl = NewInstance("BodyAngularVelocity",rek,{
- P = 3000,
- maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
- angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
- })
- game:GetService("Debris"):AddItem(bodvol, .5)
- game:GetService("Debris"):AddItem(rl, .5)
- end
- end
- end
- end
- table.insert(Hit,{hum,time()})
- end
- end
- end
- end
- function MagniDamage(pos,radius,mindamage,maxdamage,knockback,damagetype)
- local Recursive
- Recursive = function(whom)
- for _,c in next, whom:children() do
- local hum = c:FindFirstChildOfClass'Humanoid'
- local hed = c:FindFirstChild'Torso' or c:FindFirstChild'UpperTorso' or c:FindFirstChild'LowerTorso'
- if(hum and hed)then
- local mag = (hed.CFrame.p - pos).magnitude
- if(mag <= radius and c ~= char)then
- DealDamage(c,mindamage,maxdamage,knockback,damagetype)
- end
- end
- Recursive(c)
- end
- end
- Recursive(workspace)
- end
- function MagniHeal(pos,radius,heal,needsTeamed)
- for _,v in next, workspace:GetDescendants() do
- local player = S.Players:GetPlayerFromCharacter(v)
- local hum = v:FindFirstChildOfClass'Humanoid'
- if(hum and v:IsA'Model')then
- if(not needsTeamed or player and (not plr.Neutral and player.TeamColor == plr.TeamColor))then
- local pp = v.PrimaryPart or v:FindFirstChild'Torso' or v:FindFirstChild'UpperTorso' or v:FindFirstChild'LowerTorso'
- if(pp and (pp.CFrame.p-pos).magnitude <= radius)then
- hum.Health = hum.Health + heal
- end
- end
- end
- end
- end
- Debounces:New('how2use',1) -- name, cooldown
- function TestDebounce()
- if(Debounces:Get('how2use').Usable)then
- -- code
- Debounces:Get('how2use'):Use() -- use it up
- end
- end
- function ClickCombo()
- Attack = true
- neutralAnims = false
- if(combo == 1)then
- -- combo 1
- combo = 2
- elseif(combo == 2)then
- -- combo 2
- -- etc, etc
- combo = 1
- end
- lastClick = time()
- neutralAnims = true
- Attack = false
- end
- function FireGun()
- --Shoot(rarm.CFrame * CFrame.new(0,-1.5,0),mouse.Hit,0,500,30,BrickColor.new(ModeColor),-1,15,30)
- --BlockFX(duration,color,scale,pos,endScale)
- local origin =Handle.CFrame*CF.N(-1.5,.5,0)
- FX(149915226,3,1,Handle)
- BlockFX(15,BrickColor.new'Bright yellow',V3.N(.5,.5,.5),origin,V3.N(0,0,0))
- BlockFX(15,BrickColor.new'Deep orange',V3.N(.5,.5,.5),origin,V3.N(0,0,0))
- Shoot(origin,mouse.Hit,0,50,250,BrickColor.new'New Yeller',-1,15,30,2,V3.N(.35,.35,.35))
- end
- mouse.Button1Down:connect(function()
- if(Attack)then return end
- FireGun()
- end)
- mouse.KeyDown:connect(function(k)
- if(Attack)then return end
- if(k == ';')then
- AbuseMode = not AbuseMode
- print("Abuse mode is ".. (AbuseMode == true and "on" or "off"))
- elseif(k == 'f')then -- never finished
- FPS = not FPS
- end
- end)
- runService.RenderStepped:connect(function()
- if(not Attack and combo ~= 1 and time()-lastClick > 0.4)then
- combo = 1
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement