Advertisement
DerpzDeNugget

ack

Aug 10th, 2018
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 65.64 KB | None | 0 0
  1. local p = game.Players.LocalPlayer
  2. local char = p.Character
  3. local mouse = p:GetMouse()
  4. local larm = char["Left Arm"]
  5. local rarm = char["Right Arm"]
  6. local lleg = char["Left Leg"]
  7. local rleg = char["Right Leg"]
  8. local hed = char.Head
  9. local Torso = char.Torso
  10. local hum = char.Humanoid
  11. local cam = game.Workspace.CurrentCamera
  12. local root = char.HumanoidRootPart
  13. local deb = false
  14. local shot = 0
  15. local potential = false
  16. local debris=game:service"Debris"
  17. local l = game:GetService("Lighting")
  18. local rs = game:GetService("RunService").RenderStepped
  19. ptz = {0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1}
  20. math.randomseed(os.time())
  21. for i,v in pairs(char:children()) do
  22. if v:IsA("Accessory") then
  23. v:Destroy()
  24. end
  25. end
  26. char["Body Colors"].HeadColor = BrickColor.new("1003")
  27. char["Body Colors"].LeftArmColor = BrickColor.new("1003")
  28. char["Body Colors"].RightArmColor = BrickColor.new("1003")
  29. char["Body Colors"].TorsoColor = BrickColor.new("1003")
  30. char["Body Colors"].RightLegColor = BrickColor.new("1003")
  31. char["Body Colors"].LeftLegColor = BrickColor.new("1003")
  32. Player=game:GetService("Players").LocalPlayer
  33. Character=Player.Character
  34. PlayerGui=Player.PlayerGui
  35. Backpack=Player.Backpack
  36. Torso=Character.Torso
  37. Head=Character.Head
  38. Humanoid=Character.Humanoid
  39. Mouse=Player:GetMouse()
  40. RootPart = Character.HumanoidRootPart
  41. RootJoint = RootPart.RootJoint
  42. LeftArm=Character["Left Arm"]
  43. LeftLeg=Character["Left Leg"]
  44. RightArm=Character["Right Arm"]
  45. RightLeg=Character["Right Leg"]
  46. LS=Torso["Left Shoulder"]
  47. LH=Torso["Left Hip"]
  48. RS=Torso["Right Shoulder"]
  49. RH=Torso["Right Hip"]
  50. Neck=Torso.Neck
  51. it=Instance.new
  52. vt=Vector3.new
  53. cf=CFrame.new
  54. euler=CFrame.fromEulerAnglesXYZ
  55. angles=CFrame.Angles
  56. local decreaseatk=0
  57. local decreasedef=0
  58. local decreasemvmt=0
  59. local Anim="Idle"
  60. local Effects={}
  61. local armorparts={}
  62. local armorwelds={}
  63. local weaponparts={}
  64. local weaponwelds={}
  65. local necko=euler(0,0,0)*cf(0,1,0)
  66. local attack=false
  67. local jump=false
  68. local start=false
  69. local move=10
  70. local hitfloor,posfloor=nil,nil
  71. local run=Instance.new("NumberValue")
  72. run.Name="DecreaseMvmt"
  73. run.Value=-1.2
  74. local bName="Sthomas"
  75. local MainColor=BrickColor.new("Black")
  76. local SubColor=BrickColor.new("Bright blue")
  77. --[[if script:findFirstChild("SiegmundHealth")~=nil then
  78. for _,c in pairs(game.Players:children()) do
  79. d=script.SiegmundHealth:Clone()
  80. d.Parent=c.PlayerGui
  81. end
  82. end]]
  83.  
  84.  
  85.  
  86.  
  87. function NoOutline(Part)
  88. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  89. end
  90. Character.Animate:Remove()
  91.  
  92. Character.Humanoid.Animator:Remove()
  93. local Create = LoadLibrary("RbxUtility").Create
  94.  
  95.  
  96.  
  97. frame = 1 / 30
  98. tf = 0
  99. allowframeloss = false
  100. tossremainder = false
  101. lastframe = tick()
  102.  
  103.  
  104. function swait(num)
  105. if num == 0 or num == nil then
  106. else
  107. for i = 0, num do
  108. end
  109. end
  110. end
  111.  
  112. --[[frame,t,lastframe = 1/30,0,tick()
  113. allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame*2 or greater.
  114. tossremainder = false --if set to true t will be set to 0 after Fire()-ing.
  115.  
  116. swait = function(dt)
  117. if dt == nil then
  118. dt = frame
  119. elseif dt < frame then
  120. dt = frame
  121. elseif dt > frame then
  122. --round this out into frames
  123. dt = math.floor(dt/frame)
  124. end
  125. local timetomeet = tick() + dt
  126. end]] --maybe later
  127.  
  128. --30hz Pacemaker
  129.  
  130.  
  131. frame = 1/30
  132. tf = 0
  133. allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame*2 or greater.
  134. tossremainder = false --if set to true t will be set to 0 after Fire()-ing.
  135. lastframe = tick()
  136.  
  137.  
  138. function clerp(a,b,t)
  139. local qa = {QuaternionFromCFrame(a)}
  140. local qb = {QuaternionFromCFrame(b)}
  141. local ax, ay, az = a.x, a.y, a.z
  142. local bx, by, bz = b.x, b.y, b.z
  143. local _t = 1-t
  144. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  145. end
  146.  
  147. function QuaternionFromCFrame(cf)
  148. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  149. local trace = m00 + m11 + m22
  150. if trace > 0 then
  151. local s = math.sqrt(1 + trace)
  152. local recip = 0.5/s
  153. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  154. else
  155. local i = 0
  156. if m11 > m00 then
  157. i = 1
  158. end
  159. if m22 > (i == 0 and m00 or m11) then
  160. i = 2
  161. end
  162. if i == 0 then
  163. local s = math.sqrt(m00-m11-m22+1)
  164. local recip = 0.5/s
  165. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  166. elseif i == 1 then
  167. local s = math.sqrt(m11-m22-m00+1)
  168. local recip = 0.5/s
  169. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  170. elseif i == 2 then
  171. local s = math.sqrt(m22-m00-m11+1)
  172. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  173. end
  174. end
  175. end
  176.  
  177. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  178. local xs, ys, zs = x + x, y + y, z + z
  179. local wx, wy, wz = w*xs, w*ys, w*zs
  180. local xx = x*xs
  181. local xy = x*ys
  182. local xz = x*zs
  183. local yy = y*ys
  184. local yz = y*zs
  185. local zz = z*zs
  186. 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))
  187. end
  188.  
  189. function QuaternionSlerp(a, b, t)
  190. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  191. local startInterp, finishInterp;
  192. if cosTheta >= 0.0001 then
  193. if (1 - cosTheta) > 0.0001 then
  194. local theta = math.acos(cosTheta)
  195. local invSinTheta = 1/math.sin(theta)
  196. startInterp = math.sin((1-t)*theta)*invSinTheta
  197. finishInterp = math.sin(t*theta)*invSinTheta
  198. else
  199. startInterp = 1-t
  200. finishInterp = t
  201. end
  202. else
  203. if (1+cosTheta) > 0.0001 then
  204. local theta = math.acos(-cosTheta)
  205. local invSinTheta = 1/math.sin(theta)
  206. startInterp = math.sin((t-1)*theta)*invSinTheta
  207. finishInterp = math.sin(t*theta)*invSinTheta
  208. else
  209. startInterp = t-1
  210. finishInterp = t
  211. end
  212. end
  213. 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
  214. end
  215.  
  216. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  217. local fp=it("Part")
  218. fp.formFactor=formfactor
  219. fp.Parent=parent
  220. fp.Reflectance=reflectance
  221. fp.Transparency=transparency
  222. fp.CanCollide=false
  223. fp.Locked=true
  224. fp.BrickColor=brickcolor
  225. fp.Name=name
  226. fp.Size=size
  227. NoOutline(fp)
  228. fp.Material="SmoothPlastic"
  229. fp:BreakJoints()
  230. return fp
  231. end
  232.  
  233. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  234. local mesh=it(Mesh)
  235. mesh.Parent=part
  236. if Mesh=="SpecialMesh" then
  237. mesh.MeshType=meshtype
  238. if meshid~="nil" then
  239. mesh.MeshId="http://www.roblox.com/asset/?id="..meshid
  240. end
  241. end
  242. mesh.Offset=offset
  243. mesh.Scale=scale
  244. return mesh
  245. end
  246.  
  247. function weld(parent,part0,part1,c0)
  248. local weld=it("Motor")
  249. weld.Parent=parent
  250. weld.Part0=part0
  251. weld.Part1=part1
  252. weld.C0=c0
  253. return weld
  254. end
  255.  
  256. function gui(GuiType,parent,text,backtrans,backcol,pos,size,image)
  257. local gui=it(GuiType)
  258. gui.Parent=parent
  259. gui.BackgroundTransparency=backtrans
  260. gui.BackgroundColor3=backcol
  261. gui.SizeConstraint="RelativeXY"
  262. gui.Position=pos
  263. gui.Size=size
  264. if GuiType=="TextLabel" then
  265. gui.Text=text
  266. gui.TextXAlignment="Center"
  267. gui.TextYAlignment="Center"
  268. gui.Font="SourceSans"
  269. gui.FontSize="Size14"
  270. gui.TextWrapped=false
  271. gui.TextStrokeTransparency=0
  272. gui.TextColor=BrickColor.new("White")
  273. elseif GuiType=="ImageLabel" then
  274. gui.Image="rbxassetid://"..image
  275. gui.ImageColor3=backcol
  276. end
  277. return gui
  278. end
  279.  
  280. local Characte=Instance.new("Model")
  281. Characte.Parent=Character
  282. Characte.Name=bName
  283.  
  284.  
  285. --local Torso=part(0,Character,0,0,MainColor,"Torso",vt(2,2,1))
  286. local Torsoc=part(0,Character,0,0,SubColor,"Torso Copy",vt(2,2,1))
  287. --local LeftArm=part(0,Character,0,0,MainColor,"Left Arm",vt(1,2,1))
  288. local LeftArmc=part(0,Character,0,0,SubColor,"Left Arm Copy",vt(1,2,1))
  289. --local RightArm=part(0,Character,0,0,MainColor,"Right Arm",vt(1,2,1))
  290. local RightArmc=part(0,Character,0,0,SubColor,"Right Arm Copy",vt(1,2,1))
  291. --local LeftLeg=part(0,Character,0,0,MainColor,"Left Leg",vt(1,2,1))
  292. local LeftLegc=part(0,Character,0,0,SubColor,"Left Leg Copy",vt(1,2,1))
  293. --local RightLeg=part(0,Character,0,0,MainColor,"Right Leg",vt(1,2,1))
  294. local RightLegc=part(0,Character,0,0,SubColor,"Right Leg Copy",vt(1,2,1))
  295.  
  296.  
  297. --local Head=part(0,Character,0,0,BrickColor.new("Pastel brown"),"Head",vt(2,1,1))
  298. --[[local Torso=part(0,Character,0,0,MainColor,"Torso",vt(2,2,1))
  299. local Torsoc=part(0,Character,0,0,SubColor,"Torso Copy",vt(2,2,1))
  300. local LeftArm=part(0,Character,0,0,SubColor,"Left Arm",vt(1,2,1))
  301. local LeftArmc=part(0,Character,0,0,MainColor,"Left Arm Copy",vt(1,2,1))
  302. local RightArm=part(0,Character,0,0,SubColor,"Right Arm",vt(1,2,1))
  303. local RightArmc=part(0,Character,0,0,MainColor,"Right Arm Copy",vt(1,2,1))
  304. local LeftLeg=part(0,Character,0,0,SubColor,"Left Leg",vt(1,2,1))
  305. local LeftLegc=part(0,Character,0,0,MainColor,"Left Leg Copy",vt(1,2,1))
  306. local RightLeg=part(0,Character,0,0,SubColor,"Right Leg",vt(1,2,1))
  307. local RightLegc=part(0,Character,0,0,MainColor,"Right Leg Copy",vt(1,2,1))]]
  308. --local RootPart=part(0,Character,0,1,MainColor,"HumanoidRootPart",vt(2,2,1))
  309. local Cape=part(0,Character,0,0,BrickColor.new("Bright blue"),"Hat",vt())
  310. Head.CanCollide=true
  311. Torso.CanCollide=true
  312. LeftArm.CanCollide=true
  313. RightArm.CanCollide=true
  314. LeftLeg.CanCollide=true
  315. RightLeg.CanCollide=true
  316. RootPart.CanCollide=false
  317. Head.face:Remove()
  318. face=Instance.new("Decal",Head)
  319. face.Face="Front"
  320. --face.Texture="http://www.roblox.com/asset/?id="
  321. face.Texture="http://www.roblox.com/asset/?id="
  322.  
  323. local HMesh=mesh("SpecialMesh",Head,"Head","nil",vt(0,0,0),vt(1.25,1.25,1.25))
  324. local TMsh=mesh("SpecialMesh",Torso,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(1.8,1,.8))
  325. local LAMsh=mesh("SpecialMesh",LeftArm,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,.8,.8))
  326. local RAMsh=mesh("SpecialMesh",RightArm,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,.8,.8))
  327. local LLMsh=mesh("SpecialMesh",LeftLeg,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,1,.8))
  328. local RLMsh=mesh("SpecialMesh",RightLeg,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,1,.8))
  329. local TcMsh=mesh("SpecialMesh",Torsoc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-2,-1,-1))
  330. local LAcMsh=mesh("SpecialMesh",LeftArmc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1,-1))
  331. local RAcMsh=mesh("SpecialMesh",RightArmc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1,-1))
  332. local LLcMsh=mesh("SpecialMesh",LeftLegc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1.2,-1))
  333. local RLcMsh=mesh("SpecialMesh",RightLegc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1.2,-1))
  334. TMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  335. LAMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  336. RAMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  337. LLMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  338. RLMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  339. TcMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  340. LAcMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  341. RAcMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  342. LLcMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  343. RLcMsh.MeshId="rbxasset://fonts/leftarm.mesh"
  344. local Cmsh=mesh("SpecialMesh",Cape,"FileMesh","http://www.roblox.com/asset/?id=250281794",vt(0,0,0),vt(1,1,1))
  345.  
  346. --[[local Neck=weld(Torso,Torso,Head,cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
  347. Neck.C1=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)]]
  348. local Neck=weld(Torso,Torso,Head,euler(0,0,0)*cf(0,1,0))
  349. Neck.C1=cf(0,-.5,0)
  350. local RW=weld(Torso,Torso,RightArm,cf(1.5,.5,0))
  351. RW.C1=cf(0,.5,0)
  352. local RWc=weld(Torso,RightArm,RightArmc,cf(0,0,0))
  353. local LW=weld(Torso,Torso,LeftArm,cf(-1.5,.5,0))
  354. LW.C1=cf(0,.5,0)
  355. local LWc=weld(Torso,LeftArm,LeftArmc,cf(0,0,0))
  356. local RH=weld(Torso,Torso,RightLeg,cf(.5,-1,0))
  357. RH.C1=cf(0,1,0)
  358. local RHc=weld(Torso,RightLeg,RightLegc,cf(0,0,0))
  359. local LH=weld(Torso,Torso,LeftLeg,cf(-.5,-1,0))
  360. LH.C1=cf(0,1,0)
  361. local LHc=weld(Torso,LeftLeg,LeftLegc,cf(0,0,0))
  362. local RootJoint=weld(Torso,Torso,RootPart,cf(0,0,0))
  363. local RootJointc=weld(Torso,Torso,Torsoc,cf(0,0,0))
  364. --local Cwld=weld(Torso,Cape,Head,euler(0,0,0)*cf(0,2,-.3))
  365. local Cwld=weld(Torso,Cape,Torso,euler(0,0,0)*cf(0,.5,-.3))
  366. --Torso.CFrame=cf(math.random(-5000,5000)/100,math.random(-5000,5000)/100,math.random(-5000,5000)/100)
  367. --Torso.CFrame=cf(0,0,0)
  368. --Torso.CFrame=workspace.Map.BossSpawn.CFrame*cf(0,5,0)
  369.  
  370. local hitbox=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  371. --hitbox.Anchored=true
  372. local hitbox2=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  373. hitbox2.Anchored=true
  374. local hitboxCF=cf(0,0,0)
  375.  
  376. --[[local Humanoid=Instance.new("Humanoid")
  377. Humanoid.Parent=Character
  378. TehHealth=700
  379. --TehHealth=2000
  380. Humanoid.MaxHealth=TehHealth
  381. Humanoid.Health=TehHealth
  382. coroutine.resume(coroutine.create(function()
  383. for i=1,20 do
  384. wait()
  385. Humanoid.Health=Humanoid.MaxHealth
  386. end
  387. Humanoid:TakeDamage(1)
  388. end))]]
  389. local Stats=Instance.new("BoolValue")
  390. Stats.Name="Stats"
  391. Stats.Parent=Character
  392. local Atk=Instance.new("NumberValue")
  393. Atk.Name="Damage"
  394. Atk.Parent=Stats
  395. Atk.Value=1
  396. local Def=Instance.new("NumberValue")
  397. Def.Name="Defense"
  398. Def.Parent=Stats
  399. Def.Value=1
  400. local Mvmt=Instance.new("NumberValue")
  401. Mvmt.Name="Movement"
  402. Mvmt.Parent=Stats
  403. Mvmt.Value=1
  404. local Block=Instance.new("BoolValue")
  405. Block.Name="Block"
  406. Block.Parent=Stats
  407. Block.Value=false
  408. local Stun=Instance.new("NumberValue")
  409. Stun.Name="Stun"
  410. Stun.Parent=Stats
  411. Stun.Value=0
  412. local StunT=Instance.new("NumberValue")
  413. StunT.Name="StunThreshold"
  414. StunT.Parent=Stats
  415. StunT.Value=100
  416. local Rooted=Instance.new("BoolValue")
  417. Rooted.Name="Rooted"
  418. Rooted.Parent=Stats
  419. Rooted.Value=false
  420. local Stunned=Instance.new("BoolValue")
  421. Stunned.Name="Stunned"
  422. Stunned.Parent=Stats
  423. Stunned.Value=false
  424. local Stagger=Instance.new("BoolValue")
  425. Stagger.Name="Stagger"
  426. Stagger.Parent=Stats
  427. Stagger.Value=false
  428. local StaggerHit=Instance.new("BoolValue")
  429. StaggerHit.Name="StaggerHit"
  430. StaggerHit.Parent=Stats
  431. StaggerHit.Value=false
  432. local RecentEnemy=Instance.new("ObjectValue")
  433. RecentEnemy.Name="RecentEnemy"
  434. RecentEnemy.Parent=Stats
  435. RecentEnemy.Value=nil
  436. local Decrease=Instance.new("BoolValue")
  437. Decrease.Name="Decrease"
  438. Decrease.Parent=Stats
  439. Decrease.Value=false
  440. local mana=Instance.new("NumberValue")
  441. mana.Name="Mana"
  442. mana.Parent=Stats
  443. mana.Value=0
  444. local boss=Instance.new("BoolValue")
  445. boss.Name="Boss"
  446. boss.Parent=Stats
  447. boss.Value=true
  448. local alive=Instance.new("BoolValue")
  449. alive.Name="Alive"
  450. alive.Parent=Character
  451. alive.Value=true
  452. local btarget=Instance.new("ObjectValue")
  453. btarget.Name="Target"
  454. btarget.Parent=Stats
  455. btarget.Value=nil
  456. local passive1=Instance.new("NumberValue",Decrease)
  457. passive1.Name="DecreaseAtk"
  458. passive1.Value=-.4
  459. local passive2=Instance.new("NumberValue",Decrease)
  460. passive2.Name="DecreaseDef"
  461. passive2.Value=-.1
  462. local passive3=Instance.new("NumberValue",Decrease)
  463. passive3.Name="DecreaseMvmt"
  464. passive3.Value=.1
  465.  
  466. so = function(id,par,vol,pit)
  467. local sou = Instance.new("Sound",par or workspace)
  468. sou.Volume=1.5
  469. sou.Pitch=pit or 1
  470. sou.SoundId="http://www.roblox.com/asset/?id="..id
  471. --swait()
  472. sou:play()
  473. game:GetService("Debris"):AddItem(sou,6)
  474. end
  475.  
  476. local function CFrameFromTopBack(at, top, back)
  477. local right = top:Cross(back)
  478. return CFrame.new(at.x, at.y, at.z,
  479. right.x, top.x, back.x,
  480. right.y, top.y, back.y,
  481. right.z, top.z, back.z)
  482. end
  483.  
  484. function Triangle(a, b, c)
  485. local edg1 = (c-a):Dot((b-a).unit)
  486. local edg2 = (a-b):Dot((c-b).unit)
  487. local edg3 = (b-c):Dot((a-c).unit)
  488. if edg1 <= (b-a).magnitude and edg1 >= 0 then
  489. a, b, c = a, b, c
  490. elseif edg2 <= (c-b).magnitude and edg2 >= 0 then
  491. a, b, c = b, c, a
  492. elseif edg3 <= (a-c).magnitude and edg3 >= 0 then
  493. a, b, c = c, a, b
  494. else
  495. assert(false, "unreachable")
  496. end
  497.  
  498. local len1 = (c-a):Dot((b-a).unit)
  499. local len2 = (b-a).magnitude - len1
  500. local width = (a + (b-a).unit*len1 - c).magnitude
  501.  
  502. local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit)
  503.  
  504. local list = {}
  505.  
  506. if len1 > 0.01 then
  507. local w1 = Instance.new('WedgePart', m)
  508. w1.Name = "Triangle"
  509. game:GetService("Debris"):AddItem(w1,5)
  510. w1.Material = "SmoothPlastic"
  511. w1.FormFactor = 'Custom'
  512. w1.BrickColor = BrickColor.new("Teal")
  513. w1.Transparency = 0
  514. w1.Reflectance = 0
  515. w1.Material = "SmoothPlastic"
  516. w1.CanCollide = false
  517. NoOutline(w1)
  518. local sz = Vector3.new(0.2, width, len1)
  519. w1.Size = sz
  520. local sp = Instance.new("SpecialMesh",w1)
  521. sp.MeshType = "Wedge"
  522. sp.Scale = Vector3.new(0,1,1) * sz/w1.Size
  523. w1:BreakJoints()
  524. w1.Anchored = true
  525. w1.Parent = workspace
  526. w1.Transparency = 0.7
  527. table.insert(Effects,{w1,"Disappear",.05})
  528. w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  529. table.insert(list,w1)
  530. end
  531.  
  532. if len2 > 0.01 then
  533. local w2 = Instance.new('WedgePart', m)
  534. w2.Name = "Triangle"
  535. game:GetService("Debris"):AddItem(w2,5)
  536. w2.Material = "SmoothPlastic"
  537. w2.FormFactor = 'Custom'
  538. w2.BrickColor = BrickColor.new("Teal")
  539. w2.Transparency = 0
  540. w2.Reflectance = 0
  541. w2.Material = "SmoothPlastic"
  542. w2.CanCollide = false
  543. NoOutline(w2)
  544. local sz = Vector3.new(0.2, width, len2)
  545. w2.Size = sz
  546. local sp = Instance.new("SpecialMesh",w2)
  547. sp.MeshType = "Wedge"
  548. sp.Scale = Vector3.new(0,1,1) * sz/w2.Size
  549. w2:BreakJoints()
  550. w2.Anchored = true
  551. w2.Parent = workspace
  552. w2.Transparency = 0.7
  553. table.insert(Effects,{w2,"Disappear",.05})
  554. w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  555. table.insert(list,w2)
  556. end
  557. return unpack(list)
  558. end
  559.  
  560. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,Type)
  561. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  562. prt.Anchored=true
  563. prt.CFrame=cframe
  564. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  565. game:GetService("Debris"):AddItem(prt,3)
  566. if Type==1 or Type==nil then
  567. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3,msh})
  568. elseif Type==2 then
  569. table.insert(Effects,{prt,"Block2",delay,x3,y3,z3,msh})
  570. end
  571. end
  572.  
  573. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  574. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  575. prt.Anchored=true
  576. prt.CFrame=cframe
  577. local msh=mesh("SpecialMesh",prt,"Sphere","nil",vt(0,0,0),vt(x1,y1,z1))
  578. game:GetService("Debris"):AddItem(prt,3)
  579. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  580. end
  581.  
  582. function MagicCircle2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  583. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  584. prt.Anchored=true
  585. prt.CFrame=cframe
  586. local msh=mesh("SpecialMesh",prt,"Sphere","nil",vt(0,0,0),vt(x1,y1,z1))
  587. game:GetService("Debris"):AddItem(prt,3)
  588. table.insert(Effects,{prt,"Cylinder2",delay,x3,y3,z3,msh})
  589. end
  590.  
  591. function MagicRing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  592. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  593. prt.Anchored=true
  594. prt.CFrame=cframe*cf(x2,y2,z2)
  595. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
  596. game:GetService("Debris"):AddItem(prt,3)
  597. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  598. end
  599.  
  600. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  601. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  602. prt.Anchored=true
  603. prt.CFrame=cframe
  604. local msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  605. game:GetService("Debris"):AddItem(prt,3)
  606. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  607. end
  608.  
  609. function MagicCylinder3(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  610. local prt=part(3,Character,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  611. prt.Anchored=true
  612. prt.CFrame=cframe
  613. local msh=mesh("SpecialMesh",prt,"Head","nil",vt(0,0,0),vt(x1,y1,z1))
  614. game:GetService("Debris"):AddItem(prt,3)
  615. table.insert(Effects,{prt,"Cylinder2",delay,x3,y3,z3,msh})
  616. end
  617.  
  618. function MagicHead(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  619. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  620. prt.Anchored=true
  621. prt.CFrame=cframe
  622. local msh=mesh("SpecialMesh",prt,"Head","nil",vt(0,0,0),vt(x1,y1,z1))
  623. game:GetService("Debris"):AddItem(prt,3)
  624. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  625. end
  626.  
  627. function ClangEffect(brickcolor,cframe,duration,decrease,size,power)
  628. local prt=part(3,workspace,0,1,brickcolor,"Effect",vt(.2,.2,.2))
  629. prt.Anchored=true
  630. prt.CFrame=cframe
  631. local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(5,5,5))
  632. game:GetService("Debris"):AddItem(prt,3)
  633. table.insert(Effects,{prt,"CylinderClang",duration,decrease,size,power,prt.CFrame,nil})
  634. end
  635.  
  636. function MagicWave(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  637. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2))
  638. prt.Anchored=true
  639. prt.CFrame=cframe
  640. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=20329976",vt(0,0,0),vt(x1,y1,z1))
  641. game:GetService("Debris"):AddItem(prt,3)
  642. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  643. end
  644.  
  645. --[[local BodGy=Instance.new("BodyGyro")
  646. BodGy.maxTorque=Vector3.new(0,4e+005,0)
  647. BodGy.P=2000
  648. BodGy.D=100
  649. BodGy.Name="SiegmundGyro"
  650. CF=RootPart.CFrame
  651. BodGy.Parent=RootPart
  652. BodGy.cframe=CF]]
  653.  
  654. --[[Neck.C0=euler(0,0,0)*cf(0,3,0)*euler(0,.6,0)*euler(-.2,0,0)
  655. RootJoint.C0=cf(0,-2,0)*euler(0,.6,0)
  656. RW.C0=cf(4.5,1.5,0)*euler(-.4,0,.5)*euler(0,0,0)
  657. RW.C1=cf(0,1.5,0)*euler(0,0,0)
  658. LW.C0=cf(-4.5,1.5,0)*euler(.2,0,-.5)
  659. LW.C1=cf(0,1.5,0)*euler(0,0,0)
  660. RH.C0=cf(1.5,-3,0)*euler(0,-.6,0)*euler(0,0,.1)
  661. RH.C1=cf(0,3,0)*euler(0,0,0)
  662. LH.C0=cf(-1.5,-3,0)*euler(0,.6,0)*euler(.1,0,0)
  663. LH.C1=cf(0,3,0)*euler(0,0,0)]]
  664.  
  665. --[[RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3,0,0.5),.3)
  666. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.2),.3)
  667. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.4,0,0),.3)
  668. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-1)*euler(0,0,0),.3)
  669. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(-1.2,1.57,0),.3)
  670. LH.C0=clerp(LH.C0,cf(-1.1,-.5,-0.5)*euler(-0.2,-1.3,0),.3)]]
  671. function StartAnim()
  672. attack=true
  673. --workspace.CurrentCamera.CameraSubject=Head
  674. Neck.C0=necko*euler(-0.4,0,0)
  675. RootJoint.C0=euler(.2,0,0)
  676. RW.C0=cf(1.5,0.5,0)*euler(-.3,0,0.2)
  677. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  678. LW.C0=cf(-1.5,0.5,0)*euler(-.3,0,-0.2)
  679. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  680. RH.C0=cf(.5,-1,0)*euler(0.4,1.57,0)
  681. LH.C0=cf(-.5,-1,0)*euler(-0.2,-1.57,0)
  682. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,10,Character)
  683. while hitfloor==nil do
  684. swait()
  685. end
  686. print("endderp")
  687. so("http://roblox.com/asset/?id=157878578",Torso,1,0.8)
  688. so("http://roblox.com/asset/?id=2760979",Torso,1,0.4)
  689. MagicWave(BrickColor.new("Medium stone grey"),cf(Torso.Position)*cf(0,-1,0),1,1,1,1.5,1,1.5,0.05)
  690. --MagniDamage(Torso,15,6,8,math.random(20,40),"Knockdown2",Torso,0,1,math.random(8,10),nil,nil,true)
  691. for i=0,1,0.05 do
  692. swait()
  693. Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3)
  694. RootJoint.C0=clerp(RootJoint.C0,cf(0,1,0)*euler(0,0,0),.3)
  695. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.2),.3)
  696. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.2),.3)
  697. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(-1.2,1.57,0),.3)
  698. LH.C0=clerp(LH.C0,cf(-.6,-.5,-0.5)*euler(-0.2,-1.3,0),.3)
  699. end
  700. attack=false
  701. end
  702. --[[RW.C0=cf(1.5,0.5,0)*euler(0,0,1.2)
  703. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-1.2)
  704. Neck.C0=necko*euler(-.4,0,0)
  705. RootJoint.C0=cf(0,1,0)*euler(0,0,0)
  706. RH.C0=cf(1,-1,0)*euler(-1.2,1.57,0)
  707. LH.C0=cf(-1.1,-.5,-0.5)*euler(-0.2,-1.3,0)]]
  708.  
  709. local BodGy=Instance.new("BodyGyro")
  710. BodGy.maxTorque=Vector3.new(0,4e+005,0)
  711. BodGy.P=2000
  712. BodGy.D=100
  713. BodGy.Name="SthomasGyro"
  714. CF=RootPart.CFrame
  715. BodGy.Parent=RootPart
  716. BodGy.cframe=CF
  717.  
  718. wait()
  719. print("Sthomas spawned.")
  720.  
  721. function StunAnim()
  722. attack=true
  723. Stunned.Value=true
  724. showDamage(Character,"Stunned","Interrupt")
  725. local dec=Instance.new("NumberValue",Decrease)
  726. dec.Name="DecreaseMvmt"
  727. dec.Value=10
  728. for i=0,1,0.3 do
  729. swait()
  730. Neck.C0=clerp(Neck.C0,necko*euler(-.2,.5,0),.2)
  731. RootJoint.C0=clerp(RootJoint.C0,euler(-.2,3,0),.2)
  732. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,1.3),.2)
  733. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  734. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1,0,.4)*euler(0,-.1,0),.2)
  735. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  736. RH.C0=clerp(RH.C0,cf(.5,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.3),.25)
  737. LH.C0=clerp(LH.C0,cf(-.5,-.8,0)*euler(0,-1.57,0)*euler(-.2,0,0),.25)
  738. end
  739. for i=0,1,0.3 do
  740. swait()
  741. Neck.C0=clerp(Neck.C0,necko*euler(-.3,.5,0),.2)
  742. RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-.5)*euler(-.8,3,0),.2)
  743. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2)
  744. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  745. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1.2,0,.8)*euler(0,-.1,0),.2)
  746. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  747. RH.C0=clerp(RH.C0,cf(.5,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.6),.25)
  748. LH.C0=clerp(LH.C0,cf(-.5,-.8,0)*euler(0,-1.57,0)*euler(.1,0,.7),.25)
  749. end
  750. for i=0,1,0.3 do
  751. swait()
  752. Neck.C0=clerp(Neck.C0,necko*euler(-.3,-1,0),.2)
  753. RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-2)*euler(-1.57,3,0),.2)
  754. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2)
  755. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  756. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,-.8)*euler(0,-.1,0),.2)
  757. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  758. RH.C0=clerp(RH.C0,cf(.5,-.6,0)*euler(0,1.57,0)*euler(-.2,0,.6),.25)
  759. LH.C0=clerp(LH.C0,cf(-.5,-.8,0)*euler(0,-1.57,0)*euler(-.1,0,.3),.25)
  760. end
  761. local gairost=Instance.new("BodyGyro")
  762. gairost.Parent=RootPart
  763. gairost.maxTorque=Vector3.new(4e+005,0,4e+005)*math.huge
  764. gairost.P=20e+003
  765. gairost.cframe=cf(0,0,0)
  766. for i=0,1,0.1 do
  767. swait()
  768. Neck.C0=clerp(Neck.C0,necko*euler(0,-1.57,0),.3)
  769. RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-2.5)*euler(-1.57,3.14,0),.3)
  770. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1.5)*euler(.2,0,0),.3)
  771. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  772. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.5,0,-1.57)*euler(0,0,0),.3)
  773. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  774. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.3,.5,0),.3)
  775. LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(-.1,.2,0),.3)
  776. end
  777. for i=1,200 do
  778. swait()
  779. gairost.cframe=RootPart.CFrame
  780. end
  781. for i=0,1,0.2 do
  782. swait()
  783. Stun.Value=0
  784. gairost.cframe=RootPart.CFrame
  785. Neck.C0=clerp(Neck.C0,necko*euler(0,.2,0),.3)
  786. RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-2)*euler(-1,4,0),.3)
  787. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1)*euler(.2,-1,0),.3)
  788. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  789. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,.2)*euler(0,0,0),.3)
  790. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  791. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.3,.5,.4),.3)
  792. LH.C0=clerp(LH.C0,cf(-.5,-1,-1)*euler(0,-1.57,0)*euler(-.1,.2,1),.3)
  793. end
  794. gairost.Parent=nil
  795. dec.Parent=nil
  796. Stun.Value=0
  797. Stunned.Value=false
  798. attack=false
  799. for i=1,10 do
  800. swait()
  801. Stun.Value=0
  802. end
  803. end
  804.  
  805. function PunchSlam()
  806. attack=true
  807. for i=0,1,0.1 do
  808. swait()
  809. Neck.C0=clerp(Neck.C0,necko*euler(0,-.5,0)*euler(-.2,0,0),.3)
  810. RootJoint.C0=clerp(RootJoint.C0,euler(0,-.5,0)*euler(.1,0,0)*cf(0,.2,0),.3)
  811. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(.2,0,.8)*euler(0,0,0),.3)
  812. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  813. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.4,0,.5)*euler(0,0,0),.3)
  814. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  815. RH.C0=clerp(RH.C0,cf(.6,-.9,-.2)*euler(0,1.57,0)*euler(0,-.5,-.05),.3)
  816. LH.C0=clerp(LH.C0,cf(-.6,-.8,-.2)*euler(0,-1.57,0)*euler(0,0,.4),.3)
  817. end
  818. Torso.Velocity=RootPart.CFrame.lookVector*move*3
  819. so("169445092",LeftArm,1,1.2)
  820. for i=0,1,0.1 do
  821. swait()
  822. MagniDamage(LeftArm,2,8,10,0,"Knockdown2",RootPart,.2,2,math.random(6,7),nil,nil)
  823. --MagniDamage(LeftArm,2,6,8,0,"Normal",RootPart,.3,1,math.random(6,7),nil,nil)
  824. Neck.C0=clerp(Neck.C0,necko*euler(0,.5,0)*euler(-.1,0,0),.3)
  825. RootJoint.C0=clerp(RootJoint.C0,euler(0,.5,0)*euler(.2,0,0)*cf(0,.2,1),.3)
  826. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.5,0,1)*euler(0,0,0),.3)
  827. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  828. --LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.7,0,.2)*euler(0,0,0),.3)
  829. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  830. RH.C0=clerp(RH.C0,cf(.6,-.9,-.2)*euler(0,1.57,0)*euler(0,.4,-.3),.3)
  831. LH.C0=clerp(LH.C0,cf(-.6,-.9,-.2)*euler(0,-1.57,0)*euler(0,.5,0),.3)
  832. if i<.3 then
  833. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.7,0,-.2)*euler(0,0,0),.3)
  834. else
  835. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.2)*euler(1.7,0,.1)*euler(0,0,0),.3)
  836. end
  837. end
  838. if RecentEnemy.Value~=nil then
  839. Torso.Velocity=vt(0,0,0)
  840. target,distance=findNearestTorso(Torso.Position)
  841. if target~=nil then
  842. BodGy.cframe=cf(Torso.Position,target.Position)
  843. end
  844. Torso.Velocity=RootPart.CFrame.lookVector*move*3
  845. refd=part(3,workspace,0,1,BrickColor.new("Black"),"Reference",vt())
  846. refd.Anchored=true
  847. game:GetService("Debris"):AddItem(refd,5)
  848. so("169445092",RightArm,1,1.2)
  849. for i=0,1,0.1 do
  850. swait()
  851. refd.CFrame=cf(posfloor)
  852. MagniDamage(LeftArm,4,10,12,math.random(30,35),"Knockdown2",refd,.3,1,math.random(3,4),nil,nil)
  853. Neck.C0=clerp(Neck.C0,necko*euler(0,-1.57,0),.3)
  854. RootJoint.C0=clerp(RootJoint.C0,cf(0,0,.2)*euler(0,-1.57,0),.3)
  855. if i<.6 then
  856. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57)*euler(0,3.14,0),.5)
  857. else
  858. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57)*euler(0,3.14,-1.2)*euler(-.5,0,0),.2)
  859. end
  860. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  861. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.57)*euler(0,0,1),.3)
  862. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  863. RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(.2,-1.57,0),.2)
  864. LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(-.4,-1.57,0),.2)
  865. end
  866. refd.Parent=nil
  867. --swait(100)
  868. end
  869. attack=false
  870. end
  871.  
  872. function SweepCut()
  873. attack=true
  874. for i=0,1,0.1 do
  875. swait()
  876. Neck.C0=clerp(Neck.C0,necko*euler(0,1.3,0)*euler(-.5,0,0),.3)
  877. RootJoint.C0=clerp(RootJoint.C0,euler(0,1.3,0)*euler(-.5,0,0)*cf(0,.4,0),.3)
  878. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,.5)*euler(0,0,0),.3)
  879. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  880. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1)*euler(0,0,0),.3)
  881. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  882. RH.C0=clerp(RH.C0,cf(.6,-.7,-.4)*euler(0,1.57,0)*euler(-.5,0,0),.3)
  883. LH.C0=clerp(LH.C0,cf(-.3,-.4,-.7)*euler(0,-1.57,0)*euler(0,0,-.1)*euler(-.7,0,0),.3)
  884. end
  885. Torso.Velocity=RootPart.CFrame.lookVector*move*5
  886. so("169445073",LeftLeg,1,1.2)
  887. for i=0,1,0.1 do
  888. swait()
  889. MagniDamage(LeftLeg,2,7,9,0,"Knockdown2",RootPart,.2,2,math.random(6,7),nil,nil)
  890. Neck.C0=clerp(Neck.C0,necko*euler(0,1,0)*euler(-.5,0,0),.3)
  891. RootJoint.C0=clerp(RootJoint.C0,euler(0,1.3,0)*euler(-1,0,0)*cf(0,1.2,0),.3)
  892. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(.8,0,.3)*euler(0,0,0),.3)
  893. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  894. LW.C0=clerp(LW.C0,cf(-1,0.5,-.5)*euler(1.5,0,1)*euler(0,0,0),.3)
  895. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  896. RH.C0=clerp(RH.C0,cf(.6,-.7,-.8)*euler(0,1.57,0)*euler(-.3,0,-1.2),.3)
  897. LH.C0=clerp(LH.C0,cf(-.5,-.8,-.2)*euler(0,-1.57,0)*euler(0,0,-.1)*euler(-.5,0,0),.3)
  898. end
  899. Torso.Velocity=vt(0,0,0)
  900. if RecentEnemy.Value~=nil then
  901. target,distance=findNearestTorso(Torso.Position)
  902. if target~=nil then
  903. BodGy.cframe=cf(Torso.Position,target.Position)
  904. end
  905. Torso.Velocity=RootPart.CFrame.lookVector*move*3
  906. refd=part(3,workspace,0,1,BrickColor.new("Black"),"Reference",vt())
  907. refd.Anchored=true
  908. game:GetService("Debris"):AddItem(refd,5)
  909. so("169445092",RightArm,1,1)
  910. for i=0,1,0.2 do
  911. swait()
  912. refd.CFrame=cf(posfloor)
  913. MagniDamage(RightArm,4,10,12,math.random(40,45),"Knockdown2",refd,.3,1,math.random(3,4),nil,nil)
  914. --MagniDamage(LeftArm,4,6,8,math.random(30,35),"Knockdown2",refd,.5,1,math.random(3,4),nil,nil)
  915. --[[Neck.C0=clerp(Neck.C0,necko*euler(0,-1.57,0),.3)
  916. RootJoint.C0=clerp(RootJoint.C0,cf(0,0,.2)*euler(0,-1.57,0),.3)
  917. if i<.6 then
  918. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57)*euler(0,3.14,0),.5)
  919. else
  920. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57)*euler(0,3.14,-1.2)*euler(-.5,0,0),.2)
  921. end
  922. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  923. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.57)*euler(0,0,1),.3)
  924. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  925. RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(.2,-1.57,0),.2)
  926. LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(-.4,-1.57,0),.2)]]
  927. Neck.C0=clerp(Neck.C0,necko*euler(0,.1,0)*euler(0,0,0),.4)
  928. RootJoint.C0=clerp(RootJoint.C0,euler(0,-.5,0)*euler(0,0,0)*cf(0,.6,0),.4)
  929. RW.C0=clerp(RW.C0,cf(1,0.5,-.5)*euler(1.8,0,-.8)*euler(0,0,0),.4)
  930. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  931. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.5,0,-.7)*euler(0,0,0),.4)
  932. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  933. RH.C0=clerp(RH.C0,cf(.5,-.5,0)*euler(0,1.57,0)*euler(-.2,0,0),.4)
  934. LH.C0=clerp(LH.C0,cf(-.5,-.5,0)*euler(0,-1.57,0)*euler(-.2,0,0),.4)
  935. end
  936. for i=0,1,0.1 do
  937. swait()
  938. MagniDamage(RightArm,4,10,12,math.random(40,45),"Knockdown2",refd,.3,1,math.random(3,4),nil,nil)
  939. Torso.Velocity=vt(0,60,0)
  940. Neck.C0=clerp(Neck.C0,necko*euler(0,.1,0)*euler(0,0,0),.3)
  941. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*euler(0,0,0)*cf(0,0,0),.3)
  942. RootJoint.C1=RootJoint.C1*euler(0,.5,0)
  943. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2.5,0,-.2)*euler(0,0,0),.3)
  944. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  945. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.5,0,-1)*euler(0,0,0),.3)
  946. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  947. RH.C0=clerp(RH.C0,cf(.5,-.5,0)*euler(0,1.57,0)*euler(-.2,0,-.2),.3)
  948. LH.C0=clerp(LH.C0,cf(-.5,-.5,0)*euler(0,-1.57,0)*euler(-.2,0,.2),.3)
  949. end
  950. refd.Parent=nil
  951. RootJoint.C1=cf(0,0,0)
  952. end
  953. --swait(100)
  954. attack=false
  955. end
  956.  
  957. function MultiKick()
  958. attack=true
  959. for i=0,1,0.1 do
  960. swait()
  961. Neck.C0=clerp(Neck.C0,necko*euler(.1,.7,0)*euler(0,0,0),.3)
  962. RootJoint.C0=clerp(RootJoint.C0,euler(.1,.8,0)*euler(0,0,0)*cf(0,.6,0),.3)
  963. RW.C0=clerp(RW.C0,cf(1.3,0.4,.3)*euler(.4,0,.4)*euler(0,-.5,0),.3)
  964. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  965. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1,0,.2)*euler(0,1,0),.3)
  966. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  967. RH.C0=clerp(RH.C0,cf(.7,-.7,-.5)*euler(0,1.57,0)*euler(0,-.3,-.6)*euler(.05,0,0),.3)
  968. LH.C0=clerp(LH.C0,cf(-.6,-.6,-.8)*euler(0,-1.57,0)*euler(0,.2,-.4)*euler(.2,0,0),.3)
  969. end
  970. Look=RootPart.CFrame.lookVector*move*2
  971. local n=8
  972. for i=0,1,0.04 do
  973. swait()
  974. n=n+1
  975. if n>=8 then
  976. n=0
  977. so("169445073",LeftLeg,1,1.2)
  978. end
  979. Torso.Velocity=Look
  980. MagniDamage(LeftLeg,2,5,7,math.random(5,10),"Knockdown2",RootPart,.2,2,math.random(4,5),nil,nil)
  981. Neck.C0=clerp(Neck.C0,necko*euler(-.1,0,0)*euler(0,0,0),.3)
  982. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*euler(0,0,0)*cf(0,0,0),.3)
  983. RootJoint.C1=RootJoint.C1*euler(0,.6,0)
  984. RW.C0=clerp(RW.C0,cf(1,0.4,.5)*euler(1.2,0,.4)*euler(0,0,0),.3)
  985. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  986. LW.C0=clerp(LW.C0,cf(-1,0.4,.5)*euler(1.2,0,-.4)*euler(0,0,0),.3)
  987. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  988. RH.C0=clerp(RH.C0,cf(.7,-.5,-.7)*euler(0,1.57,0)*euler(0,-.3,-1)*euler(0,0,0),.3)
  989. LH.C0=clerp(LH.C0,cf(-.6,-.6,-.5)*euler(0,-1.57,0)*euler(0,.2,-1.5)*euler(.2,0,0),.3)
  990. end
  991. if RecentEnemy.Value~=nil then
  992. RecentEnemy.Value=nil
  993. target,distance=findNearestTorso(Torso.Position)
  994. if target~=nil then
  995. RootPart.CFrame=cf(RootPart.Position,target.Position)
  996. end
  997. Look=RootPart.CFrame.lookVector*move
  998. for i=0,1,0.04 do
  999. swait()
  1000. n=n+1
  1001. if n>=8 then
  1002. n=0
  1003. so("169445073",LeftLeg,1,1.2)
  1004. end
  1005. Torso.Velocity=Look
  1006. MagniDamage(LeftLeg,2,5,7,math.random(5,10),"Knockdown2",RootPart,.2,2,math.random(4,5),nil,nil)
  1007. Neck.C0=clerp(Neck.C0,necko*euler(-.1,0,0)*euler(0,0,0),.3)
  1008. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*euler(0,0,0)*cf(0,0,0),.3)
  1009. RootJoint.C1=RootJoint.C1*euler(0,.6,0)
  1010. RW.C0=clerp(RW.C0,cf(1,0.4,.5)*euler(1.2,0,.4)*euler(0,0,0),.3)
  1011. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1012. LW.C0=clerp(LW.C0,cf(-1,0.4,.5)*euler(1.2,0,-.4)*euler(0,0,0),.3)
  1013. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1014. RH.C0=clerp(RH.C0,cf(.7,-.5,-.7)*euler(0,1.57,0)*euler(0,-.3,-1)*euler(0,0,0),.3)
  1015. LH.C0=clerp(LH.C0,cf(-.6,-.6,-.5)*euler(0,-1.57,0)*euler(0,.2,-1.5)*euler(.2,0,0),.3)
  1016. end
  1017. Torso.Velocity=vt(0,0,0)
  1018. end
  1019. RootJoint.C1=cf(0,0,0)
  1020. attack=false
  1021. end
  1022.  
  1023. function JumpKick()
  1024. attack=true
  1025. for i=0,1,0.1 do
  1026. swait()
  1027. Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3)
  1028. RootJoint.C0=clerp(RootJoint.C0,cf(0,1,0)*euler(0,0,0),.3)
  1029. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.2),.3)
  1030. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.2),.3)
  1031. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(-1.2,1.57,0),.3)
  1032. LH.C0=clerp(LH.C0,cf(-.6,-.5,-0.5)*euler(-0.2,-1.3,0),.3)
  1033. end
  1034. Torso.Velocity=vt(0,100,0)
  1035. jump=true
  1036. local dec=Instance.new("NumberValue",Decrease)
  1037. dec.Name="DecreaseMvmt"
  1038. dec.Value=-.4
  1039. for i=0,1,0.05 do
  1040. swait()
  1041. Neck.C0=clerp(Neck.C0,necko*euler(-.1,0,0)*euler(0,0,0),.2)
  1042. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*euler(0,0,0)*cf(0,4,-3),.2)
  1043. RootJoint.C1=RootJoint.C1*euler(-.32,0,0)
  1044. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,1)*euler(0,0,0),.2)
  1045. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1046. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-1)*euler(0,0,0),.2)
  1047. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1048. RH.C0=clerp(RH.C0,cf(.7,-.5,-.7)*euler(0,1.57,0)*euler(0,-.3,-1)*euler(0,0,0),.2)
  1049. LH.C0=clerp(LH.C0,cf(-.6,-.6,-.5)*euler(0,-1.57,0)*euler(0,.2,-1.8)*euler(.2,0,0),.2)
  1050. end
  1051. while hitfloor==nil do
  1052. swait()
  1053. MagniDamage(LeftLeg,5,8,10,math.random(15,25),"Knockdown2",RootPart,.2,2,math.random(8,10),nil,nil)
  1054. MagniDamage(RightLeg,5,8,10,math.random(15,25),"Knockdown2",RootPart,.2,2,math.random(8,10),nil,nil)
  1055. end
  1056. jump=false
  1057. dec.Parent=nil
  1058. RootJoint.C1=cf(0,0,0)
  1059. attack=false
  1060. end
  1061.  
  1062. function EnergyBlam()
  1063. attack=true
  1064. for i=0,1,0.1 do
  1065. swait()
  1066. Neck.C0=clerp(Neck.C0,necko*euler(0,-1,0)*euler(-.2,0,0),.3)
  1067. RootJoint.C0=clerp(RootJoint.C0,euler(0,-1,0)*cf(0,.4,0),.3)
  1068. RW.C0=clerp(RW.C0,cf(1.3,0.5,-.2)*euler(1.4,0,-.5)*euler(0,0,0),.3)
  1069. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1070. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.4,0,.5)*euler(0,0,0),.3)
  1071. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1072. RH.C0=clerp(RH.C0,cf(.7,-.8,-.4)*euler(0,1.57,0)*euler(0,.5,-.1),.3)
  1073. LH.C0=clerp(LH.C0,cf(-.4,-.9,0)*euler(0,-1.57,0)*euler(0,-1,.2),.3)
  1074. end
  1075. so("2101137",Torso,1,1)
  1076. for i=0,1,0.05 do
  1077. swait()
  1078. MagicCircle(BrickColor.new("Bright blue"),Torso.CFrame*cf(0,0,-2),1,1,1,1,1,1,.1)
  1079. MagicCircle(BrickColor.new("White"),Torso.CFrame*cf(0,0,-2),1,1,1,.5,.5,.5,.1)
  1080. end
  1081. for i=0,1,0.1 do
  1082. swait()
  1083. MagicCircle(BrickColor.new("Bright blue"),Torso.CFrame*cf(0,.5,-2),1,1,1,1,1,1,.1)
  1084. MagicCircle(BrickColor.new("White"),Torso.CFrame*cf(0,.5,-2),1,1,1,.5,.5,.5,.1)
  1085. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0)*euler(0,0,0),.3)
  1086. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*cf(0,.4,0),.3)
  1087. RW.C0=clerp(RW.C0,cf(1,0.5,-.5)*euler(1.5,0,-.5)*euler(0,0,0),.3)
  1088. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1089. LW.C0=clerp(LW.C0,cf(-1,0.5,-.5)*euler(1.5,0,.5)*euler(0,0,0),.3)
  1090. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1091. RH.C0=clerp(RH.C0,cf(.7,-.8,-.4)*euler(0,1.57,0)*euler(0,0,-.1),.3)
  1092. LH.C0=clerp(LH.C0,cf(-.4,-.9,0)*euler(0,-1.57,0)*euler(0,0,.2),.3)
  1093. end
  1094. ref=part(3,workspace,0,1,BrickColor.new("Black"),"Reference",vt())
  1095. ref.Anchored=false
  1096. --ref.CFrame=cf(head.Position)
  1097. local rwld=weld(Torso,Torso,ref,cf(0,.5,-2.5))
  1098. game:GetService("Debris"):AddItem(ref,10)
  1099. ref2=part(3,workspace,0,1,BrickColor.new("Black"),"Reference",vt())
  1100. ref2.Anchored=false
  1101. --ref.CFrame=cf(head.Position)
  1102. game:GetService("Debris"):AddItem(ref2,10)
  1103. local tehCF=nil
  1104. --[[target,distance=findNearestTorso(Torso.Position)
  1105. if target~=nil then]]
  1106. tehCF=cf(ref.Position,Mouse.Hit.p)
  1107. --end
  1108. nuh=5
  1109. for i=0,1,0.05 do
  1110. swait()
  1111. nuh=nuh+1
  1112. if nuh>=5 then
  1113. nuh=0
  1114. so("169380505",ref2,1,1.5)
  1115. end
  1116. --[[target,distance=findNearestTorso(Torso.Position)
  1117. if target~=nil then]]
  1118. hit,pos=rayCast(ref.Position,tehCF.lookVector,100,Character)
  1119. local mag=(ref.Position-pos).magnitude
  1120. MagicCylinder3(BrickColor.new("White"),CFrame.new((ref.Position+pos)/2,pos)*angles(1.57,0,0),6,mag*5,6,2,1,2,0.1)
  1121. MagicCircle2(BrickColor.new("White"),cf(pos),10,10,10,10,10,10,.1)
  1122. ref2.CFrame=cf(pos)
  1123. MagniDamage(ref2,10,12,16,0,"Normal",ref2,.2,1,math.random(2,4),nil,nil,true)
  1124. --end
  1125. end
  1126. ref.Parent=nil
  1127. ref2.Parent=nil
  1128. attack=false
  1129. end
  1130.  
  1131. function DecreaseStat(Model,Stat,Amount,Duration)
  1132. if Model:findFirstChild("Stats")~=nil then
  1133. if Model.Stats[Stat]~=nil then
  1134. Model.Stats[Stat].Value=Model.Stats[Stat].Value-Amount
  1135. d=Instance.new("NumberValue",Model.Stats.Decrease)
  1136. game:GetService("Debris"):AddItem(d,40)
  1137. if Stat=="Damage" then
  1138. d.Name="DecreaseAtk"
  1139. elseif Stat=="Defense" then
  1140. d.Name="DecreaseDef"
  1141. elseif Stat=="Movement" then
  1142. d.Name="DecreaseMvmt"
  1143. end
  1144. if Model:findFirstChild("Torso")~=nil then
  1145. display=""
  1146. if Stat=="Damage" then
  1147. if Amount>0 then
  1148. display="-Damage"
  1149. else
  1150. display="+Damage"
  1151. end
  1152. elseif Stat=="Defense" then
  1153. if Amount>0 then
  1154. display="-Defense"
  1155. else
  1156. display="+Defense"
  1157. end
  1158. elseif Stat=="Movement" then
  1159. if Amount>0 then
  1160. display="-Movement"
  1161. else
  1162. display="+Movement"
  1163. end
  1164. end
  1165. showDamage(Model,display,"Debuff")
  1166. end
  1167. d.Value=Amount
  1168. table.insert(Effects,{Model,"DecreaseStat",Stat,Amount,Duration,d})
  1169. end
  1170. end
  1171. end
  1172.  
  1173. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  1174. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  1175. end
  1176.  
  1177. --[[function findNearestTorso(pos)
  1178. local list = game.Workspace:children()
  1179. local torso = nil
  1180. local dist = 1000
  1181. local temp = nil
  1182. local human = nil
  1183. local temp2 = nil
  1184. for x = 1, #list do
  1185. temp2 = list[x]
  1186. if (temp2.className == "Model") and (temp2.Name~=bName) then
  1187. temp = temp2:findFirstChild("Torso")
  1188. human = temp2:findFirstChild("Humanoid")
  1189. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  1190. if btarget.Value==nil then
  1191. if (temp.Position - pos).magnitude < dist then
  1192. local dohit=true
  1193. if temp2:findFirstChild("Stats")~=nil then if temp2.Stats:findFirstChild("Boss")~=nil then if temp2.Stats.Boss.Value==true then dohit=false end end end
  1194. if temp2:findFirstChild("Alive")==nil then dohit=false end
  1195. if dohit==true then
  1196. torso = temp
  1197. dist = (temp.Position - pos).magnitude
  1198. end
  1199. end
  1200. else
  1201. if btarget.Value.Parent~=nil then
  1202. if btarget.Value:findFirstChild("Torso")~=nil then
  1203. if btarget.Value:findFirstChild("Humanoid")~=nil then
  1204. if btarget.Value.Humanoid.Health<=0 then
  1205. btarget.Value=nil
  1206. end
  1207. end
  1208. if btarget.Value~=nil then
  1209. torso=btarget.Value.Torso
  1210. dist = (torso.Position - pos).magnitude
  1211. end
  1212. end
  1213. else
  1214. btarget.Value=nil
  1215. end
  1216. end
  1217. end
  1218. end
  1219. end
  1220. return torso,dist
  1221. end]]
  1222. findNearestTorso = function(pos)
  1223. local list = (game.Workspace:children())
  1224. local torso = nil
  1225. local dist = 1000
  1226. local temp, human, temp2 = nil, nil, nil
  1227. for x = 1, #list do
  1228. temp2 = list[x]
  1229. if temp2.className == "Model" and temp2.Name ~= Character.Name then
  1230. temp = temp2:findFirstChild("Torso")
  1231. human = temp2:findFirstChild("Humanoid")
  1232. if temp ~= nil and human ~= nil and human.Health > 0 and (temp.Position - pos).magnitude < dist then
  1233. local dohit = true
  1234. if dohit == true then
  1235. torso = temp
  1236. dist = (temp.Position - pos).magnitude
  1237. end
  1238. end
  1239. end
  1240. end
  1241. return torso, dist
  1242. end
  1243. function findRandomTorso(pos)
  1244. local list = game.Workspace:children()
  1245. local torso = nil
  1246. local dist = 1000
  1247. local temp = nil
  1248. local human = nil
  1249. local temp2 = nil
  1250. local list2 = {}
  1251. for x = 1, #list do
  1252. temp2 = list[x]
  1253. if (temp2.className == "Model") and (temp2.Name~="Vanta") then
  1254. temp = temp2:findFirstChild("Torso")
  1255. human = temp2:findFirstChild("Humanoid")
  1256. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  1257. if pos.magnitude < dist then
  1258. torso = temp
  1259. table.insert(list2,temp)
  1260. end
  1261. end
  1262. end
  1263. end
  1264. if #list2>0 then
  1265. rand=math.random(1,#list2)
  1266. return list2[rand],dist
  1267. else
  1268. return nil,dist
  1269. end
  1270. end
  1271.  
  1272. Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged,DecreaseState,DecreaseAmount,Duration,Sound)
  1273. if hit.Parent==nil then
  1274. return
  1275. end
  1276. h=hit.Parent:FindFirstChild("Humanoid")
  1277. for _,v in pairs(hit.Parent:children()) do
  1278. if v:IsA("Humanoid") then
  1279. h=v
  1280. end
  1281. end
  1282. if hit.Parent.Parent:FindFirstChild("Torso")~=nil then
  1283. h=hit.Parent.Parent:FindFirstChild("Humanoid")
  1284. end
  1285. if hit.Parent.className=="Hat" then
  1286. hit=hit.Parent.Parent:findFirstChild("Head")
  1287. end
  1288. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  1289. if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end
  1290. if hit.Parent:findFirstChild("Stats")~=nil then if hit.Parent.Stats:findFirstChild("Boss")~=nil then if hit.Parent.Stats.Boss.Value==true then return end end end
  1291. RecentEnemy.Value=hit.Parent
  1292. game:GetService("Debris"):AddItem(c,.5)
  1293. minim=minim*Atk.Value
  1294. maxim=maxim*Atk.Value
  1295. Damage=0
  1296. if minim==maxim or minim>maxim then
  1297. Damage=maxim
  1298. else
  1299. Damage=math.random(minim,maxim)
  1300. end
  1301. blocked=false
  1302. enblock=nil
  1303. Stats=hit.Parent:findFirstChild("Stats")
  1304. if Stats~=nil then
  1305. enblock=Stats:findFirstChild("Block")
  1306. if enblock~=nil then
  1307. if enblock.Value==true then
  1308. blocked=true
  1309. end
  1310. end
  1311. if Stats:findFirstChild("Defense")~=nil then
  1312. Damage=Damage/(Stats.Defense.Value)
  1313. if Damage<=3 and (ranged==false or ranged==nil) and blocked~=true then
  1314. hitnum=math.random(1,3)
  1315. if hitnum==1 then so("169380525",hit,1,math.random(80,120)/100)
  1316. elseif hitnum==2 then so("169380538",hit,1,math.random(80,120)/100)
  1317. elseif hitnum==3 then so("169380528",hit,1,math.random(80,120)/100)
  1318. end
  1319. --[[if hitnum==1 then so("199149321",hit,1,1)
  1320. elseif hitnum==2 then so("199149338",hit,1,1)
  1321. elseif hitnum==3 then so("199149367",hit,1,1)
  1322. elseif hitnum==4 then so("199149409",hit,1,1)
  1323. elseif hitnum==5 then so("199149452",hit,1,1)
  1324. end]]
  1325. elseif ranged==false or ranged==nil and blocked~=true then
  1326. hitnum=math.random(1,3)
  1327. if hitnum==1 then so("169380525",hit,1,math.random(80,120)/100)
  1328. elseif hitnum==2 then so("169380538",hit,1,math.random(80,120)/100)
  1329. elseif hitnum==3 then so("169380528",hit,1,math.random(80,120)/100)
  1330. end
  1331. --[[if hitnum==1 then so("199149137",hit,1,1)
  1332. elseif hitnum==2 then so("199149186",hit,1,1)
  1333. elseif hitnum==3 then so("199149221",hit,1,1)
  1334. elseif hitnum==4 then so("199149235",hit,1,1)
  1335. elseif hitnum==5 then so("199149269",hit,1,1)
  1336. elseif hitnum==6 then so("199149297",hit,1,1)
  1337. end]]
  1338. end
  1339. end
  1340. if Stats:findFirstChild("Stun")~=nil then
  1341. if blocked==true then
  1342. incstun=math.floor(incstun/2)
  1343. end
  1344. Stats.Stun.Value=Stats.Stun.Value+incstun
  1345. end
  1346. if Stats:findFirstChild("Stagger")~=nil then
  1347. if stagger==true then
  1348. Stats.Stagger.Value=true
  1349. end
  1350. end
  1351. end
  1352. if blocked==true then
  1353. showDamage(hit.Parent,"Block","Damage")
  1354. hitnum=math.random(1,2)
  1355. if hitnum==1 then so("199148933",hit,1,1)
  1356. elseif hitnum==2 then so("199148947",hit,1,1)
  1357. end
  1358. enblock.Value=false
  1359. else
  1360. Damage=math.floor(Damage)
  1361. h.Health=h.Health-Damage
  1362. --[[coroutine.resume(coroutine.create(function(Hum,Dam)
  1363. damageFunc:InvokeServer(Hum,Dam)
  1364. end),h,Damage)]]
  1365. showDamage(hit.Parent,Damage,"Damage")
  1366. if DecreaseState~=nil then
  1367. if DecreaseState=="Shatter" then
  1368. DecreaseStat(hit.Parent,"Movement",DecreaseAmount,Duration)
  1369. DecreaseStat(hit.Parent,"Damage",DecreaseAmount,Duration)
  1370. else
  1371. DecreaseStat(hit.Parent,DecreaseState,DecreaseAmount,Duration)
  1372. end
  1373. end
  1374. if Type=="Knockdown" then
  1375. hum=hit.Parent.Humanoid
  1376. hum.PlatformStand=true
  1377. coroutine.resume(coroutine.create(function(HHumanoid)
  1378. swait(1)
  1379. HHumanoid.PlatformStand=false
  1380. end),hum)
  1381. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  1382. --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  1383. local bodvol=Instance.new("BodyVelocity")
  1384. bodvol.velocity=angle*knockback
  1385. bodvol.P=5000
  1386. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  1387. bodvol.Parent=hit
  1388. rl=Instance.new("BodyAngularVelocity")
  1389. rl.P=3000
  1390. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  1391. rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  1392. rl.Parent=hit
  1393. game:GetService("Debris"):AddItem(bodvol,.5)
  1394. game:GetService("Debris"):AddItem(rl,.5)
  1395. elseif Type=="Shatter" then
  1396. for i=1,10 do
  1397. BreakEffect(BrickColor.new("Cyan"),hit.CFrame,math.random(20,80)/100,math.random(2,10),math.random(20,80)/100)
  1398. end
  1399. elseif Type=="Knockdown2" then
  1400. hum=hit.Parent.Humanoid
  1401. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  1402. local bodvol=Instance.new("BodyVelocity")
  1403. bodvol.velocity=angle*knockback
  1404. bodvol.P=5000
  1405. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  1406. bodvol.Parent=hit
  1407. game:GetService("Debris"):AddItem(bodvol,.5)
  1408. elseif Type=="Normal" then
  1409. vp=Instance.new("BodyVelocity")
  1410. vp.P=500
  1411. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  1412. if KnockbackType==1 then
  1413. vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05
  1414. elseif KnockbackType==2 then
  1415. vp.velocity=Property.CFrame.lookVector*knockback
  1416. end
  1417. game:GetService("Debris"):AddItem(vp,.5)
  1418. if knockback>0 then
  1419. vp.Parent=hit.Parent.Torso
  1420. end
  1421. end
  1422. end
  1423. debounce=Instance.new("BoolValue")
  1424. debounce.Name="DebounceHit"
  1425. debounce.Parent=hit.Parent
  1426. debounce.Value=true
  1427. game:GetService("Debris"):AddItem(debounce,Delay)
  1428. CRIT=false
  1429. end
  1430. end
  1431.  
  1432. showDamage=function(Char,Dealt,Type)
  1433. m=Instance.new("Model")
  1434. m.Name="Effect"
  1435. c=Instance.new("Part")
  1436. c.Transparency=1
  1437. c.Name="Head"
  1438. c.TopSurface=0
  1439. c.BottomSurface=0
  1440. c.formFactor="Plate"
  1441. c.Size=Vector3.new(1,.4,1)
  1442. b=Instance.new("BillboardGui",c)
  1443. b.Size=UDim2.new(5,0,5,0)
  1444. b.AlwaysOnTop=true
  1445. damgui=gui("TextLabel",b,tostring(Dealt),1,Color3.new(0,0,0),UDim2.new(0,0,0,0),UDim2.new(1,0,1,0))
  1446. if Type=="Damage" then
  1447. damgui.Font="SourceSans"
  1448. if Dealt=="Block" then
  1449. damgui.TextColor3=BrickColor.new("Bright blue").Color
  1450. elseif Dealt<3 then
  1451. damgui.TextColor3=BrickColor.new("White").Color
  1452. elseif Dealt>=3 and Dealt<20 then
  1453. damgui.TextColor3=BrickColor.new("Bright yellow").Color
  1454. else
  1455. damgui.TextColor3=BrickColor.new("Really red").Color
  1456. damgui.Font="SourceSansBold"
  1457. end
  1458. elseif Type=="Debuff" then
  1459. damgui.TextColor3=BrickColor.new("White").Color
  1460. elseif Type=="Interrupt" then
  1461. damgui.TextColor3=BrickColor.new("New Yeller").Color
  1462. end
  1463. --damgui.FontSize="Size48"
  1464. damgui.TextScaled=true
  1465. ms=Instance.new("CylinderMesh")
  1466. ms.Scale=Vector3.new(.8,.8,.8)
  1467. ms.Parent=c
  1468. c.Reflectance=0
  1469. Instance.new("BodyGyro").Parent=c
  1470. c.Parent=m
  1471. if Char:findFirstChild("Head")~=nil then
  1472. c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(math.random(-100,100)/100,3,math.random(-100,100)/100))
  1473. elseif Char.Parent:findFirstChild("Head")~=nil then
  1474. c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(math.random(-100,100)/100,3,math.random(-100,100)/100))
  1475. end
  1476. f=Instance.new("BodyPosition")
  1477. f.P=2000
  1478. f.D=100
  1479. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  1480. if Type=="Damage" then
  1481. f.position=c.Position+Vector3.new(0,3,0)
  1482. elseif Type=="Debuff" or Type=="Interrupt" then
  1483. f.position=c.Position+Vector3.new(0,5,0)
  1484. end
  1485. f.Parent=c
  1486. game:GetService("Debris"):AddItem(m,5)
  1487. table.insert(Effects,{m,"showDamage",damgui,f,10,1,15,50,100})
  1488. c.CanCollide=false
  1489. m.Parent=workspace
  1490. c.CanCollide=false
  1491. end
  1492.  
  1493. function MagniDamage(Part,magni,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged,DecreaseState,DecreaseAmount,Duration)
  1494. for _,c in pairs(workspace:children()) do
  1495. local hum=c:findFirstChild("Humanoid")
  1496. if hum~=nil then
  1497. local head=nil
  1498. for _,d in pairs(c:children()) do
  1499. --if d.Name=="Torso" or d.Name=="Head" or d.Name=="HumanoidRootPart" or d.Name=="HitPart" then
  1500. --[[if d.className=="Model" and ranged~=true then
  1501. head=d:findFirstChild("Hitbox")
  1502. if d.Parent==Character then break end
  1503. if head~=nil then
  1504. local targ=head.Position-Part.Position
  1505. local mag=targ.magnitude
  1506. if mag<=magni then
  1507. ref=part(3,workspace,0,1,BrickColor.new("Black"),"Reference",vt())
  1508. ref.Anchored=true
  1509. ref.CFrame=cf(head.Position)
  1510. game:GetService("Debris"):AddItem(ref,1)
  1511. hitnum=math.random(1,5)
  1512. if hitnum==1 then so("199148971",ref,1,1)
  1513. elseif hitnum==2 then so("199149025",ref,1,1)
  1514. elseif hitnum==3 then so("199149072",ref,1,1)
  1515. elseif hitnum==4 then so("199149109",ref,1,1)
  1516. elseif hitnum==5 then so("199149119",ref,1,1)
  1517. end
  1518. StaggerHit.Value=true
  1519. end
  1520. end
  1521. end]]
  1522. if d.className=="Part" then
  1523. head=d
  1524. if head~=nil then
  1525. local targ=head.Position-Part.Position
  1526. local mag=targ.magnitude
  1527. if mag<=magni and c.Name~=Character then
  1528. if stun==nil then
  1529. stun=math.random(5,10)
  1530. end
  1531. local Rang=nil
  1532. if Ranged==false then
  1533. Rang=true
  1534. end
  1535. local stag=nil
  1536. if shbash==true then
  1537. stag=true
  1538. end
  1539. Damagefunc(head,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged,DecreaseState,DecreaseAmount,Duration)
  1540. --Damagefunc(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,DecreaseState,DecreaseAmount,Duration)
  1541. end
  1542. end
  1543. end
  1544. end
  1545. end
  1546. end
  1547. end
  1548. local hold = false
  1549. function onKeyDown(key)
  1550. if attack==false then
  1551. if key=="z" then
  1552. PunchSlam()
  1553. elseif key=="x" then
  1554. SweepCut()
  1555. elseif key=="c" then
  1556. MultiKick()
  1557. elseif key=="v" then
  1558. JumpKick()
  1559. elseif key == "b" then
  1560. EnergyBlam()
  1561. --[[elseif key == "n" then
  1562. GrandeurDash()
  1563. elseif key == "m" then
  1564. DeathImpact()
  1565. elseif key == "f" then
  1566. Jump()]]
  1567. elseif key=="0" and hold == false then
  1568. hold = true
  1569. run.Parent=Decrease
  1570. end
  1571. end
  1572. end
  1573. function onKeyUp(key)
  1574. if attack==false then
  1575. if key=="0" and hold == true then
  1576. hold = false
  1577. run.Parent=nil
  1578. end
  1579. end
  1580. end
  1581. Mouse.KeyDown:connect(onKeyDown)
  1582. Mouse.KeyUp:connect(onKeyUp)
  1583. local stunnum=0
  1584. local animnum=0
  1585. local idle=1
  1586. local animlimit=5
  1587. local target,distance=nil,nil
  1588. local attacking=false
  1589. local stunanim=false
  1590. while Humanoid.Health>0 do
  1591. swait()
  1592. --[[print(target)
  1593. print(distance)]]
  1594. hitbox2.Parent=hitbox.Parent
  1595. hitbox2.Size=hitbox.Size
  1596. hitbox2.CFrame=hitboxCF
  1597. --[[for _,c in pairs(Character:children()) do
  1598. for _,v in pairs(c:children()) do
  1599. if v.className=="BodyGyro" or v.className=="BodyPosition" or v.className=="BodyVelocity" or v.className=="BodyAngularVelocity" then
  1600. if v.Name~="SiegmundGyro" and v.Name~="SiegmundPos" then
  1601. print("dai")
  1602. v.Parent=nil
  1603. end
  1604. end
  1605. end
  1606. end]]
  1607. coroutine.resume(coroutine.create(function()
  1608. if start==false then
  1609. start=true
  1610. StartAnim()
  1611. end
  1612. end))
  1613. if attack==false then
  1614. BodGy.cframe=cf(Torso.Position,Mouse.Hit.p)
  1615. end
  1616. target,distance=findNearestTorso(Torso.Position)
  1617. --[[if target~=nil then
  1618. if attack==false then
  1619. BodGy.cframe=cf(Torso.Position,target.Position)
  1620. end
  1621. numb1=RootPart.Position.y
  1622. numb2=target.Position.y
  1623. if numb2-numb1>=5 or numb2-numb1<=-5 then
  1624. if distance<=30 then
  1625. if attack==false then
  1626. attackrand=math.random(1,20)
  1627. if attackrand==1 then
  1628. coroutine.resume(coroutine.create(function()
  1629. RecentEnemy.Value=nil
  1630. JumpKick()
  1631. end))
  1632. end
  1633. end
  1634. end
  1635. end
  1636. if distance>30 then --far range
  1637. Humanoid:MoveTo(target.Position)
  1638. run.Parent=Decrease
  1639. if attack==false then
  1640. attackrand=math.random(1,70)
  1641. if attackrand==1 then
  1642. coroutine.resume(coroutine.create(function()
  1643. RecentEnemy.Value=nil
  1644. EnergyBlam()
  1645. --[[d=math.random(1,3)
  1646. if d==1 then
  1647. PunchSlam()
  1648. elseif d==2 then
  1649. SweepCut()
  1650. elseif d==3 then
  1651. MultiKick()
  1652. end
  1653. end))
  1654. --[[coroutine.resume(coroutine.create(function()
  1655. buffdef.Parent=Decrease
  1656. atk=0
  1657. if stompcooldown<=0 then
  1658. atk=3
  1659. else
  1660. atk=math.random(1,2)
  1661. end
  1662. if atk==1 then
  1663. Jump()
  1664. elseif atk==2 then
  1665. GrandeurDash()
  1666. elseif atk==3 then
  1667. DeathImpact()
  1668. end
  1669. buffdef.Parent=nil
  1670. end))
  1671. end
  1672. end
  1673. elseif distance<=30 and distance>=5 then --mid range
  1674. move=distance*3
  1675. Humanoid:MoveTo(target.Position)
  1676. run.Parent=nil
  1677. if attack==false then
  1678. attackrand=math.random(1,20)
  1679. if attackrand==1 then
  1680. coroutine.resume(coroutine.create(function()
  1681. RecentEnemy.Value=nil
  1682. d=math.random(1,3)
  1683. if d==1 then
  1684. PunchSlam()
  1685. elseif d==2 then
  1686. SweepCut()
  1687. elseif d==3 then
  1688. MultiKick()
  1689. end
  1690. end))
  1691. --[[coroutine.resume(coroutine.create(function()
  1692. buffdef.Parent=Decrease
  1693. atk=0
  1694. if stompcooldown<=0 then
  1695. atk=3
  1696. else
  1697. atk=math.random(1,2)
  1698. end
  1699. if atk==1 then
  1700. HeavySlam()
  1701. elseif atk==2 then
  1702. GrandeurDash()
  1703. elseif atk==3 then
  1704. DeathImpact()
  1705. end
  1706. buffdef.Parent=nil
  1707. end))
  1708. end
  1709. end
  1710. else --close range
  1711. move=10
  1712. Humanoid:MoveTo(RootPart.Position)
  1713. run.Parent=nil
  1714. --run.Parent=nil
  1715. if attack==false then
  1716. attackrand=math.random(1,20)
  1717. if attackrand==1 then
  1718. coroutine.resume(coroutine.create(function()
  1719. RecentEnemy.Value=nil
  1720. d=math.random(1,3)
  1721. if d==1 then
  1722. PunchSlam()
  1723. elseif d==2 then
  1724. SweepCut()
  1725. elseif d==3 then
  1726. MultiKick()
  1727. end
  1728. end))
  1729. --[[coroutine.resume(coroutine.create(function()
  1730. buffdef.Parent=Decrease
  1731. HeavyCombo("Stun")
  1732. buffdef.Parent=nil
  1733. end))
  1734. end
  1735. end
  1736. end
  1737. end]]
  1738. if Mvmt.Value<0 or Stun.Value>=100 or attack==true then
  1739. Humanoid.WalkSpeed=0
  1740. if jump==true then
  1741. Humanoid.WalkSpeed=16*Mvmt.Value
  1742. end
  1743. else
  1744. Humanoid.WalkSpeed=16*Mvmt.Value
  1745. end
  1746. if Stun.Value>=100 and stunanim==false then
  1747. coroutine.resume(coroutine.create(function()
  1748. stunanim=true
  1749. while attack==true do
  1750. swait()
  1751. end
  1752. StunAnim()
  1753. Stun.Value=0
  1754. stunanim=false
  1755. end))
  1756. end
  1757. local stunnum2=80
  1758. if stunnum>=stunnum2 then
  1759. if Stun.Value>0 then
  1760. Stun.Value=Stun.Value-1
  1761. end
  1762. stunnum=0
  1763. end
  1764. stunnum=stunnum+1
  1765. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  1766. local velderp=RootPart.Velocity.y
  1767. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,10,Character)
  1768. for _,c in pairs(Decrease:children()) do
  1769. if c:findFirstChild("Duration")~=nil then
  1770. c.Duration.Value=c.Duration.Value-1
  1771. if c.Duration.Value<=0 then
  1772. c.Parent=nil
  1773. end
  1774. end
  1775. if c.Name=="DecreaseAtk" then
  1776. decreaseatk=decreaseatk+c.Value
  1777. elseif c.Name=="DecreaseDef" then
  1778. decreasedef=decreasedef+c.Value
  1779. elseif c.Name=="DecreaseMvmt" then
  1780. decreasemvmt=decreasemvmt+c.Value
  1781. end
  1782. end
  1783. Atk.Value=1-decreaseatk
  1784. if Atk.Value<=0 then
  1785. Atk.Value=0
  1786. end
  1787. Def.Value=1-decreasedef
  1788. if Def.Value<=0 then
  1789. Def.Value=0.01
  1790. end
  1791. Mvmt.Value=1-decreasemvmt
  1792. if Mvmt.Value<=0 then
  1793. Mvmt.Value=0
  1794. end
  1795. decreaseatk=0
  1796. decreasedef=0
  1797. decreasemvmt=0
  1798. AtkVal=Atk.Value*100
  1799. AtkVal=math.floor(AtkVal)
  1800. AtkVal=AtkVal/100
  1801. DefVal=Def.Value*100
  1802. DefVal=math.floor(DefVal)
  1803. DefVal=DefVal/100
  1804. MvmtVal=Mvmt.Value*100
  1805. MvmtVal=math.floor(MvmtVal)
  1806. MvmtVal=MvmtVal/100
  1807. if MvmtVal<=0 then
  1808. MvmtVal=0
  1809. end
  1810. animnum=animnum+1
  1811. if animnum>=animlimit*5 then
  1812. idle=1
  1813. animnum=0
  1814. elseif animnum>=animlimit*4 then
  1815. idle=1
  1816. animnum=0
  1817. elseif animnum>=animlimit*3 then
  1818. idle=4
  1819. elseif animnum>=animlimit*2 then
  1820. idle=3
  1821. elseif animnum>=animlimit*1 then
  1822. idle=2
  1823. end
  1824. if RootPart.Velocity.y > 1 and hitfloor==nil then
  1825. Anim="Jump"
  1826. if attack==false then
  1827. Neck.C0=clerp(Neck.C0,necko*euler(.1,0,0),.3)
  1828. RootJoint.C0=clerp(RootJoint.C0,euler(-.1,0,0),.3)
  1829. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.5,0,1),.3)
  1830. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1831. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.5,0,-1),.3)
  1832. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1833. RH.C0=clerp(RH.C0,cf(.5,-1,-.3)*euler(-0.5,1.57,0)*euler(-.2,0,0),.2)
  1834. LH.C0=clerp(LH.C0,cf(-.5,-1,-.3)*euler(-0.5,-1.57,0)*euler(-.2,0,0),.2)
  1835. end
  1836. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  1837. Anim="Fall"
  1838. if attack==false then
  1839. Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3)
  1840. RootJoint.C0=clerp(RootJoint.C0,euler(.2,0,0),.3)
  1841. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.3,0,0.2),.3)
  1842. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1843. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.3,0,-0.2),.3)
  1844. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  1845. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0.4,1.57,0),.2)
  1846. LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(-0.2,-1.57,0),.2)
  1847. end
  1848. elseif torvel<1 and hitfloor~=nil then
  1849. Anim="Idle"
  1850. animlimit=15
  1851. if attack==false then
  1852. if idle==1 or idle==2 then
  1853. Neck.C0=clerp(Neck.C0,necko*euler(0,.5,0)*euler(0,0,0),.1)
  1854. RootJoint.C0=clerp(RootJoint.C0,euler(0,.5,0)*cf(0,.4,0),.1)
  1855. RW.C0=clerp(RW.C0,cf(1.3,0.4,.3)*euler(1,0,.2)*euler(0,-.5,0),.1)
  1856. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1857. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.4,0,.5)*euler(0,1,0),.1)
  1858. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1859. RH.C0=clerp(RH.C0,cf(.6,-.9,0)*euler(0,1.57,0)*euler(0,-.1,-.05),.1)
  1860. LH.C0=clerp(LH.C0,cf(-.7,-.8,-.4)*euler(0,-1.57,0)*euler(0,.5,.1),.1)
  1861. else
  1862. Neck.C0=clerp(Neck.C0,necko*euler(.1,.5,0)*euler(0,0,0),.1)
  1863. RootJoint.C0=clerp(RootJoint.C0,euler(.1,.5,0)*euler(0,0,0)*cf(0,.6,0),.1)
  1864. RW.C0=clerp(RW.C0,cf(1.3,0.4,.3)*euler(.8,0,.4)*euler(0,-.5,0),.1)
  1865. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1866. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.6,0,.2)*euler(0,1,0),.1)
  1867. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1868. RH.C0=clerp(RH.C0,cf(.7,-.7,-.5)*euler(0,1.57,0)*euler(0,-.1,-.2)*euler(.05,0,0),.1)
  1869. LH.C0=clerp(LH.C0,cf(-.6,-.6,-.8)*euler(0,-1.57,0)*euler(0,.5,.2)*euler(-.1,0,0),.1)
  1870. end
  1871. end
  1872. elseif torvel>2 and torvel<20 and hitfloor~=nil then
  1873. Anim="Walk"
  1874. animlimit=10
  1875. if attack==false then
  1876. if idle==1 or idle==2 then
  1877. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1878. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1.4,0,-.1)*euler(0,0,0),.1)
  1879. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1880. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(0,0,-.5),.1)
  1881. if idle==1 then
  1882. Neck.C0=clerp(Neck.C0,necko*euler(.05,0,0)*euler(0,0,0),.1)
  1883. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*cf(0,.1,0),.1)
  1884. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,0)*euler(0,0,0),.1)
  1885. LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(0,0,-1.2),.1)
  1886. elseif idle==2 then
  1887. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0)*euler(0,0,0),.1)
  1888. RootJoint.C0=clerp(RootJoint.C0,euler(.2,0,0)*cf(0,.2,0),.1)
  1889. RW.C0=clerp(RW.C0,cf(1.3,0.5,-.5)*euler(1.2,0,-.5)*euler(0,0,0),.1)
  1890. LH.C0=clerp(LH.C0,cf(-.5,-.9,-.3)*euler(0,-1.57,0)*euler(0,0,0),.1)
  1891. end
  1892. else
  1893. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.4,0,.1)*euler(0,0,0),.1)
  1894. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1895. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1)
  1896. LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(0,0,.5),.1)
  1897. if idle==3 then
  1898. Neck.C0=clerp(Neck.C0,necko*euler(.05,0,0)*euler(0,0,0),.1)
  1899. RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*cf(0,.1,0),.1)
  1900. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1,0,0)*euler(0,0,0),.1)
  1901. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(0,0,1.2),.1)
  1902. elseif idle==4 then
  1903. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0)*euler(0,0,0),.1)
  1904. RootJoint.C0=clerp(RootJoint.C0,euler(.2,0,0)*cf(0,.2,0),.1)
  1905. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.5)*euler(1.2,0,.5)*euler(0,0,0),.1)
  1906. RH.C0=clerp(RH.C0,cf(.5,-.9,-.3)*euler(0,1.57,0)*euler(0,0,0),.1)
  1907. end
  1908. end
  1909. end
  1910. elseif torvel>=20 and hitfloor~=nil then
  1911. Anim="Run"
  1912. animlimit=10
  1913. if attack==false then
  1914. if idle==1 or idle==2 then
  1915. Neck.C0=clerp(Neck.C0,necko*euler(.2,0,0)*euler(0,0,0),.2)
  1916. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1917. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1918. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.2,0,-.8),.2)
  1919. if idle==1 then
  1920. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1,0,.5)*euler(0,0,0),.2)
  1921. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1,0,-.5)*euler(0,0,0),.2)
  1922. RootJoint.C0=clerp(RootJoint.C0,euler(.4,0,0)*cf(0,.3,0),.2)
  1923. LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(0,0,-1.5),.2)
  1924. elseif idle==2 then
  1925. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.2,0,.3)*euler(0,0,0),.2)
  1926. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1.2,0,-.3)*euler(0,0,0),.2)
  1927. RootJoint.C0=clerp(RootJoint.C0,euler(.5,0,0)*cf(0,.4,0),.1)
  1928. LH.C0=clerp(LH.C0,cf(-.5,-.6,-.5)*euler(0,-1.57,0)*euler(0,0,-.5),.1)
  1929. end
  1930. else
  1931. Neck.C0=clerp(Neck.C0,necko*euler(.2,0,0)*euler(0,0,0),.2)
  1932. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1933. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1934. LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(-.2,0,.8),.2)
  1935. if idle==3 then
  1936. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1,0,.5)*euler(0,0,0),.2)
  1937. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1,0,-.5)*euler(0,0,0),.2)
  1938. RootJoint.C0=clerp(RootJoint.C0,euler(.4,0,0)*cf(0,.3,0),.2)
  1939. RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(0,0,1.5),.2)
  1940. elseif idle==4 then
  1941. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.2,0,.3)*euler(0,0,0),.2)
  1942. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1.2,0,-.3)*euler(0,0,0),.2)
  1943. RootJoint.C0=clerp(RootJoint.C0,euler(.5,0,0)*cf(0,.4,0),.1)
  1944. RH.C0=clerp(RH.C0,cf(.5,-.6,-.5)*euler(0,1.57,0)*euler(0,0,.5),.1)
  1945. end
  1946. end
  1947. end
  1948. end
  1949. if #Effects>0 then
  1950. --table.insert(Effects,{prt,"Block1",delay})
  1951. for e=1,#Effects do
  1952. if Effects[e]~=nil then
  1953. --for j=1,#Effects[e] do
  1954. local Thing=Effects[e]
  1955. if Thing~=nil then
  1956. local Part=Thing[1]
  1957. local Mode=Thing[2]
  1958. local Delay=Thing[3]
  1959. local IncX=Thing[4]
  1960. local IncY=Thing[5]
  1961. local IncZ=Thing[6]
  1962. if Thing[2]=="DecreaseStat" then
  1963. --table.insert(Effects,{Model,"DecreaseStat",Stat,Amount,Duration,d})
  1964. Thing[5]=Thing[5]-1
  1965. if Thing[5]<=0 then
  1966. if Thing[1]:findFirstChild("Stats")~=nil then
  1967. if Thing[1].Stats:findFirstChild("Decrease")~=nil then
  1968. --Thing[1].Stats[Thing[3]].Value=Thing[1].Stats[Thing[3]].Value+Thing[4]
  1969. end
  1970. end
  1971. Thing[6].Parent=nil
  1972. table.remove(Effects,e)
  1973. end
  1974. end
  1975. if Thing[2]=="CylinderClang" then
  1976. if Thing[3]<=1 then
  1977. Thing[1].CFrame=Thing[1].CFrame*CFrame.new(0,2.5*Thing[5],0)*CFrame.fromEulerAnglesXYZ(Thing[6],0,0)
  1978. Thing[7]=Thing[1].CFrame
  1979. effect("New Yeller",0,Thing[8],Thing[7])
  1980. Thing[8]=Thing[7]
  1981. Thing[3]=Thing[3]+Thing[4]
  1982. else
  1983. Part.Parent=nil
  1984. table.remove(Effects,e)
  1985. end
  1986. end
  1987. if Thing[2]=="showDamage" then
  1988. if Thing[6]<Thing[5] then
  1989. Thing[6]=Thing[6]+1
  1990. elseif Thing[6]<Thing[7] then
  1991. Thing[4].position=Thing[4].position+vt(0,-.2,0)
  1992. Thing[6]=Thing[6]+1
  1993. elseif Thing[6]<Thing[8] then
  1994. Thing[6]=Thing[6]+1
  1995. elseif Thing[6]<Thing[9] then
  1996. Thing[6]=Thing[6]+1
  1997. Thing[4].position=Thing[4].position+vt(0,.2,0)
  1998. Thing[3].TextStrokeTransparency=Thing[3].TextStrokeTransparency+.1
  1999. Thing[3].TextTransparency=Thing[3].TextTransparency+.1
  2000. else
  2001. Thing[1].Parent=nil
  2002. table.remove(Effects,e)
  2003. end
  2004. end
  2005. if Thing[2]~="DecreaseStat" and Thing[2]~="showDamage" then
  2006. if Thing[1].Transparency<=1 then
  2007. if Thing[2]=="Block1" then
  2008. Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  2009. Mesh=Thing[7]
  2010. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  2011. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2012. elseif Thing[2]=="Block2" then
  2013. Thing[1].CFrame=Thing[1].CFrame
  2014. Mesh=Thing[7]
  2015. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  2016. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2017. elseif Thing[2]=="Cylinder" then
  2018. Mesh=Thing[7]
  2019. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  2020. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2021. elseif Thing[2]=="Cylinder2" then
  2022. Mesh=Thing[7]
  2023. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  2024. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2025. if Thing[1].Transparency>=.5 then
  2026. Thing[1].BrickColor=BrickColor.new("Bright blue")
  2027. end
  2028. elseif Thing[2]=="Blood" then
  2029. Mesh=Thing[7]
  2030. Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0)
  2031. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  2032. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2033. elseif Thing[2]=="Elec" then
  2034. Mesh=Thing[7]
  2035. Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
  2036. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2037. elseif Thing[2]=="Disappear" then
  2038. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  2039. end
  2040. else
  2041. table.remove(Effects,e)
  2042. Thing[1].Parent=nil
  2043. end
  2044. end
  2045. end
  2046. --end
  2047. end
  2048. end
  2049. end
  2050. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement