Advertisement
frog2128

Untitled

Mar 14th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.29 KB | None | 0 0
  1. --[[
  2. Fixer the Demon Mercenary character created by (NAME REDACTED), also known as ArkDeimos.
  3. Scripted by Fenrier.
  4. "You intrigue me, you seek power and strength, the most valuable resource of all... As do I..
  5. heed my indstructions swordsman, and I promise you we will find him again,
  6. and you can repay all debts in blood"
  7. "BLOOD FOR THE BLOOD GOD! SKULLS FOR THE SKULL THRONE! LET THE GALAXY BURN!"
  8. ]]
  9. Player=game:GetService("Players").LocalPlayer
  10. Character=Player.Character
  11. PlayerGui=Player.PlayerGui
  12. Backpack=Player.Backpack
  13. Torso=Character.Torso
  14. Head=Character.Head
  15. Humanoid=Character.Humanoid
  16. LeftArm=Character["Left Arm"]
  17. LeftLeg=Character["Left Leg"]
  18. RightArm=Character["Right Arm"]
  19. RightLeg=Character["Right Leg"]
  20. LS=Torso["Left Shoulder"]
  21. LH=Torso["Left Hip"]
  22. RS=Torso["Right Shoulder"]
  23. RH=Torso["Right Hip"]
  24. Neck=Torso.Neck
  25. it=Instance.new
  26. vt=Vector3.new
  27. cf=CFrame.new
  28. euler=CFrame.fromEulerAnglesXYZ
  29. angles=CFrame.Angles
  30. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  31. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  32. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  33. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  34. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  35. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  36. RootPart=Character.HumanoidRootPart
  37. RootJoint=RootPart.RootJoint
  38. RootCF=euler(-1.57,0,3.14)
  39. attack=false
  40. attackdebounce=false
  41. MMouse=nil
  42. combo=0
  43. local con1=nil
  44. local con2=nil
  45. --player
  46. player=nil
  47. --save shoulders
  48. RSH, LSH=nil, nil
  49. --welds
  50. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  51. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  52. LH=Torso["Left Hip"]
  53. RH=Torso["Right Hip"]
  54. Asset="http://www.roblox.com/asset/?id="
  55.  
  56. function swait(num)
  57. if num==0 or num==nil then
  58. game:service'RunService'.RenderStepped:wait()
  59. else
  60. for i=0,num do
  61. game:service'RunService'.RenderStepped:wait()
  62. end
  63. end
  64. end
  65.  
  66. if Character:findFirstChild("Binary Sword",true) ~= nil then
  67. Character:findFirstChild("Binary Sword",true).Parent = nil
  68. end
  69. if Character:findFirstChild("Demon Blade",true) ~= nil then
  70. Character:findFirstChild("Demon Blade",true).Parent = nil
  71. end
  72. if Player.PlayerGui:findFirstChild("WeaponGUI",true) ~= nil then
  73. Player.PlayerGui:findFirstChild("WeaponGUI",true).Parent = nil
  74. end
  75.  
  76.  
  77. function NoOutline(Part)
  78. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  79. end
  80.  
  81. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  82. local fp=it("Part")
  83. fp.formFactor=formfactor
  84. fp.Parent=parent
  85. fp.Reflectance=reflectance
  86. fp.Transparency=transparency
  87. fp.CanCollide=false
  88. fp.Locked=true
  89. fp.BrickColor=brickcolor
  90. fp.Name=name
  91. fp.Size=size
  92. fp.Position=Torso.Position
  93. NoOutline(fp)
  94. fp.Material="SmoothPlastic"
  95. fp:BreakJoints()
  96. return fp
  97. end
  98.  
  99. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  100. local mesh=it(Mesh)
  101. mesh.Parent=part
  102. if Mesh=="SpecialMesh" then
  103. mesh.MeshType=meshtype
  104. mesh.MeshId=meshid
  105. end
  106. mesh.Offset=offset
  107. mesh.Scale=scale
  108. return mesh
  109. end
  110.  
  111. function weld(parent,part0,part1,c0)
  112. local weld=it("Weld")
  113. weld.Parent=parent
  114. weld.Part0=part0
  115. weld.Part1=part1
  116. weld.C0=c0
  117. return weld
  118. end
  119.  
  120. local fengui=it("GuiMain")
  121. fengui.Parent=Player.PlayerGui
  122. fengui.Name="WeaponGUI"
  123.  
  124. local Color1=BrickColor.new("White")
  125. local Color2=BrickColor.new("Dark stone grey")
  126. local Color3=BrickColor.new("Medium stone grey")
  127.  
  128. local model1=Instance.new("Model")
  129. model1.Parent=Character
  130. model1.Name="Binary Sword"
  131. BSword={}
  132. BSwordWelds={}
  133. local model2=Instance.new("Model")
  134. model2.Parent=Character
  135. model2.Name="Demon Blade"
  136. DBlade={}
  137. DBladeWelds={}
  138.  
  139. prt1=part(3,model1,0,0,Color1,"Part1",vt())
  140. prt2=part(3,model1,0,0,Color2,"Part2",vt())
  141.  
  142. msh1=mesh("BlockMesh",prt1,"","",vt(0,0,0),vt(1,1,1))
  143. msh2=mesh("CylinderMesh",prt2,"","",vt(0,0,0),vt(2,15,2))
  144.  
  145. wld1=weld(prt1,prt1,RightArm,euler(1.57,0,0)*cf(0,1,-0.5))
  146. wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,0,0))
  147.  
  148. local hitbox1=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  149. local hitbox2=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  150.  
  151. if (script.Parent.className~="HopperBin") then
  152. Tool=Instance.new("HopperBin")
  153. Tool.Parent=Backpack
  154. Tool.Name="Fixer"
  155. script.Parent=Tool
  156. end
  157. Bin=script.Parent
  158. --Bin=Tool
  159.  
  160. local bodvel=Instance.new("BodyVelocity")
  161. local bg=Instance.new("BodyGyro")
  162.  
  163. so = function(id,par,vol,pit)
  164. coroutine.resume(coroutine.create(function()
  165. local sou = Instance.new("Sound",par or workspace)
  166. sou.Volume=vol
  167. sou.Pitch=pit or 1
  168. sou.SoundId=id
  169. swait()
  170. sou:play()
  171. game:GetService("Debris"):AddItem(sou,6)
  172. end))
  173. end
  174.  
  175. function clerp(a,b,t)
  176. local qa = {QuaternionFromCFrame(a)}
  177. local qb = {QuaternionFromCFrame(b)}
  178. local ax, ay, az = a.x, a.y, a.z
  179. local bx, by, bz = b.x, b.y, b.z
  180. local _t = 1-t
  181. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  182. end
  183.  
  184. function QuaternionFromCFrame(cf)
  185. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  186. local trace = m00 + m11 + m22
  187. if trace > 0 then
  188. local s = math.sqrt(1 + trace)
  189. local recip = 0.5/s
  190. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  191. else
  192. local i = 0
  193. if m11 > m00 then
  194. i = 1
  195. end
  196. if m22 > (i == 0 and m00 or m11) then
  197. i = 2
  198. end
  199. if i == 0 then
  200. local s = math.sqrt(m00-m11-m22+1)
  201. local recip = 0.5/s
  202. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  203. elseif i == 1 then
  204. local s = math.sqrt(m11-m22-m00+1)
  205. local recip = 0.5/s
  206. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  207. elseif i == 2 then
  208. local s = math.sqrt(m22-m00-m11+1)
  209. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  210. end
  211. end
  212. end
  213.  
  214. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  215. local xs, ys, zs = x + x, y + y, z + z
  216. local wx, wy, wz = w*xs, w*ys, w*zs
  217. local xx = x*xs
  218. local xy = x*ys
  219. local xz = x*zs
  220. local yy = y*ys
  221. local yz = y*zs
  222. local zz = z*zs
  223. 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))
  224. end
  225.  
  226. function QuaternionSlerp(a, b, t)
  227. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  228. local startInterp, finishInterp;
  229. if cosTheta >= 0.0001 then
  230. if (1 - cosTheta) > 0.0001 then
  231. local theta = math.acos(cosTheta)
  232. local invSinTheta = 1/math.sin(theta)
  233. startInterp = math.sin((1-t)*theta)*invSinTheta
  234. finishInterp = math.sin(t*theta)*invSinTheta
  235. else
  236. startInterp = 1-t
  237. finishInterp = t
  238. end
  239. else
  240. if (1+cosTheta) > 0.0001 then
  241. local theta = math.acos(-cosTheta)
  242. local invSinTheta = 1/math.sin(theta)
  243. startInterp = math.sin((t-1)*theta)*invSinTheta
  244. finishInterp = math.sin(t*theta)*invSinTheta
  245. else
  246. startInterp = t-1
  247. finishInterp = t
  248. end
  249. end
  250. 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
  251. end
  252.  
  253. function hideanim()
  254. equipped=false
  255. n=2
  256. for i=0,1,0.05 do
  257. swait()
  258. --[[Torso.Neck.C0=necko*euler(0,0,0)
  259. RootJoint.C0=RootCF*euler(0,0,0)
  260. RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5-0.5*i*n)
  261. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  262. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5+0.5*i*n)
  263. LW.C1=cf(0,0.5,0)*euler(0,0,0)]]
  264. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  265. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.4)
  266. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0),.4)
  267. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4)
  268. n=n-0.1
  269. end
  270. Torso.Neck.C0=necko
  271. Torso.Neck.C1=necko2
  272. RootJoint.C0=RootCF
  273. RW.C0=cf(1.5,0.5,0)*euler(0,0,0)
  274. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  275. LW.C0=cf(-1.5,0.5,0)*euler(0,0,0)
  276. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  277. RH.C0=RHC0
  278. RH.C1=RHC1
  279. LH.C0=LHC0
  280. LH.C1=LHC1
  281. end
  282.  
  283. function equipanim()
  284. equipped=true
  285. n=2
  286. for i=0,1,0.1 do
  287. swait()
  288. --[[Torso.Neck.C0=necko*euler(0,0,0)
  289. RootJoint.C0=RootCF*euler(0,0,0)
  290. RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5*i*n)
  291. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  292. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5*i*n)
  293. LW.C1=cf(0,0.5,0)*euler(0,0,0)]]
  294. n=n-0.1
  295. end
  296. --[[Torso.Neck.C0=necko*euler(0,0,0)
  297. RootJoint.C0=RootCF*euler(0,0,0)
  298. RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5)
  299. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  300. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5)
  301. LW.C1=cf(0,0.5,0)*euler(0,0,0)]]
  302. end
  303.  
  304. function MagniDamage(Part,magni,mindam,maxdam,knock,Type)
  305. for _,c in pairs(workspace:children()) do
  306. local hum=c:findFirstChild("Humanoid")
  307. if hum~=nil then
  308. local head=c:findFirstChild("Torso")
  309. if head~=nil then
  310. local targ=head.Position-Part.Position
  311. local mag=targ.magnitude
  312. if mag<=magni and c.Name~=Player.Name then
  313. if c~=CannonTarget.Parent or c~=RailgunTarget.Parent then
  314. Damagefunc(head,mindam,maxdam,knock,Type,RootPart,.2,1,nil,1)
  315. end
  316. end
  317. end
  318. end
  319. end
  320. end
  321.  
  322. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  323. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  324. end
  325.  
  326. local Point=Torso.CFrame*cf(0,Torso.Size.Y,0)
  327. LastPoint=Point
  328. function effect(Color,Ref,LP,P1,returnn)
  329. local effectsmsh=Instance.new("CylinderMesh")
  330. effectsmsh.Scale=Vector3.new(0.2,1,0.2)
  331. effectsmsh.Name="Mesh"
  332. local effectsg=Instance.new("Part")
  333. effectsg.formFactor=3
  334. effectsg.CanCollide=false
  335. effectsg.Name="Eff"
  336. effectsg.Locked=true
  337. effectsg.Anchored=true
  338. effectsg.Size=Vector3.new(0.5,1,0.5)
  339. effectsg.Parent=workspace
  340. effectsmsh.Parent=effectsg
  341. effectsg.BrickColor=BrickColor.new(Color)
  342. effectsg.Reflectance=Ref
  343. local point1=P1
  344. local mg=(LP.p - point1.p).magnitude
  345. effectsg.Size=Vector3.new(0.5,mg,0.5)
  346. effectsg.CFrame=cf((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  347. effectsmsh.Scale=Vector3.new(0.2,1,0.2)
  348. game:GetService("Debris"):AddItem(effectsg,2)
  349. if returnn then return effectsg end
  350. coroutine.resume(coroutine.create(function(Part,Mesh)
  351. if not returnn then
  352. for i=0,1,0.05 do
  353. wait()
  354. Part.Transparency=1*i
  355. Mesh.Scale=Vector3.new(0.5-0.5*i,1,0.5-0.5*i)
  356. end
  357. Part.Parent=nil
  358. end
  359. end),effectsg,effectsmsh)
  360. end
  361.  
  362. local function CFrameFromTopBack(at, top, back)
  363. local right = top:Cross(back)
  364. return CFrame.new(at.x, at.y, at.z,
  365. right.x, top.x, back.x,
  366. right.y, top.y, back.y,
  367. right.z, top.z, back.z)
  368. end
  369.  
  370. function Triangle(a, b, c)
  371. local edg1 = (c-a):Dot((b-a).unit)
  372. local edg2 = (a-b):Dot((c-b).unit)
  373. local edg3 = (b-c):Dot((a-c).unit)
  374. if edg1 <= (b-a).magnitude and edg1 >= 0 then
  375. a, b, c = a, b, c
  376. elseif edg2 <= (c-b).magnitude and edg2 >= 0 then
  377. a, b, c = b, c, a
  378. elseif edg3 <= (a-c).magnitude and edg3 >= 0 then
  379. a, b, c = c, a, b
  380. else
  381. assert(false, "unreachable")
  382. end
  383.  
  384. local len1 = (c-a):Dot((b-a).unit)
  385. local len2 = (b-a).magnitude - len1
  386. local width = (a + (b-a).unit*len1 - c).magnitude
  387.  
  388. local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit)
  389.  
  390. local list = {}
  391.  
  392. if len1 > 0.01 then
  393. local w1 = Instance.new('WedgePart', m)
  394. w1.Material = "SmoothPlastic"
  395. w1.FormFactor = 'Custom'
  396. w1.BrickColor = BrickColor.new("White")
  397. w1.Transparency = 0
  398. w1.Reflectance = 0
  399. w1.Material = "SmoothPlastic"
  400. w1.CanCollide = false
  401. NoOutline(w1)
  402. local sz = Vector3.new(0.2, width, len1)
  403. w1.Size = sz
  404. local sp = Instance.new("SpecialMesh",w1)
  405. sp.MeshType = "Wedge"
  406. sp.Scale = Vector3.new(0,1,1) * sz/w1.Size
  407. w1:BreakJoints()
  408. w1.Anchored = true
  409. w1.Parent = workspace
  410. w1.Transparency = 0.7
  411. coroutine.resume(coroutine.create(function(Part)
  412. for i=0,1,0.1 do
  413. wait()
  414. Part.Transparency=Part.Transparency+0.03
  415. end
  416. end),w1)
  417. w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  418. table.insert(list,w1)
  419. end
  420.  
  421. if len2 > 0.01 then
  422. local w2 = Instance.new('WedgePart', m)
  423. w2.Material = "SmoothPlastic"
  424. w2.FormFactor = 'Custom'
  425. w2.BrickColor = BrickColor.new("White")
  426. w2.Transparency = 0
  427. w2.Reflectance = 0
  428. w2.Material = "SmoothPlastic"
  429. w2.CanCollide = false
  430. NoOutline(w2)
  431. local sz = Vector3.new(0.2, width, len2)
  432. w2.Size = sz
  433. local sp = Instance.new("SpecialMesh",w2)
  434. sp.MeshType = "Wedge"
  435. sp.Scale = Vector3.new(0,1,1) * sz/w2.Size
  436. w2:BreakJoints()
  437. w2.Anchored = true
  438. w2.Parent = workspace
  439. w2.Transparency = 0.7
  440. coroutine.resume(coroutine.create(function(Part)
  441. for i=0,1,0.1 do
  442. wait()
  443. Part.Transparency=Part.Transparency+0.03
  444. end
  445. end),w2)
  446. w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  447. table.insert(list,w2)
  448. end
  449. return unpack(list)
  450. end
  451.  
  452. --[[
  453. Things for effects
  454. put the variables in one table
  455. like effect={brick,interval,i}
  456. ]]
  457. local Effects={}
  458. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  459. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  460. prt.Anchored=true
  461. prt.CFrame=cframe
  462. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  463. game:GetService("Debris"):AddItem(prt,5)
  464. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay
  465. --[[coroutine.resume(coroutine.create(function(Part,Mesh,dur)
  466. for i=0,1,delay do
  467. wait()
  468. Part.CFrame=Part.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  469. Part.Transparency=i
  470. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  471. end
  472. Part.Parent=nil
  473. end),prt,msh)]]
  474. end
  475.  
  476. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  477. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  478. prt.Anchored=true
  479. prt.CFrame=cframe
  480. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  481. game:GetService("Debris"):AddItem(prt,5)
  482. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3})
  483. --[[coroutine.resume(coroutine.create(function(Part,Mesh)
  484. local wld=nil
  485. for i=0,1,delay do
  486. wait()
  487. Part.CFrame=Part.CFrame
  488. Part.Transparency=i
  489. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  490. end
  491. Part.Parent=nil
  492. end),prt,msh)]]
  493. end
  494.  
  495. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  496. local prt=part(3,Character,0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  497. prt.Anchored=true
  498. prt.CFrame=cframe
  499. msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
  500. game:GetService("Debris"):AddItem(prt,5)
  501. --table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3})
  502. Effects[#Effects+1]={prt,"Cylinder",delay,x3,y3,z3} --part, type, delay
  503. --[[coroutine.resume(coroutine.create(function(Part,Mesh)
  504. for i=0,1,delay do
  505. wait()
  506. Part.CFrame=Part.CFrame
  507. Part.Transparency=i
  508. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  509. end
  510. Part.Parent=nil
  511. end),prt,msh)]]
  512. end
  513.  
  514. function MagicCylinder2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  515. local prt=part(3,Character,0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  516. prt.Anchored=true
  517. prt.CFrame=cframe
  518. msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  519. game:GetService("Debris"):AddItem(prt,5)
  520. --table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3})
  521. Effects[#Effects+1]={prt,"Cylinder",delay,x3,y3,z3} --part, type, delay
  522. --[[coroutine.resume(coroutine.create(function(Part,Mesh)
  523. for i=0,1,delay do
  524. wait()
  525. Part.CFrame=Part.CFrame
  526. Part.Transparency=i
  527. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  528. end
  529. Part.Parent=nil
  530. end),prt,msh)]]
  531. end
  532.  
  533. Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,decreaseblock)
  534. if hit.Parent==nil then
  535. return
  536. end
  537. h=hit.Parent:FindFirstChild("Humanoid")
  538. for _,v in pairs(hit.Parent:children()) do
  539. if v:IsA("Humanoid") then
  540. h=v
  541. end
  542. end
  543. if hit.Parent.Parent:FindFirstChild("Torso")~=nil then
  544. h=hit.Parent.Parent:FindFirstChild("Humanoid")
  545. end
  546. if hit.Parent.className=="Hat" then
  547. hit=hit.Parent.Parent:findFirstChild("Head")
  548. end
  549. -- and hit.Parent~=CannonTarget.Parent or hit.Parent~=RailgunTarget.Parent
  550. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  551. if hit.Parent~=CannonTarget.Parent and hit.Parent~=RailgunTarget.Parent then
  552. if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end
  553. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  554. return
  555. end]]
  556. -- hs(hit,1.2)
  557. c=Instance.new("ObjectValue")
  558. c.Name="creator"
  559. c.Value=game:service("Players").LocalPlayer
  560. c.Parent=h
  561. game:GetService("Debris"):AddItem(c,.5)
  562. Damage=math.random(minim,maxim)
  563. -- h:TakeDamage(Damage)
  564. blocked=false
  565. block=hit.Parent:findFirstChild("Block")
  566. if block~=nil then
  567. print(block.className)
  568. if block.className=="NumberValue" then
  569. if block.Value>0 then
  570. blocked=true
  571. if decreaseblock==nil then
  572. block.Value=block.Value-1
  573. end
  574. end
  575. end
  576. if block.className=="IntValue" then
  577. if block.Value>0 then
  578. blocked=true
  579. if decreaseblock~=nil then
  580. block.Value=block.Value-1
  581. end
  582. end
  583. end
  584. end
  585. if blocked==false then
  586. -- h:TakeDamage(Damage)
  587. h.Health=h.Health-Damage
  588. showDamage(hit.Parent,Damage,.5,BrickColor:Red())
  589. else
  590. h.Health=h.Health-(Damage/2)
  591. showDamage(hit.Parent,Damage/2,.5,BrickColor.new("Bright blue"))
  592. end
  593. if Type=="Knockdown" then
  594. hum=hit.Parent.Humanoid
  595. hum.PlatformStand=true
  596. coroutine.resume(coroutine.create(function(HHumanoid)
  597. swait(1)
  598. HHumanoid.PlatformStand=false
  599. end),hum)
  600. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  601. --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  602. local bodvol=Instance.new("BodyVelocity")
  603. bodvol.velocity=angle*knockback
  604. bodvol.P=5000
  605. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  606. bodvol.Parent=hit
  607. rl=Instance.new("BodyAngularVelocity")
  608. rl.P=3000
  609. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  610. rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  611. rl.Parent=hit
  612. game:GetService("Debris"):AddItem(bodvol,.5)
  613. game:GetService("Debris"):AddItem(rl,.5)
  614. elseif Type=="Normal" then
  615. vp=Instance.new("BodyVelocity")
  616. vp.P=500
  617. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  618. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  619. if KnockbackType==1 then
  620. vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05
  621. elseif KnockbackType==2 then
  622. vp.velocity=Property.CFrame.lookVector*knockback
  623. end
  624. if knockback>0 then
  625. vp.Parent=hit.Parent.Torso
  626. end
  627. game:GetService("Debris"):AddItem(vp,.5)
  628. elseif Type=="Up" then
  629. local bodyVelocity=Instance.new("BodyVelocity")
  630. bodyVelocity.velocity=vt(0,30,0)
  631. bodyVelocity.P=5000
  632. bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  633. bodyVelocity.Parent=hit
  634. game:GetService("Debris"):AddItem(bodyVelocity,1)
  635. rl=Instance.new("BodyAngularVelocity")
  636. rl.P=3000
  637. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  638. rl.angularvelocity=Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  639. rl.Parent=hit
  640. game:GetService("Debris"):AddItem(rl,.5)
  641. elseif Type=="Snare" then
  642. bp=Instance.new("BodyPosition")
  643. bp.P=2000
  644. bp.D=100
  645. bp.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  646. bp.position=hit.Parent.Torso.Position
  647. bp.Parent=hit.Parent.Torso
  648. game:GetService("Debris"):AddItem(bp,1)
  649. elseif Type=="Charge" then
  650. Charge=Charge+1
  651. coroutine.resume(coroutine.create(function(Part)
  652. swait(30)
  653. for i=1,5 do
  654. swait(5)
  655. so("rbxasset://sounds\\unsheath.wav",hit,1,2)
  656. MagicCircle(BrickColor.new("Bright red"),hit.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),.2,2,.1,.2,8,.1,0.05)
  657. newdam=math.random(1,5)
  658. if blocked==false then
  659. h:TakeDamage(newdam)
  660. showDamage(hit.Parent,newdam,.5,BrickColor:Red())
  661. else
  662. h:TakeDamage(newdam/2)
  663. showDamage(hit.Parent,newdam,.5,BrickColor.new("Bright blue"))
  664. end
  665. end
  666. end),hit)
  667. end
  668. debounce=Instance.new("BoolValue")
  669. debounce.Name="DebounceHit"
  670. debounce.Parent=hit.Parent
  671. debounce.Value=true
  672. game:GetService("Debris"):AddItem(debounce,Delay)
  673. c=Instance.new("ObjectValue")
  674. c.Name="creator"
  675. c.Value=Player
  676. c.Parent=h
  677. game:GetService("Debris"):AddItem(c,.5)
  678. CRIT=false
  679. hitDeb=true
  680. AttackPos=6
  681. end
  682. end
  683. end
  684.  
  685. showDamage=function(Char,Dealt,du,Color)
  686. m=Instance.new("Model")
  687. m.Name=tostring(Dealt)
  688. h=Instance.new("Humanoid")
  689. h.Health=0
  690. h.MaxHealth=0
  691. h.Parent=m
  692. c=Instance.new("Part")
  693. c.Transparency=0
  694. c.BrickColor=Color
  695. c.Name="Head"
  696. c.TopSurface=0
  697. c.BottomSurface=0
  698. c.formFactor="Plate"
  699. c.Size=Vector3.new(1,.4,1)
  700. ms=Instance.new("CylinderMesh")
  701. ms.Scale=Vector3.new(.8,.8,.8)
  702. if CRIT==true then
  703. ms.Scale=Vector3.new(1,1.25,1)
  704. end
  705. ms.Parent=c
  706. c.Reflectance=0
  707. Instance.new("BodyGyro").Parent=c
  708. c.Parent=m
  709. if Char:findFirstChild("Head")~=nil then
  710. c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  711. elseif Char.Parent:findFirstChild("Head")~=nil then
  712. c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(0,1.5,0))
  713. end
  714. f=Instance.new("BodyPosition")
  715. f.P=2000
  716. f.D=100
  717. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  718. f.position=c.Position+Vector3.new(0,3,0)
  719. f.Parent=c
  720. game:GetService("Debris"):AddItem(m,.5+du)
  721. c.CanCollide=false
  722. m.Parent=workspace
  723. c.CanCollide=false
  724. end
  725.  
  726. combo=0
  727. local hold=false
  728. function ob1d(mouse)
  729. hold=true
  730. if attack==true then return end
  731. if combo==0 then
  732. combo=1
  733. --attackone()
  734. elseif combo==1 then
  735. combo=2
  736. --attacktwo()
  737. elseif combo==2 then
  738. combo=3
  739. --attackthree()
  740. elseif combo==3 then
  741. combo=4
  742. --attackfour()
  743. elseif combo==4 then
  744. combo=0
  745. end
  746. coroutine.resume(coroutine.create(function()
  747. for i=1,20 do
  748. if attack==false then
  749. swait()
  750. end
  751. end
  752. if attack==false then
  753. combo=0
  754. equipanim()
  755. end
  756. end))
  757. end
  758.  
  759. function ob1u(mouse)
  760. hold = false
  761. end
  762.  
  763. buttonhold = false
  764.  
  765. eul=0
  766. holdx=false
  767. equipped=false
  768. function key(key)
  769. if attack==true then return end
  770. if key=="f" then
  771. if equipped==false then
  772. equipped=true
  773. RSH=ch.Torso["Right Shoulder"]
  774. LSH=ch.Torso["Left Shoulder"]
  775. --
  776. RSH.Parent=nil
  777. LSH.Parent=nil
  778. --
  779. RW.Name="Right Shoulder"
  780. RW.Part0=ch.Torso
  781. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  782. RW.C1=cf(0, 0.5, 0)
  783. RW.Part1=ch["Right Arm"]
  784. RW.Parent=ch.Torso
  785. --
  786. LW.Name="Left Shoulder"
  787. LW.Part0=ch.Torso
  788. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  789. LW.C1=cf(0, 0.5, 0)
  790. LW.Part1=ch["Left Arm"]
  791. LW.Parent=ch.Torso
  792. --
  793. equipanim()
  794. else
  795. equipped=false
  796. hideanim()
  797. swait(0)
  798. RW.Parent=nil
  799. LW.Parent=nil
  800. RSH.Parent=player.Character.Torso
  801. LSH.Parent=player.Character.Torso
  802. end
  803. end
  804. if equipped==false then return end
  805. if key=="0" then
  806. Humanoid.WalkSpeed=(16*2)
  807. end
  808. end
  809.  
  810. function key2(key)
  811. if key=="0" then
  812. Humanoid.WalkSpeed=16
  813. end
  814. end
  815.  
  816. function s(mouse)
  817. mouse.Button1Down:connect(function() ob1d(mouse) end)
  818. mouse.Button1Up:connect(function() ob1u(mouse) end)
  819. mouse.KeyDown:connect(key)
  820. mouse.KeyUp:connect(key2)
  821.  
  822. player=Player
  823. ch=Character
  824. MMouse=mouse
  825. end
  826.  
  827. function ds(mouse)
  828. end
  829.  
  830. Bin.Selected:connect(s)
  831. Bin.Deselected:connect(ds)
  832. print("Fixer the Demon Mercenary loaded.")
  833.  
  834. local Anim="Idle"
  835. local idleanim=0
  836. local idleanim2=false
  837. while true do
  838. swait()
  839. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  840. if equipped==true then
  841. if idleanim>=0.5 then
  842. idleanim2=true
  843. elseif idleanim<=0 then
  844. idleanim2=false
  845. end
  846. if idleanim2==false then
  847. idleanim=idleanim+0.003
  848. else
  849. idleanim=idleanim-0.003
  850. end
  851. if RootPart.Velocity.y > 5 then
  852. Anim="Jump"
  853. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,0),.2)
  854. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(-0.4,0,0),.2)
  855. RH.C0=clerp(RH.C0,cf(1,-0.5,-1)*euler(-0.5,1.57,0),.2)
  856. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.7,-1.57,0),.2)
  857. end
  858. elseif RootPart.Velocity.y < -5 then
  859. Anim="Fall"
  860. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(-0.1,0,0),.2)
  861. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.4,0,0),.2)
  862. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0.4,1.57,0),.2)
  863. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.2,-1.57,0),.2)
  864. elseif torvel<1 then
  865. Anim="Idle"
  866. RH.C0=clerp(RH.C0,RHC0,.2)
  867. LH.C0=clerp(LH.C0,LHC0,.2)
  868. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2)
  869. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.2)
  870. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(idleanim,0,0.5-idleanim),.2)
  871. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(idleanim,0,-0.5+idleanim),.2)
  872. elseif torvel>2 and torvel<22 then
  873. Anim="Walk"
  874. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2)
  875. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.2)
  876. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.5,0,0),.2)
  877. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.5,0,0),.2)
  878. elseif torvel>=22 then
  879. Anim="Run"
  880. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.5,0,0),.3)
  881. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(-0.3,0,0),.3)
  882. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1,0,0),.3)
  883. LW.C0=clerp(LW.C0,cf(-1,0.5,-0.5)*euler(1.57,0,1),.3)
  884. end
  885. end
  886. if #Effects>0 then
  887. --table.insert(Effects,{prt,"Block1",delay})
  888. for e=1,#Effects do
  889. if Effects[e]~=nil then
  890. --for j=1,#Effects[e] do
  891. local Thing=Effects[e]
  892. if Thing~=nil then
  893. local Part=Thing[1]
  894. local Mode=Thing[2]
  895. local Delay=Thing[3]
  896. local IncX=Thing[4]
  897. local IncY=Thing[5]
  898. local IncZ=Thing[6]
  899. if Thing[1].Transparency<=1 then
  900. if Thing[2]=="Block1" then
  901. Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  902. Mesh=Thing[1].Mesh
  903. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  904. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  905. elseif Thing[2]=="Cylinder" then
  906. Mesh=Thing[1].Mesh
  907. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  908. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  909. elseif Thing[2]=="Elec" then
  910. Mesh=Thing[1].Mesh
  911. Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
  912. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  913. end
  914. else
  915. Part.Parent=nil
  916. table.remove(Effects,e)
  917. end
  918. end
  919. --end
  920. end
  921. end
  922. end
  923. --[[
  924. Copyrighted (C) Fenrier 2014
  925. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement