Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --turdulator
- --Because the soul gun failed so bad.
- Tool=script.Parent;
- Gun=Tool;
- FakeS=Instance.new("Motor")
- FakeS.Name="Right Shoulder"
- FakeSL=Instance.new("Motor")
- FakeSL.Name="Left Shoulder"
- Stance="Standing"
- Amp=.1
- freq=1
- ST=false
- cAnim=true
- canshoot=true
- MainshotId="http://www.roblox.com/asset/?id=54236529"
- Velocity,Arc,MaxDist,BaseDmg,Size,MaxTime=150,0,5,20,2,2
- doSound=function(sound,decay,origin,volume)
- if Source==nil then --formatting for other objects.
- Source=script.Parent
- end
- sc=Source.LocalSoundScript:clone()
- sc.DecayFactor.Value=decay
- sc.Origin.Value=origin
- sc.Volume.Value=volume
- sc.Disabled=false
- for j_,v_ in pairs(game.Workspace:children()) do
- if v_.className=="Model" and v_:FindFirstChild("Humanoid")~=nil and game.Players:GetPlayerFromCharacter(v_)~=nil then
- if v_~=Tool.Parent then
- sc.Sound.Value=sound
- sc:clone().Parent=v_
- end
- end
- end
- end
- _G["ShowDamage"]=function(Char,Dealt,Du)
- for _,vvv in pairs(game.Players:children()) do
- if vvv:FindFirstChild("PlayerGui")~=nil then
- m=Instance.new("BillboardGui")
- m.Size=UDim2.new(1,0,1,0)
- m.Adornee=Char:FindFirstChild("Head")
- m.Name="DamageIndicator"
- f=Instance.new("TextLabel")
- f.Name="LABEL"
- f.TextColor3=Color3.new(3,5,9)
- f.Text="-"..Dealt
- f.FontSize=6
- f.Parent=m
- m.Parent=vvv.PlayerGui
- game:GetService("Debris"):AddItem(m,3)
- coroutine.resume(coroutine.create(function(p,o) for i=1, 10 do p.StudsOffset=p.StudsOffset+Vector3.new(0,i*.05,0)+o/100 wait() end for i=1, 25 do p.StudsOffset=p.StudsOffset-Vector3.new(0,i*.035,0)+o/100 wait() end p.Parent=nil end),m,Vector3.new(math.random(-50,50),0,math.random(-50,50)))
- end
- end
- end
- ShowDamage=function(Char,Dealt,Du)
- for _,vvv in pairs(game.Players:children()) do
- if vvv:FindFirstChild("PlayerGui")~=nil then
- m=Instance.new("BillboardGui")
- m.Size=UDim2.new(1,0,1,0)
- m.Adornee=Char:FindFirstChild("Head")
- m.Name="DamageIndicator"
- f=Instance.new("TextLabel")
- f.Name="LABEL"
- f.TextColor3=Color3.new(3,5,9)
- f.Text="-"..Dealt
- f.FontSize=6
- f.Parent=m
- m.Parent=vvv.PlayerGui
- game:GetService("Debris"):AddItem(m,3)
- coroutine.resume(coroutine.create(function(p,o) for i=1, 10 do p.StudsOffset=p.StudsOffset+Vector3.new(0,i*.05,0)+o/100 wait() end for i=1, 25 do p.StudsOffset=p.StudsOffset-Vector3.new(0,i*.035,0)+o/100 wait() end p.Parent=nil end),m,Vector3.new(math.random(-50,50),0,math.random(-50,50)))
- end
- end
- end
- _G["critEffect"]=function(Part)
- he=Part.Parent:FindFirstChild("Head")
- if he~=nil then Part=he end
- b=Instance.new("BillboardGui")
- b.Name="CUH-RIT"
- b.Size=UDim2.new(1,0,1,0)
- b.Adornee=Part
- b.StudsOffset=Vector3.new(math.random(-3,3)/3,1.75+math.random(0,5)/12.5,math.random(-3,3)/3)
- s=script.ImageLabel:clone()
- s.Parent=b
- s.Script.Disabled=false
- for _,v in pairs(game.Players:children()) do
- if v:FindFirstChild("PlayerGui")~=nil then
- n=b:clone()
- n.Parent=v.PlayerGui
- end
- end
- c=Instance.new("Sound")
- c.SoundId="http://roblox.com/asset/?id=10209481"
- c.Volume=.5
- c.Pitch=1.425
- c.Parent=Part
- c:Play()
- game:GetService("Debris"):AddItem(c,1)
- end
- _G["GetPlayerStats"]=function(Character) --Extracts and returns the player's stats.
- VP=game.Players:GetPlayerFromCharacter(Character)
- if VP==nil then --create a surrigate set of stats if the character is not a player.
- return script.Stats:clone()
- else
- STA=VP:FindFirstChild("Stats")
- if ST~=nil then
- return STA
- else
- print("ERROR 1: UNABLE TO RETRIEVE STATS.")
- return script.Stats:clone() --malfunction
- end
- end
- end
- _G["CalculateRealStats"]=function(Stats) --returns the real set of stats the game should use for calculations.
- reTab={}
- Attackv=Stats.Attack.Value+Stats.Changes.Attack.Value
- Defence=Stats.Defence.Value+Stats.Changes.Defence.Value
- Crit=Stats.Crit.Value+Stats.Changes.Crit.Value
- if Crit>100 then
- Crit=100
- elseif Crit<0 then
- Crit=0
- end
- WalkSpeed=Stats.WalkSpeed.Value+(Stats.WalkSpeed.Value*(Stats.Changes.WalkSpeed.Value*.01))
- mod=Instance.new("Model")
- mod.Name="Stats"
- Int=Instance.new("IntValue")
- Int.Name="Attack"
- Int.Value=Attackv
- Int.Parent=mod
- Int=Instance.new("IntValue")
- Int.Name="Defence"
- Int.Value=Defence
- Int.Parent=mod
- Int=Instance.new("IntValue")
- Int.Name="Crit"
- Int.Value=Crit
- Int.Parent=mod
- Int=Instance.new("IntValue")
- Int.Name="WalkSpeed"
- Int.Value=WalkSpeed
- Int.Parent=mod
- return mod
- end
- _G["DAMAGEMOD"]=function(Base,Effect,Relation) --Secondary filter which runs through abilities.
- --Example: Armour ability halves damage from shots that hit anything but your torso or head.
- --That would look like: (#,Multiply,.5)
- --[[
- Base: The damage sent through the first filter to this.
- Effect: The generic effect which will be applied to the Base
- Relation: Used when the Effect needs to reference another variable]]
- if Effect=="Nullify" then
- return 0 --nothing happens, triggers the effect.
- elseif Effect=="Multiply" then
- return Base*Relation
- end
- end
- _G["CalculateDamageDealt"]=function(StatsGiver,StatsTaker,vAbilities,BasePower,Attacker,Victim,ContactPart,aAbilities) --calculates and deals the damage.
- --Serves as a filter. Problem?
- if Victim.Health==0 then
- return 0
- end
- Restrictions={}
- RestrictionEnvironments={}
- RestrictionEffects={}
- RELATION={}
- TRIGLIST={}
- --The above are for ability related changes, not always a restriction
- for _,v in pairs(vAbilities) do
- if v=="Nihil" then
- if BasePower<=Victim.MaxHealth then
- table.insert(Restrictions,Victim.MaxHealth/2)
- table.insert(RestrictionEnvironments,"NoGreaterThan")
- table.insert(RestrictionEffects,"Nullify")
- table.insert(RELATION,0)
- end
- table.insert(Restrictions,5)
- table.insert(RestrictionEnvironments,"Randomize")
- table.insert(RestrictionEffects,"Nullify")
- table.insert(RELATION,0)
- elseif v=="Armor" then
- if ContactPart.Name~="Torso" and ContactPart.Name~="Head" then
- table.insert(Restrictions,.5)
- table.insert(RestrictionEnvironments,"Modify")
- table.insert(RestrictionEffects,"Multiply")
- table.insert(RELATION,.5)
- end
- elseif v=="Block" then
- table.insert(Restrictions,0)
- table.insert(RestrictionEnvironments,"Modify")
- table.insert(RestrictionEffects,"Multiply")
- table.insert(RELATION,0)
- if ContactPart.Parent:FindFirstChild("Handle")~=nil then
- ContactPart.Parent.Handle.Block:Play()
- end
- end
- end
- --[[RESTRICTION ENVIRONMENT LIST:
- NoGreaterThan
- RESTRICTION GENERIC MODIFIER LIST:
- Multiply X (OUT THROUGH RELATION)
- Nullify --cancel
- Reversal --restarts the entire process; switches victim and shooter.
- |_OUT THROUGH RELATION: 0: Calculates with the same methods 1: Reverses stats
- SendBack --Deals the damage back to the enemy, ignores effects that Reversal can cause.
- --]]
- TRIGGER=false --turns true if an ability activates
- Power1=StatsGiver.Attack.Value
- Defence1=StatsGiver.Defence.Value
- Power2=StatsTaker.Attack.Value
- Defence2=StatsTaker.Defence.Value
- cOut=Power1-Defence2
- cMod=BasePower*(cOut*.01)
- DMG=math.ceil(BasePower+cMod)
- --perform the tricky part, environments and other such things which make this VERY TRICKY.
- --The attacker takes priority over the victim, and requires little to no environments with calculation.
- for basepos,v in pairs(aAbilities) do
- if v=="Sharpshooter" then
- if ContactPart.Name=="Head" then
- DMG=_G["DAMAGEMOD"](DMG,"Multiply",1.5)
- end
- end
- end
- for basepos,Restriction in pairs(RestrictionEnvironments) do
- if Restriction=="NoGreaterThan" then
- if DMG>=Restrictions[basepos] then
- TRIGGER=true
- DMG=_G["DAMAGEMOD"](DMG,RestrictionEffects[basepos],RELATION[basepos])
- end
- elseif Restriction=="Modify" then --generic ability trip.
- TRIGGER=true
- DMG=_G["DAMAGEMOD"](DMG,RestrictionEffects[basepos],RELATION[basepos])
- elseif Restriction=="Randomize" then --randomly perform an effect, chance given with the variable.
- if math.random(1,Restrictions[basepos])==1 then
- DMG=_G["DAMAGEMOD"](DMG,RestrictionEffects[basepos],RELATION[basepos])
- end
- end
- end
- if StatsGiver.Crit.Value>0 then
- if math.random(1,100)<=StatsGiver.Crit.Value/2 then
- DMG=DMG*3
- print("Crit")
- _G["critEffect"](ContactPart)
- end
- end
- Damagev=math.ceil(DMG)
- return Damagev
- end
- ATTACKSTYLES={}
- DEFENCESTYLES={"Nihil","Armor"}
- _G["PerformDamage"]=function(A,V,HIT,BASE)
- Stat1=_G["GetPlayerStats"](A.Parent)
- Stat2=_G["GetPlayerStats"](V.Parent)
- RS1=_G["CalculateRealStats"](Stat1)
- RS2=_G["CalculateRealStats"](Stat2)
- ABSR=V.Parent.Abilities:children()
- ABS={}
- for _,v in pairs(ABSR) do
- if v.Value==true then
- table.insert(ABS,v.Name)
- end
- end
- ABSR1=A.Parent.Abilities:children()
- ABS1={}
- for _,v in pairs(ABSR1) do
- if v.Value==true then
- table.insert(ABS1,v.Name)
- end
- end
- dg=_G["CalculateDamageDealt"](RS1,RS2,ABS,BASE,A,V,HIT,ABS1)
- if dg<0 then
- dg=0
- end
- print(dg)
- V:TakeDamage(dg)
- return dg
- end
- Cost=6
- DPB=25
- MAXDIST=125
- Falloff=MAXDIST / 10
- Damage=function(hit,Bonus,Influence,Trip,B)
- if hit.Parent==nil then
- return
- end
- h=hit.Parent:FindFirstChild("Humanoid")
- if h~=nil and hit.Parent:FindFirstChild("Torso")~=nil then
- vP=game.Players:GetPlayerFromCharacter(hit.Parent)
- if vP==game.Players:GetPlayerFromCharacter(Tool.Parent) then
- return
- end
- t=Instance.new("ObjectValue")
- t.Value=game.Players:GetPlayerFromCharacter(Tool.Parent)
- t.Name="creator"
- t.Parent=h
- game:GetService("Debris"):AddItem(t,.5)
- OFF=((Tool.Handle.Position-B.Position).magnitude+1)/Falloff
- print(OFF)
- Dmg=math.floor(DPB-OFF)+1
- if Dmg<1 then
- Dmg=1
- end
- if hit.Parent.Name=="Gate" then
- Dmg=Dmg/5
- end
- h:TakeDamage(Dmg)
- ShowDamage(hit.Parent,Dmg,.5)
- if Trip==true then
- r=Instance.new("BodyAngularVelocity")
- r.P=5000
- r.maxTorque=Vector3.new(50000,50000,50000)*5000000000000000000000
- r.angularvelocity=Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
- r.Parent=hit.Parent.Torso
- game:GetService("Debris"):AddItem(r,.3)
- end
- end
- end
- Bink=3
- Power=5
- ComputeData=function(Location)
- Start=Tool.Handle22.CFrame*CFrame.new(0,0,-.1)
- BinkOffset=Vector3.new(math.random(-3,3),math.random(-3,3)/3,math.random(-3,3))*(Bink)
- Location=Start.p+(Location-Start.p).unit*400
- End=CFrame.new(Location+BinkOffset)
- Final=CFrame.new(Start.p,End.p)*CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)
- return {Final*CFrame.new(0,-6,0),CFrame.new(Start.p,End.p).lookVector*(50)}
- end
- bFunc=function(Bul,FSpeed,Destin,Startp,Off)
- while Bul.Flying.Value==true and Bul.FlyV.Value<100 do
- Destin=Destin+Off
- Bul.CFrame=CFrame.new(Startp.p:Lerp(Destin.p,Bul.FlyV.Value/100),Destin.p+(Destin.p-Startp.p).unit*5)*CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)
- Bul.FlyV.Value=Bul.FlyV.Value+MAXDIST/FSpeed
- r=Ray.new(Bul.Position-(Destin.p-Startp.p).unit*9,(Destin.p-Startp.p).unit*9)
- par,loc=workspace:FindPartOnRay(r,Tool.Parent)
- if par~=nil then
- if par.Parent~=nil then
- print("c1")
- print(par)
- if par.Parent:FindFirstChild("Humanoid")~=nil then
- print("c2")
- Damage(par,0,Vector3.new(0,0,0),false,Bul)
- end
- end
- Bul.Flying.Value=false
- break end
- if isspec==false then
- t=Bul:clone()
- t.Sparkles:Remove()
- t.CFrame=t.CFrame*CFrame.new(0,0,0)
- t.FlyV:Remove()
- t.Mesh.Scale=Vector3.new(.8,15,.8)
- t.Transparency=0
- t.Reflectance=0.25
- t.Flying:Remove()
- s=script.Trail:clone()
- s.Disabled=false
- s.Parent=t
- t.Parent=Tool
- else
- t=Bul:clone()
- t.Sparkles:Remove()
- t.CFrame=t.CFrame*CFrame.new(0,0,0)
- t.FlyV:Remove()
- t.Mesh.Scale=Vector3.new(.5,11,.5)
- t.Transparency=0
- t.Reflectance=0
- t.Flying:Remove()
- s=script.LTrail:clone()
- s.Disabled=false
- s.Parent=t
- t.Parent=Tool
- end
- wait()
- end
- Bullet=Instance.new("Part")
- Bullet.Name="Ex"
- Bullet.formFactor="Custom"
- Bullet.TopSurface="Smooth"
- Bullet.BottomSurface="Smooth"
- Bullet.Size=Vector3.new(.2,.2,.2)
- Bullet.Reflectance=0.25
- Bullet.Transparency=0
- Bullet.Color=Bul.Color
- Bullet.CFrame=Bul.CFrame
- Bullet.CanCollide=false
- Bullet.Anchored=true
- Bullet.Parent=Tool
- game:GetService("Debris"):AddItem(Bullet,3)
- m=Instance.new("SpecialMesh")
- m.MeshType="Sphere"
- m.Parent=Bullet
- for i=1, 5 do
- s=Tool.Handle.Sparkles:clone()
- s.Enabled=true
- s.Parent=Bullet
- end
- coroutine.resume(coroutine.create(function(n,c) for i=1, 5 do n.Size=n.Size+Vector3.new(.35,.35,.35) n.CFrame=c wait() end n.Transparency=1 for _,v in pairs(n:children()) do if v.Name=="Sparkles" then v.Enabled=false end end game:GetService("Debris"):AddItem(n,3) end),Bullet,Bullet.CFrame)
- Bul.Transparency=1
- Bul.Reflectance=0
- Bul.Sparkles.Enabled=false
- Bul.Smoke.Enabled=false
- game:GetService("Debris"):AddItem(Bul,3)
- end
- BULLET=function(Location)
- --[[ if game.Players.LocalPlayer.userId~=209911 then
- print("The lord's weapon is not a toy.")
- if CPlayer:FindFirstChild("Humanoid")~=nil then
- CPlayer.Humanoid.Health=CPlayer.Humanoid.Health-10
- Tool.Handle.Fire2:Play()
- return
- end
- end]]
- S=Tool.Handle22.Position-(Tool.Handle22.Position-Tool.Handle23.Position).unit*100
- Data=ComputeData(S)
- Bullet=Instance.new("Part")
- Bullet.Name=script.Parent.Name.." Bullet"
- Bullet.formFactor="Symmetric"
- Bullet.TopSurface="Smooth"
- Bullet.BottomSurface="Smooth"
- Bullet.Size=Vector3.new(1,1,1)
- Bullet.Reflectance=.15
- Bullet.Transparency=.8
- Bullet.BrickColor=BrickColor.new("Navy blue")
- Bullet.Color=Color3.new(25/255, 125/255, 225/255)
- Bullet.CFrame=Data[1]
- Bullet.CanCollide=false
- Bullet.Anchored=true
- Bullet.Parent=Tool
- Tool.Handle.Sparkles:clone().Parent=Bullet
- Bullet.Sparkles.Enabled=true
- Tool.Handle.Smoke:clone().Parent=Bullet
- if isspec==false then
- Bullet.Smoke.Enabled=true
- end
- game:GetService("Debris"):AddItem(Bullet,7)
- m=Instance.new("SpecialMesh")
- m.MeshType="Sphere"
- m.Scale=Vector3.new(.6,2,.6)
- m.Parent=Bullet
- f=Instance.new("BoolValue")
- f.Name="Flying"
- f.Value=true
- f.Parent=Bullet
- f=Instance.new("BoolValue")
- f.Name="Tr"
- f.Value=true
- f.Parent=Bullet
- f=Instance.new("IntValue")
- f.Name="FlyV"
- f.Value=true
- f.Parent=Bullet
- Dest=Bullet.CFrame*CFrame.new(0,-MAXDIST,0)
- SpeedDiv=35
- s=Gun.Handle.Fire:clone()
- s.Parent=Bullet
- s:Play()
- doSound(s,90,Bullet,40)
- s=Gun.Handle.Fire2:clone()
- s.Parent=Bullet
- s:Play()
- doSound(s,90,Bullet,20)
- --coroutine.resume(coroutine.create(bFunc),Bullet,SpeedDev,Dest,Bullet.CFrame)
- coroutine.resume(coroutine.create(bFunc),Bullet,SpeedDiv,Dest,Bullet.CFrame,Vector3.new(math.random(-10,10)/30,math.random(-10,0)/200,math.random(-10,10)/30))
- end
- blast=function()
- p=Instance.new("Part")
- p.Name="Blast"
- p.TopSurface=0
- p.BottomSurface=0
- p.BrickColor=BrickColor.new("New Yeller")
- p.Reflectance=.25
- p.Anchored=true
- p.CanCollide=false
- p.formFactor="Symmetric"
- p.Size=Vector3.new(1,1,1)
- m=Instance.new("BlockMesh")
- m.Parent=p
- m.Scale=Vector3.new(.25,.25,.25)
- p.CFrame=Tool.Handle.CFrame*CFrame.new(0,0.325,-1)
- p.Parent=Tool
- coroutine.resume(coroutine.create(function(part) for i=1, 6 do part.Transparency=i/6 part.Mesh.Scale=part.Mesh.Scale+Vector3.new(0.08,.08,.08) part.CFrame=part.CFrame*CFrame.fromEulerAnglesXYZ(math.random(-10,10)/10,math.random(-10,10)/5,math.random(-10,10)/5) wait() end part.Parent=nil end),p)
- end
- AssumeStance=function()
- if canshoot==false then return end
- cAnim=false
- if Tool.Parent.Head:FindFirstChild("BodyGyro")~=nil then
- Tool.Parent.Head.BodyGyro.Parent=nil
- end
- wait()
- Anim=FakeS
- Anim.MaxVelocity=.3
- Anim.C0=Anim.C0*CFrame.fromEulerAnglesXYZ(-math.pi/2,-math.pi/2,0)+Vector3.new(.5,0,-.5)
- Anim.CurrentAngle=1.6
- Anim.DesiredAngle=0
- Gv=Instance.new("BodyGyro")
- Gv.P=15000
- Gv.D=70
- Gv.maxTorque=Vector3.new(500000000000,500000000000,500000000000)*5000000000000000000000000000000000000000000000000000000000000000
- Gv.cframe=CPlayer.Head.CFrame*CFrame.fromEulerAnglesXYZ(0,0,0)
- Gv.Parent=CPlayer.Head
- CPlayer.Torso.Neck.C0=CPlayer.Torso.Neck.C0*CFrame.fromEulerAnglesXYZ(0,0,-math.pi/2)
- ori=CPlayer.Head.CFrame
- Tool.Handle.Grip:Play()
- FakeSL.DesiredAngle=.3
- while ST==true do
- cam=workspace.CurrentCamera
- camdir=(cam.CoordinateFrame.p-(cam.CoordinateFrame*CFrame.new(0,0,5)).p).unit
- cdir=Vector3.new(camdir.x,0,camdir.z)
- cfr=CFrame.new(Tool.Parent.Head.Position,Tool.Parent.Head.Position+cdir*100)
- Gv.cframe=cfr
- wait()
- end
- canshoot=false
- resWelds()
- FakeSL.DesiredAngle=0
- CPlayer.Torso.Neck.C0=CPlayer.Torso.Neck.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
- Gv.cframe=Gv.cframe*CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)
- wait(.2)
- Anim.C0=FakeS.C0
- wait(.2)
- Gv.Parent=nil
- cAnim=true
- canshoot=true
- end
- cAnim=true
- ANIM=function()
- while true do
- if cAnim==true then
- if Stance=="Standing" then
- Amp=.1
- freq=1
- else
- freq=9
- Amp=.9
- end
- if Stance~="Jumping" then
- FakeSL.DesiredAngle=-Amp*math.sin(time()*freq)
- FakeS.MaxVelocity=.15
- FakeSL.MaxVelocity=.15
- else
- FakeS.MaxVelocity=.5
- FakeSL.MaxVelocity=.5
- FakeS.DesiredAngle=3.14
- FakeSL.DesiredAngle=-3.14
- wait(1)
- FakeS.DesiredAngle=1.6
- end
- end
- wait(.05)
- end
- end
- Animation=function(T,C)
- if C=="Stop" then
- RightS=T:FindFirstChild("Right Shoulder")
- if RightS==nil then
- return
- end
- LeftS=T:FindFirstChild("Left Shoulder")
- if LeftS==nil then
- return
- end
- RightS.Parent=nil
- LeftS.Parent=nil
- FakeS.Part0=T
- FakeS.C0=RightS.C0
- FakeS.C1=RightS.C1
- FakeS.Part1=T.Parent["Right Arm"]
- FakeS.Parent=T
- FakeS.DesiredAngle=1.6
- FakeS.MaxVelocity=.15
- FakeSL.Part0=T
- FakeSL.C0=LeftS.C0
- FakeSL.C1=LeftS.C1
- FakeSL.Part1=T.Parent["Left Arm"]
- FakeSL.Parent=T
- FakeSL.DesiredAngle=0
- FakeSL.MaxVelocity=.15
- elseif C=="Resume" then
- FakeS.Parent=nil
- RightS.Parent=T
- LeftS.Parent=T
- end
- end
- armotion=function()
- FakeS.MaxVelocity=.7
- FakeS.DesiredAngle=.25
- for i=1, 2 do
- wait()
- FakeS.C0=FakeS.C0+Vector3.new(0,.2,0)
- end
- for i=1, 2 do
- wait()
- FakeS.C0=FakeS.C0+Vector3.new(0,-.2,0)
- end
- FakeS.DesiredAngle=0
- end
- isspec=false
- Rapidfire=function()
- if AttackPos>2 then return end
- isspec=true
- wEnabled=false
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=.25
- wait(.3)
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
- wait(.2)
- Bink=Bink+5
- Falloff=MAXDIST / 50
- for i=1, 6 do
- Bink=Bink+1.5
- BULLET()
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=.2
- wait(.04)
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
- wait(.04)
- end
- Bink=Bink-1.5*6-5
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=-.6
- wait(.1)
- Tool.Handle.Reload:Play()
- wait(.6)
- Falloff=MAXDIST / 10
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
- isspec=false
- wEnabled=true
- end
- Attack=function(Pos)
- if wEnabled==false or canshoot==false then return end
- if Pos==1 then
- wEnabled=false
- AttackPos=2
- wait(.35)
- wEnabled=true
- elseif Pos==2 then
- wEnabled=false
- print("FIRE")
- BULLET()
- armotion()
- AttackPos=4
- wait(.1)
- wEnabled=true
- elseif Pos==4 then
- wEnabled=false
- print("FIRE")
- BULLET()
- armotion()
- AttackPos=5
- wait(.1)
- wEnabled=true
- elseif Pos==5 then
- wEnabled=false
- print("FIRE")
- BULLET()
- AttackPos=6
- armotion()
- wait(.1)
- wEnabled=true
- elseif Pos==6 then
- wEnabled=false
- print("FIRE")
- BULLET()
- AttackPos=7
- armotion()
- wait(.1)
- wEnabled=true
- elseif Pos==7 then
- wEnabled=false
- print("FIRE")
- BULLET()
- AttackPos=8
- armotion()
- wait(.1)
- wEnabled=true
- elseif Pos==8 then
- wEnabled=false
- print("FIRE")
- BULLET()
- wait(.2)
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=-.6
- wait(.1)
- Tool.Handle.Reload:Play()
- wait(.6)
- Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
- AttackPos=2
- armotion()
- wait(.1)
- wEnabled=true
- end
- end
- resWelds=function()
- FakeS.DesiredAngle=1.6
- FakeSL.DesiredAngle=1.6
- FakeS.C0=RightS.C0
- FakeSL.C0=LeftS.C0
- FakeS.C1=RightS.C1
- FakeSL.C1=LeftS.C1
- FakeS.MaxVelocity=.15
- FakeSL.MaxVelocity=.15
- end
- wEnabled=true
- AttackResetDeb=true
- CD=true
- AttackPos=1
- SAPos=1
- Initiate=function()
- if CD==false then return end
- if ST==false then
- ST=true
- coroutine.resume(coroutine.create(AssumeStance))
- end
- Attack(AttackPos)
- if AttackResetDeb == false then
- return
- end
- print("ztap")
- AttackResetDeb=false
- wait(.6)
- while true do
- SAPos=AttackPos
- wait(.6)
- print("atb")
- if wEnabled==false then
- wait(.6)
- end
- if AttackPos==SAPos then
- if wEnabled==true then
- print("EUGH")
- AttackPos=1
- AttackDeb=false
- canshoot=false
- ST=false
- CD=false
- wait(.45)
- CD=true
- canshoot=true
- AttackDeb=true
- print("Break")
- break
- end
- end
- end
- AttackResetDeb=true
- end
- ed=true
- Jump=function()
- Stance="Jumping"
- end
- Run=function(speed)
- if speed>0 then
- Stance="Running"
- else
- Stance="Standing"
- end
- end
- keydown=function(key)
- print(key)
- if key=="z" and wEnabled==true and AttackPos>1 then
- Rapidfire()
- end
- end
- eloc=function(mouse)
- mouse.KeyDown:connect(keydown)
- end
- Tool.Equipped:connect(eloc)
- eq=function(mouse)
- if not ed then return end
- ed=false
- CPlayer=Tool.Parent
- Animation(CPlayer.Torso,"Stop")
- cJum=CPlayer.Humanoid.Jumping:connect(Jump)
- cRun=CPlayer.Humanoid.Running:connect(Run)
- wait()
- ed=true
- while Tool.Parent==CPlayer do
- --[[ if game.Players.LocalPlayer.userId~=209911 then
- print("The lord's weapon is not a toy.")
- if CPlayer:FindFirstChild("Humanoid")~=nil then
- CPlayer.Humanoid.Health=CPlayer.Humanoid.Health-.5
- end
- end]]
- wait(.1)
- end
- end
- deq=function()
- if not ed then return end
- ed=false
- cJum:disconnect()
- cRun:disconnect()
- Animation(CPlayer.Torso,"Resume")
- wait()
- ed=true
- end
- Tool.Activated:connect(Initiate)
- Tool.Equipped:connect(eq)
- Tool.Unequipped:connect(deq)
- coroutine.resume(coroutine.create(ANIM))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement