Advertisement
deathsignature2

sss

Jan 22nd, 2018
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.84 KB | None | 0 0
  1. --turdulator
  2. --Because the soul gun failed so bad.
  3.  
  4. Tool=script.Parent;
  5. Gun=Tool;
  6.  
  7. FakeS=Instance.new("Motor")
  8. FakeS.Name="Right Shoulder"
  9. FakeSL=Instance.new("Motor")
  10. FakeSL.Name="Left Shoulder"
  11.  
  12. Stance="Standing"
  13. Amp=.1
  14. freq=1
  15. ST=false
  16. cAnim=true
  17. canshoot=true
  18.  
  19. MainshotId="http://www.roblox.com/asset/?id=54236529"
  20.  
  21. Velocity,Arc,MaxDist,BaseDmg,Size,MaxTime=150,0,5,20,2,2
  22.  
  23. doSound=function(sound,decay,origin,volume)
  24. if Source==nil then --formatting for other objects.
  25. Source=script.Parent
  26. end
  27. sc=Source.LocalSoundScript:clone()
  28. sc.DecayFactor.Value=decay
  29. sc.Origin.Value=origin
  30. sc.Volume.Value=volume
  31. sc.Disabled=false
  32. for j_,v_ in pairs(game.Workspace:children()) do
  33. if v_.className=="Model" and v_:FindFirstChild("Humanoid")~=nil and game.Players:GetPlayerFromCharacter(v_)~=nil then
  34. if v_~=Tool.Parent then
  35. sc.Sound.Value=sound
  36. sc:clone().Parent=v_
  37. end
  38. end
  39. end
  40. end
  41.  
  42. _G["ShowDamage"]=function(Char,Dealt,Du)
  43. for _,vvv in pairs(game.Players:children()) do
  44. if vvv:FindFirstChild("PlayerGui")~=nil then
  45. m=Instance.new("BillboardGui")
  46. m.Size=UDim2.new(1,0,1,0)
  47. m.Adornee=Char:FindFirstChild("Head")
  48. m.Name="DamageIndicator"
  49. f=Instance.new("TextLabel")
  50. f.Name="LABEL"
  51. f.TextColor3=Color3.new(3,5,9)
  52. f.Text="-"..Dealt
  53. f.FontSize=6
  54. f.Parent=m
  55. m.Parent=vvv.PlayerGui
  56. game:GetService("Debris"):AddItem(m,3)
  57. 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)))
  58. end
  59. end
  60. end
  61. ShowDamage=function(Char,Dealt,Du)
  62. for _,vvv in pairs(game.Players:children()) do
  63. if vvv:FindFirstChild("PlayerGui")~=nil then
  64. m=Instance.new("BillboardGui")
  65. m.Size=UDim2.new(1,0,1,0)
  66. m.Adornee=Char:FindFirstChild("Head")
  67. m.Name="DamageIndicator"
  68. f=Instance.new("TextLabel")
  69. f.Name="LABEL"
  70. f.TextColor3=Color3.new(3,5,9)
  71. f.Text="-"..Dealt
  72. f.FontSize=6
  73. f.Parent=m
  74. m.Parent=vvv.PlayerGui
  75. game:GetService("Debris"):AddItem(m,3)
  76. 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)))
  77. end
  78. end
  79. end
  80. _G["critEffect"]=function(Part)
  81. he=Part.Parent:FindFirstChild("Head")
  82. if he~=nil then Part=he end
  83. b=Instance.new("BillboardGui")
  84. b.Name="CUH-RIT"
  85. b.Size=UDim2.new(1,0,1,0)
  86. b.Adornee=Part
  87. b.StudsOffset=Vector3.new(math.random(-3,3)/3,1.75+math.random(0,5)/12.5,math.random(-3,3)/3)
  88. s=script.ImageLabel:clone()
  89. s.Parent=b
  90. s.Script.Disabled=false
  91. for _,v in pairs(game.Players:children()) do
  92. if v:FindFirstChild("PlayerGui")~=nil then
  93. n=b:clone()
  94. n.Parent=v.PlayerGui
  95. end
  96. end
  97. c=Instance.new("Sound")
  98. c.SoundId="http://roblox.com/asset/?id=10209481"
  99. c.Volume=.5
  100. c.Pitch=1.425
  101. c.Parent=Part
  102. c:Play()
  103. game:GetService("Debris"):AddItem(c,1)
  104. end
  105. _G["GetPlayerStats"]=function(Character) --Extracts and returns the player's stats.
  106. VP=game.Players:GetPlayerFromCharacter(Character)
  107. if VP==nil then --create a surrigate set of stats if the character is not a player.
  108. return script.Stats:clone()
  109. else
  110. STA=VP:FindFirstChild("Stats")
  111. if ST~=nil then
  112. return STA
  113. else
  114. print("ERROR 1: UNABLE TO RETRIEVE STATS.")
  115. return script.Stats:clone() --malfunction
  116. end
  117. end
  118. end
  119. _G["CalculateRealStats"]=function(Stats) --returns the real set of stats the game should use for calculations.
  120. reTab={}
  121. Attackv=Stats.Attack.Value+Stats.Changes.Attack.Value
  122. Defence=Stats.Defence.Value+Stats.Changes.Defence.Value
  123. Crit=Stats.Crit.Value+Stats.Changes.Crit.Value
  124. if Crit>100 then
  125. Crit=100
  126. elseif Crit<0 then
  127. Crit=0
  128. end
  129. WalkSpeed=Stats.WalkSpeed.Value+(Stats.WalkSpeed.Value*(Stats.Changes.WalkSpeed.Value*.01))
  130. mod=Instance.new("Model")
  131. mod.Name="Stats"
  132. Int=Instance.new("IntValue")
  133. Int.Name="Attack"
  134. Int.Value=Attackv
  135. Int.Parent=mod
  136. Int=Instance.new("IntValue")
  137. Int.Name="Defence"
  138. Int.Value=Defence
  139. Int.Parent=mod
  140. Int=Instance.new("IntValue")
  141. Int.Name="Crit"
  142. Int.Value=Crit
  143. Int.Parent=mod
  144. Int=Instance.new("IntValue")
  145. Int.Name="WalkSpeed"
  146. Int.Value=WalkSpeed
  147. Int.Parent=mod
  148. return mod
  149. end
  150. _G["DAMAGEMOD"]=function(Base,Effect,Relation) --Secondary filter which runs through abilities.
  151. --Example: Armour ability halves damage from shots that hit anything but your torso or head.
  152. --That would look like: (#,Multiply,.5)
  153. --[[
  154. Base: The damage sent through the first filter to this.
  155. Effect: The generic effect which will be applied to the Base
  156. Relation: Used when the Effect needs to reference another variable]]
  157. if Effect=="Nullify" then
  158. return 0 --nothing happens, triggers the effect.
  159. elseif Effect=="Multiply" then
  160. return Base*Relation
  161. end
  162. end
  163. _G["CalculateDamageDealt"]=function(StatsGiver,StatsTaker,vAbilities,BasePower,Attacker,Victim,ContactPart,aAbilities) --calculates and deals the damage.
  164. --Serves as a filter. Problem?
  165. if Victim.Health==0 then
  166. return 0
  167. end
  168. Restrictions={}
  169. RestrictionEnvironments={}
  170. RestrictionEffects={}
  171. RELATION={}
  172. TRIGLIST={}
  173. --The above are for ability related changes, not always a restriction
  174. for _,v in pairs(vAbilities) do
  175. if v=="Nihil" then
  176. if BasePower<=Victim.MaxHealth then
  177. table.insert(Restrictions,Victim.MaxHealth/2)
  178. table.insert(RestrictionEnvironments,"NoGreaterThan")
  179. table.insert(RestrictionEffects,"Nullify")
  180. table.insert(RELATION,0)
  181. end
  182. table.insert(Restrictions,5)
  183. table.insert(RestrictionEnvironments,"Randomize")
  184. table.insert(RestrictionEffects,"Nullify")
  185. table.insert(RELATION,0)
  186. elseif v=="Armor" then
  187. if ContactPart.Name~="Torso" and ContactPart.Name~="Head" then
  188. table.insert(Restrictions,.5)
  189. table.insert(RestrictionEnvironments,"Modify")
  190. table.insert(RestrictionEffects,"Multiply")
  191. table.insert(RELATION,.5)
  192. end
  193. elseif v=="Block" then
  194. table.insert(Restrictions,0)
  195. table.insert(RestrictionEnvironments,"Modify")
  196. table.insert(RestrictionEffects,"Multiply")
  197. table.insert(RELATION,0)
  198. if ContactPart.Parent:FindFirstChild("Handle")~=nil then
  199. ContactPart.Parent.Handle.Block:Play()
  200. end
  201. end
  202. end
  203. --[[RESTRICTION ENVIRONMENT LIST:
  204. NoGreaterThan
  205. RESTRICTION GENERIC MODIFIER LIST:
  206. Multiply X (OUT THROUGH RELATION)
  207. Nullify --cancel
  208. Reversal --restarts the entire process; switches victim and shooter.
  209. |_OUT THROUGH RELATION: 0: Calculates with the same methods 1: Reverses stats
  210. SendBack --Deals the damage back to the enemy, ignores effects that Reversal can cause.
  211. --]]
  212. TRIGGER=false --turns true if an ability activates
  213. Power1=StatsGiver.Attack.Value
  214. Defence1=StatsGiver.Defence.Value
  215. Power2=StatsTaker.Attack.Value
  216. Defence2=StatsTaker.Defence.Value
  217. cOut=Power1-Defence2
  218. cMod=BasePower*(cOut*.01)
  219. DMG=math.ceil(BasePower+cMod)
  220. --perform the tricky part, environments and other such things which make this VERY TRICKY.
  221. --The attacker takes priority over the victim, and requires little to no environments with calculation.
  222. for basepos,v in pairs(aAbilities) do
  223. if v=="Sharpshooter" then
  224. if ContactPart.Name=="Head" then
  225. DMG=_G["DAMAGEMOD"](DMG,"Multiply",1.5)
  226. end
  227. end
  228. end
  229. for basepos,Restriction in pairs(RestrictionEnvironments) do
  230. if Restriction=="NoGreaterThan" then
  231. if DMG>=Restrictions[basepos] then
  232. TRIGGER=true
  233. DMG=_G["DAMAGEMOD"](DMG,RestrictionEffects[basepos],RELATION[basepos])
  234. end
  235. elseif Restriction=="Modify" then --generic ability trip.
  236. TRIGGER=true
  237. DMG=_G["DAMAGEMOD"](DMG,RestrictionEffects[basepos],RELATION[basepos])
  238. elseif Restriction=="Randomize" then --randomly perform an effect, chance given with the variable.
  239. if math.random(1,Restrictions[basepos])==1 then
  240. DMG=_G["DAMAGEMOD"](DMG,RestrictionEffects[basepos],RELATION[basepos])
  241. end
  242. end
  243. end
  244. if StatsGiver.Crit.Value>0 then
  245. if math.random(1,100)<=StatsGiver.Crit.Value/2 then
  246. DMG=DMG*3
  247. print("Crit")
  248. _G["critEffect"](ContactPart)
  249. end
  250. end
  251. Damagev=math.ceil(DMG)
  252. return Damagev
  253. end
  254. ATTACKSTYLES={}
  255. DEFENCESTYLES={"Nihil","Armor"}
  256. _G["PerformDamage"]=function(A,V,HIT,BASE)
  257. Stat1=_G["GetPlayerStats"](A.Parent)
  258. Stat2=_G["GetPlayerStats"](V.Parent)
  259. RS1=_G["CalculateRealStats"](Stat1)
  260. RS2=_G["CalculateRealStats"](Stat2)
  261. ABSR=V.Parent.Abilities:children()
  262. ABS={}
  263. for _,v in pairs(ABSR) do
  264. if v.Value==true then
  265. table.insert(ABS,v.Name)
  266. end
  267. end
  268. ABSR1=A.Parent.Abilities:children()
  269. ABS1={}
  270. for _,v in pairs(ABSR1) do
  271. if v.Value==true then
  272. table.insert(ABS1,v.Name)
  273. end
  274. end
  275. dg=_G["CalculateDamageDealt"](RS1,RS2,ABS,BASE,A,V,HIT,ABS1)
  276. if dg<0 then
  277. dg=0
  278. end
  279. print(dg)
  280. V:TakeDamage(dg)
  281. return dg
  282. end
  283.  
  284. Cost=6
  285.  
  286. DPB=25
  287. MAXDIST=125
  288. Falloff=MAXDIST / 10
  289.  
  290. Damage=function(hit,Bonus,Influence,Trip,B)
  291. if hit.Parent==nil then
  292. return
  293. end
  294. h=hit.Parent:FindFirstChild("Humanoid")
  295. if h~=nil and hit.Parent:FindFirstChild("Torso")~=nil then
  296.  
  297. vP=game.Players:GetPlayerFromCharacter(hit.Parent)
  298. if vP==game.Players:GetPlayerFromCharacter(Tool.Parent) then
  299. return
  300. end
  301.  
  302. t=Instance.new("ObjectValue")
  303. t.Value=game.Players:GetPlayerFromCharacter(Tool.Parent)
  304. t.Name="creator"
  305. t.Parent=h
  306. game:GetService("Debris"):AddItem(t,.5)
  307.  
  308. OFF=((Tool.Handle.Position-B.Position).magnitude+1)/Falloff
  309. print(OFF)
  310. Dmg=math.floor(DPB-OFF)+1
  311. if Dmg<1 then
  312. Dmg=1
  313. end
  314. if hit.Parent.Name=="Gate" then
  315. Dmg=Dmg/5
  316. end
  317. h:TakeDamage(Dmg)
  318. ShowDamage(hit.Parent,Dmg,.5)
  319.  
  320. if Trip==true then
  321. r=Instance.new("BodyAngularVelocity")
  322. r.P=5000
  323. r.maxTorque=Vector3.new(50000,50000,50000)*5000000000000000000000
  324. r.angularvelocity=Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  325. r.Parent=hit.Parent.Torso
  326. game:GetService("Debris"):AddItem(r,.3)
  327. end
  328.  
  329.  
  330. end
  331. end
  332.  
  333. Bink=3
  334. Power=5
  335. ComputeData=function(Location)
  336. Start=Tool.Handle22.CFrame*CFrame.new(0,0,-.1)
  337. BinkOffset=Vector3.new(math.random(-3,3),math.random(-3,3)/3,math.random(-3,3))*(Bink)
  338. Location=Start.p+(Location-Start.p).unit*400
  339. End=CFrame.new(Location+BinkOffset)
  340. Final=CFrame.new(Start.p,End.p)*CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)
  341. return {Final*CFrame.new(0,-6,0),CFrame.new(Start.p,End.p).lookVector*(50)}
  342. end
  343.  
  344. bFunc=function(Bul,FSpeed,Destin,Startp,Off)
  345. while Bul.Flying.Value==true and Bul.FlyV.Value<100 do
  346. Destin=Destin+Off
  347. 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)
  348. Bul.FlyV.Value=Bul.FlyV.Value+MAXDIST/FSpeed
  349. r=Ray.new(Bul.Position-(Destin.p-Startp.p).unit*9,(Destin.p-Startp.p).unit*9)
  350. par,loc=workspace:FindPartOnRay(r,Tool.Parent)
  351. if par~=nil then
  352. if par.Parent~=nil then
  353. print("c1")
  354. print(par)
  355. if par.Parent:FindFirstChild("Humanoid")~=nil then
  356. print("c2")
  357. Damage(par,0,Vector3.new(0,0,0),false,Bul)
  358. end
  359. end
  360. Bul.Flying.Value=false
  361. break end
  362. if isspec==false then
  363. t=Bul:clone()
  364. t.Sparkles:Remove()
  365. t.CFrame=t.CFrame*CFrame.new(0,0,0)
  366. t.FlyV:Remove()
  367. t.Mesh.Scale=Vector3.new(.8,15,.8)
  368. t.Transparency=0
  369. t.Reflectance=0.25
  370. t.Flying:Remove()
  371. s=script.Trail:clone()
  372. s.Disabled=false
  373. s.Parent=t
  374. t.Parent=Tool
  375. else
  376. t=Bul:clone()
  377. t.Sparkles:Remove()
  378. t.CFrame=t.CFrame*CFrame.new(0,0,0)
  379. t.FlyV:Remove()
  380. t.Mesh.Scale=Vector3.new(.5,11,.5)
  381. t.Transparency=0
  382. t.Reflectance=0
  383. t.Flying:Remove()
  384. s=script.LTrail:clone()
  385. s.Disabled=false
  386. s.Parent=t
  387. t.Parent=Tool
  388.  
  389. end
  390. wait()
  391. end
  392.  
  393.  
  394. Bullet=Instance.new("Part")
  395. Bullet.Name="Ex"
  396. Bullet.formFactor="Custom"
  397. Bullet.TopSurface="Smooth"
  398. Bullet.BottomSurface="Smooth"
  399. Bullet.Size=Vector3.new(.2,.2,.2)
  400. Bullet.Reflectance=0.25
  401. Bullet.Transparency=0
  402. Bullet.Color=Bul.Color
  403. Bullet.CFrame=Bul.CFrame
  404. Bullet.CanCollide=false
  405. Bullet.Anchored=true
  406. Bullet.Parent=Tool
  407. game:GetService("Debris"):AddItem(Bullet,3)
  408. m=Instance.new("SpecialMesh")
  409. m.MeshType="Sphere"
  410. m.Parent=Bullet
  411. for i=1, 5 do
  412. s=Tool.Handle.Sparkles:clone()
  413. s.Enabled=true
  414. s.Parent=Bullet
  415. end
  416. 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)
  417.  
  418.  
  419. Bul.Transparency=1
  420. Bul.Reflectance=0
  421. Bul.Sparkles.Enabled=false
  422. Bul.Smoke.Enabled=false
  423. game:GetService("Debris"):AddItem(Bul,3)
  424. end
  425. BULLET=function(Location)
  426.  
  427. --[[ if game.Players.LocalPlayer.userId~=209911 then
  428. print("The lord's weapon is not a toy.")
  429. if CPlayer:FindFirstChild("Humanoid")~=nil then
  430. CPlayer.Humanoid.Health=CPlayer.Humanoid.Health-10
  431. Tool.Handle.Fire2:Play()
  432. return
  433. end
  434. end]]
  435.  
  436. S=Tool.Handle22.Position-(Tool.Handle22.Position-Tool.Handle23.Position).unit*100
  437.  
  438. Data=ComputeData(S)
  439. Bullet=Instance.new("Part")
  440. Bullet.Name=script.Parent.Name.." Bullet"
  441. Bullet.formFactor="Symmetric"
  442. Bullet.TopSurface="Smooth"
  443. Bullet.BottomSurface="Smooth"
  444. Bullet.Size=Vector3.new(1,1,1)
  445. Bullet.Reflectance=.15
  446. Bullet.Transparency=.8
  447. Bullet.BrickColor=BrickColor.new("Navy blue")
  448. Bullet.Color=Color3.new(25/255, 125/255, 225/255)
  449. Bullet.CFrame=Data[1]
  450. Bullet.CanCollide=false
  451. Bullet.Anchored=true
  452. Bullet.Parent=Tool
  453. Tool.Handle.Sparkles:clone().Parent=Bullet
  454. Bullet.Sparkles.Enabled=true
  455.  
  456. Tool.Handle.Smoke:clone().Parent=Bullet
  457. if isspec==false then
  458. Bullet.Smoke.Enabled=true
  459. end
  460.  
  461.  
  462. game:GetService("Debris"):AddItem(Bullet,7)
  463.  
  464. m=Instance.new("SpecialMesh")
  465. m.MeshType="Sphere"
  466. m.Scale=Vector3.new(.6,2,.6)
  467. m.Parent=Bullet
  468.  
  469. f=Instance.new("BoolValue")
  470. f.Name="Flying"
  471. f.Value=true
  472. f.Parent=Bullet
  473. f=Instance.new("BoolValue")
  474. f.Name="Tr"
  475. f.Value=true
  476. f.Parent=Bullet
  477. f=Instance.new("IntValue")
  478. f.Name="FlyV"
  479. f.Value=true
  480. f.Parent=Bullet
  481.  
  482. Dest=Bullet.CFrame*CFrame.new(0,-MAXDIST,0)
  483. SpeedDiv=35
  484.  
  485. s=Gun.Handle.Fire:clone()
  486. s.Parent=Bullet
  487. s:Play()
  488. doSound(s,90,Bullet,40)
  489.  
  490. s=Gun.Handle.Fire2:clone()
  491. s.Parent=Bullet
  492. s:Play()
  493. doSound(s,90,Bullet,20)
  494.  
  495. --coroutine.resume(coroutine.create(bFunc),Bullet,SpeedDev,Dest,Bullet.CFrame)
  496. 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))
  497.  
  498.  
  499. end
  500.  
  501. blast=function()
  502. p=Instance.new("Part")
  503. p.Name="Blast"
  504. p.TopSurface=0
  505. p.BottomSurface=0
  506. p.BrickColor=BrickColor.new("New Yeller")
  507. p.Reflectance=.25
  508. p.Anchored=true
  509. p.CanCollide=false
  510. p.formFactor="Symmetric"
  511. p.Size=Vector3.new(1,1,1)
  512. m=Instance.new("BlockMesh")
  513. m.Parent=p
  514. m.Scale=Vector3.new(.25,.25,.25)
  515. p.CFrame=Tool.Handle.CFrame*CFrame.new(0,0.325,-1)
  516. p.Parent=Tool
  517. 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)
  518. end
  519.  
  520.  
  521. AssumeStance=function()
  522. if canshoot==false then return end
  523. cAnim=false
  524. if Tool.Parent.Head:FindFirstChild("BodyGyro")~=nil then
  525. Tool.Parent.Head.BodyGyro.Parent=nil
  526. end
  527. wait()
  528. Anim=FakeS
  529. Anim.MaxVelocity=.3
  530. Anim.C0=Anim.C0*CFrame.fromEulerAnglesXYZ(-math.pi/2,-math.pi/2,0)+Vector3.new(.5,0,-.5)
  531. Anim.CurrentAngle=1.6
  532. Anim.DesiredAngle=0
  533. Gv=Instance.new("BodyGyro")
  534. Gv.P=15000
  535. Gv.D=70
  536. Gv.maxTorque=Vector3.new(500000000000,500000000000,500000000000)*5000000000000000000000000000000000000000000000000000000000000000
  537. Gv.cframe=CPlayer.Head.CFrame*CFrame.fromEulerAnglesXYZ(0,0,0)
  538. Gv.Parent=CPlayer.Head
  539. CPlayer.Torso.Neck.C0=CPlayer.Torso.Neck.C0*CFrame.fromEulerAnglesXYZ(0,0,-math.pi/2)
  540. ori=CPlayer.Head.CFrame
  541. Tool.Handle.Grip:Play()
  542. FakeSL.DesiredAngle=.3
  543. while ST==true do
  544. cam=workspace.CurrentCamera
  545. camdir=(cam.CoordinateFrame.p-(cam.CoordinateFrame*CFrame.new(0,0,5)).p).unit
  546. cdir=Vector3.new(camdir.x,0,camdir.z)
  547. cfr=CFrame.new(Tool.Parent.Head.Position,Tool.Parent.Head.Position+cdir*100)
  548. Gv.cframe=cfr
  549. wait()
  550. end
  551. canshoot=false
  552. resWelds()
  553. FakeSL.DesiredAngle=0
  554. CPlayer.Torso.Neck.C0=CPlayer.Torso.Neck.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
  555. Gv.cframe=Gv.cframe*CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)
  556. wait(.2)
  557. Anim.C0=FakeS.C0
  558. wait(.2)
  559. Gv.Parent=nil
  560. cAnim=true
  561. canshoot=true
  562. end
  563. cAnim=true
  564. ANIM=function()
  565. while true do
  566. if cAnim==true then
  567. if Stance=="Standing" then
  568. Amp=.1
  569. freq=1
  570. else
  571. freq=9
  572. Amp=.9
  573. end
  574. if Stance~="Jumping" then
  575. FakeSL.DesiredAngle=-Amp*math.sin(time()*freq)
  576. FakeS.MaxVelocity=.15
  577. FakeSL.MaxVelocity=.15
  578. else
  579. FakeS.MaxVelocity=.5
  580. FakeSL.MaxVelocity=.5
  581. FakeS.DesiredAngle=3.14
  582. FakeSL.DesiredAngle=-3.14
  583. wait(1)
  584. FakeS.DesiredAngle=1.6
  585. end
  586. end
  587. wait(.05)
  588. end
  589. end
  590.  
  591. Animation=function(T,C)
  592. if C=="Stop" then
  593. RightS=T:FindFirstChild("Right Shoulder")
  594. if RightS==nil then
  595. return
  596. end
  597. LeftS=T:FindFirstChild("Left Shoulder")
  598. if LeftS==nil then
  599. return
  600. end
  601. RightS.Parent=nil
  602. LeftS.Parent=nil
  603. FakeS.Part0=T
  604. FakeS.C0=RightS.C0
  605. FakeS.C1=RightS.C1
  606. FakeS.Part1=T.Parent["Right Arm"]
  607. FakeS.Parent=T
  608. FakeS.DesiredAngle=1.6
  609. FakeS.MaxVelocity=.15
  610. FakeSL.Part0=T
  611. FakeSL.C0=LeftS.C0
  612. FakeSL.C1=LeftS.C1
  613. FakeSL.Part1=T.Parent["Left Arm"]
  614. FakeSL.Parent=T
  615. FakeSL.DesiredAngle=0
  616. FakeSL.MaxVelocity=.15
  617. elseif C=="Resume" then
  618. FakeS.Parent=nil
  619. RightS.Parent=T
  620. LeftS.Parent=T
  621. end
  622. end
  623. armotion=function()
  624. FakeS.MaxVelocity=.7
  625. FakeS.DesiredAngle=.25
  626. for i=1, 2 do
  627. wait()
  628. FakeS.C0=FakeS.C0+Vector3.new(0,.2,0)
  629. end
  630. for i=1, 2 do
  631. wait()
  632. FakeS.C0=FakeS.C0+Vector3.new(0,-.2,0)
  633. end
  634. FakeS.DesiredAngle=0
  635. end
  636. isspec=false
  637. Rapidfire=function()
  638. if AttackPos>2 then return end
  639. isspec=true
  640. wEnabled=false
  641. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=.25
  642. wait(.3)
  643. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
  644. wait(.2)
  645. Bink=Bink+5
  646. Falloff=MAXDIST / 50
  647. for i=1, 6 do
  648. Bink=Bink+1.5
  649. BULLET()
  650. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=.2
  651. wait(.04)
  652. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
  653. wait(.04)
  654. end
  655. Bink=Bink-1.5*6-5
  656. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=-.6
  657. wait(.1)
  658. Tool.Handle.Reload:Play()
  659. wait(.6)
  660. Falloff=MAXDIST / 10
  661. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
  662. isspec=false
  663. wEnabled=true
  664. end
  665. Attack=function(Pos)
  666. if wEnabled==false or canshoot==false then return end
  667. if Pos==1 then
  668. wEnabled=false
  669. AttackPos=2
  670. wait(.35)
  671. wEnabled=true
  672. elseif Pos==2 then
  673. wEnabled=false
  674. print("FIRE")
  675. BULLET()
  676. armotion()
  677. AttackPos=4
  678. wait(.1)
  679. wEnabled=true
  680. elseif Pos==4 then
  681. wEnabled=false
  682. print("FIRE")
  683. BULLET()
  684. armotion()
  685. AttackPos=5
  686. wait(.1)
  687. wEnabled=true
  688. elseif Pos==5 then
  689. wEnabled=false
  690. print("FIRE")
  691. BULLET()
  692. AttackPos=6
  693. armotion()
  694. wait(.1)
  695. wEnabled=true
  696. elseif Pos==6 then
  697. wEnabled=false
  698. print("FIRE")
  699. BULLET()
  700. AttackPos=7
  701. armotion()
  702. wait(.1)
  703. wEnabled=true
  704. elseif Pos==7 then
  705. wEnabled=false
  706. print("FIRE")
  707. BULLET()
  708. AttackPos=8
  709. armotion()
  710. wait(.1)
  711. wEnabled=true
  712. elseif Pos==8 then
  713. wEnabled=false
  714. print("FIRE")
  715. BULLET()
  716. wait(.2)
  717. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=-.6
  718. wait(.1)
  719. Tool.Handle.Reload:Play()
  720. wait(.6)
  721. Tool.Parent.Torso["Right Shoulder"].DesiredAngle=0
  722. AttackPos=2
  723. armotion()
  724. wait(.1)
  725. wEnabled=true
  726. end
  727. end
  728. resWelds=function()
  729. FakeS.DesiredAngle=1.6
  730. FakeSL.DesiredAngle=1.6
  731. FakeS.C0=RightS.C0
  732. FakeSL.C0=LeftS.C0
  733. FakeS.C1=RightS.C1
  734. FakeSL.C1=LeftS.C1
  735. FakeS.MaxVelocity=.15
  736. FakeSL.MaxVelocity=.15
  737. end
  738. wEnabled=true
  739. AttackResetDeb=true
  740. CD=true
  741. AttackPos=1
  742. SAPos=1
  743. Initiate=function()
  744. if CD==false then return end
  745. if ST==false then
  746. ST=true
  747. coroutine.resume(coroutine.create(AssumeStance))
  748. end
  749. Attack(AttackPos)
  750. if AttackResetDeb == false then
  751. return
  752. end
  753. print("ztap")
  754. AttackResetDeb=false
  755. wait(.6)
  756. while true do
  757. SAPos=AttackPos
  758. wait(.6)
  759. print("atb")
  760. if wEnabled==false then
  761. wait(.6)
  762. end
  763. if AttackPos==SAPos then
  764. if wEnabled==true then
  765. print("EUGH")
  766. AttackPos=1
  767. AttackDeb=false
  768. canshoot=false
  769. ST=false
  770. CD=false
  771. wait(.45)
  772. CD=true
  773. canshoot=true
  774. AttackDeb=true
  775. print("Break")
  776. break
  777. end
  778. end
  779. end
  780. AttackResetDeb=true
  781. end
  782. ed=true
  783. Jump=function()
  784. Stance="Jumping"
  785. end
  786. Run=function(speed)
  787. if speed>0 then
  788. Stance="Running"
  789. else
  790. Stance="Standing"
  791. end
  792. end
  793. keydown=function(key)
  794. print(key)
  795. if key=="z" and wEnabled==true and AttackPos>1 then
  796. Rapidfire()
  797. end
  798. end
  799. eloc=function(mouse)
  800. mouse.KeyDown:connect(keydown)
  801. end
  802. Tool.Equipped:connect(eloc)
  803. eq=function(mouse)
  804. if not ed then return end
  805. ed=false
  806. CPlayer=Tool.Parent
  807. Animation(CPlayer.Torso,"Stop")
  808. cJum=CPlayer.Humanoid.Jumping:connect(Jump)
  809. cRun=CPlayer.Humanoid.Running:connect(Run)
  810. wait()
  811. ed=true
  812. while Tool.Parent==CPlayer do
  813. --[[ if game.Players.LocalPlayer.userId~=209911 then
  814. print("The lord's weapon is not a toy.")
  815. if CPlayer:FindFirstChild("Humanoid")~=nil then
  816. CPlayer.Humanoid.Health=CPlayer.Humanoid.Health-.5
  817. end
  818. end]]
  819. wait(.1)
  820. end
  821. end
  822. deq=function()
  823. if not ed then return end
  824. ed=false
  825. cJum:disconnect()
  826. cRun:disconnect()
  827. Animation(CPlayer.Torso,"Resume")
  828. wait()
  829. ed=true
  830. end
  831. Tool.Activated:connect(Initiate)
  832. Tool.Equipped:connect(eq)
  833. Tool.Unequipped:connect(deq)
  834. coroutine.resume(coroutine.create(ANIM))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement