Advertisement
naser2345

light spear

Aug 9th, 2016
2,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.27 KB | None | 0 0
  1.  
  2. repeat wait() until game:GetService("Players").LocalPlayer.Character;
  3. pcall(function() _G.RMs.Disabled=true end)
  4. _G.RMs=script
  5. _G.RMf=getfenv()
  6. ServiceTable = {"Players","Lighting","Debris","StarterPack","InsertService"}
  7. for i,v in pairs(ServiceTable) do
  8. getfenv()[v]=game:GetService(v)
  9. end
  10.  
  11. INEW=Instance.new
  12. V3=Vector3.new
  13. V3A=function(i) return V3(i,i,i) end
  14. CF=CFrame.new
  15. MRAD=math.rad
  16. MDEG=math.deg
  17. mrnd=math.random
  18. CA=function(a,b,c) return CFrame.Angles(MRAD(a),MRAD(b),MRAD(c)) end
  19. CF0=CF(0,0,0)
  20. v3=V3
  21. v30=v3(0,0,0)
  22. v31=v3(1/0,1/0,1/0)
  23. rotrand = function(a,b)
  24. local a = a and -a or -180
  25. local b = b and -b or 180
  26. return CA(mrnd(a,b),mrnd(a,b),mrnd(a,b))
  27. end
  28.  
  29. as,so2,so={},{'metal','Block','Slash','Slash2','Hit','Kick','Abscond','Cast'},{}
  30. as.corner='11294911'
  31. as.cone='1033714'
  32. as.ring="3270017"
  33. as.Chakram='47260990'
  34. as.ring2='18430887'
  35. as.blast='20329976'
  36. as.missile='10207677'
  37. as.fire='2693346'
  38. as.boom='3264793'
  39. as.slash='10209645'
  40. as.abscond='2767090'
  41. as.firelaser='13775494'
  42. as.diamond='9756362'
  43. as.metal='rbxasset://sounds\\unsheath.wav'
  44. as.Block = 'rbxasset://sounds\\metal.ogg'
  45. as.Slash = '10209645'
  46. as.Slash2 = '46760716'
  47. as.Hit='10209583'
  48. as.Kick='46153268'
  49. as.Cast='2101137'
  50. as.Abscond='2767090'
  51. as.Blood='158555098'
  52. as.Spear1='69891706'
  53. as.Spear1T='69890778'
  54. as.Skull='6552202'
  55. as.Gradient1='185346444'
  56. as.Gradient2='185346448'
  57.  
  58. for i,v in pairs(as) do
  59. if v:sub(1,3)~="htt" and v:sub(1,3)~="rbx" then
  60. as[i]="http://www.roblox.com/asset/?id="..v
  61. end
  62. end
  63.  
  64.  
  65. newPart = function(sizea,sizeb,sizec,parent,cframe,aa,bb,cc,dd,ee,ff)
  66. local Materials = {}
  67. for i,v in pairs{
  68. "Plastic","SmoothPlastic","Wood", "WoodPlanks",
  69. "Marble", "Slate","Concrete", "Granite",
  70. "Brick","Pebble", "Cobblestone","CorrodedMetal",
  71. "DiamondPlate", "Foil", "Metal","Grass",
  72. "Sand","Fabric","Ice"} do
  73. Materials[v]=v
  74. end
  75. local mat,col
  76. local part = Instance.new("Part",parent or Model)
  77. for i,v in pairs{aa,bb,cc,dd,ee,ff} do
  78. if Materials[v] then mat=v end
  79. if BrickColor.new(v).Name==v then col=v end
  80. if v=="CylinderMesh" or v=="BlockMesh" then INEW(v,part).Name="Mesh" end
  81. if v=="Wedge" then part.Parent=nil part=INEW("WedgePart",parent or Model) end
  82. if v=="Corner" then part.Parent=nil part=INEW("CornerWedgePart",parent or Model)
  83. end
  84. end
  85. if part.className~="CornerWedgePart" then part.formFactor="Custom" end
  86. part.TopSurface=0
  87. part.BottomSurface=0
  88. part.Size=V3(sizea,sizeb,sizec) or V3(1,1,1)
  89. part.CFrame=cframe or CF(0,10,0)
  90. part.BrickColor=BrickColor.new(col or '')
  91. part.Material = mat or 'Plastic'
  92. part:BreakJoints()
  93. return part,cframe
  94. end
  95. newWeld = function(parent,P0,P1,C0,C1)
  96. local weld=INEW("Weld",parent or P0)
  97. weld.Part0=P0
  98. weld.Part1=P1
  99. weld.C0=C0 or weld.C0
  100. weld.C1=C1 or weld.C1
  101. return weld
  102. end
  103. -------
  104. ray = function(Pos, Dir,tab,length) -- ray cast
  105. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *(length or 999)),tab)
  106. end
  107. ----------------------------------------------------------------------------
  108. WeldLib={}
  109. function GetWeld(weld,CO)
  110. local CO=CO or 0
  111. if not WeldLib[weld] then
  112. local x0,y0,z0=weld.C0:toEulerAnglesXYZ()
  113. local x1,y1,z1=weld.C1:toEulerAnglesXYZ()
  114. WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))}
  115. end
  116. return weld['C'..CO].p,WeldLib[weld][CO]
  117. end
  118. function ClearWeld(weld)
  119. if WeldLib[weld] then WeldLib[weld]=nil end
  120. end
  121. mabs=math.abs
  122. mdeg = math.deg
  123. v3floor = function(w,dec)
  124. local dec=dec or 1000
  125. return v3(math.floor(w.x*dec)/dec,math.floor(w.y*dec)/dec,math.floor(w.z*dec)/dec)
  126. end
  127. function SetWeld(weld,CO,i, loops, origpos,origangle, nextpos,nextangle,smooth)
  128. local origpos=origpos
  129. local origangle=origangle
  130. loops=math.floor(loops)
  131. if not origpos and not origangle then
  132. origpos,origangle=GetWeld(weld,CO)
  133. end
  134. local perc =(smooth==1 or smooth==nil) and math.sin((math.pi/2)/loops*i) or i/loops
  135. -----------
  136. if not WeldLib[weld] then
  137. local x0,y0,z0=weld.C0:toEulerAnglesXYZ()
  138. local x1,y1,z1=weld.C1:toEulerAnglesXYZ()
  139. WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))}
  140. end
  141. --if smooth==2 and (origangle-nextangle).magnitude <2.5 then return end -- anti
  142. -----------
  143. origangle=v3floor(origangle)
  144. nextangle=v3floor(nextangle)
  145. local tox,toy,toz = 0,0,0
  146. tox = origangle.x > nextangle.x and -mabs(origangle.x - nextangle.x) *perc or mabs(origangle.x - nextangle.x) *perc
  147. toy = origangle.y > nextangle.y and -mabs(origangle.y - nextangle.y) *perc or mabs(origangle.y - nextangle.y) *perc
  148. toz = origangle.z > nextangle.z and -mabs(origangle.z - nextangle.z) *perc or mabs(origangle.z - nextangle.z) *perc
  149. local tox2,toy2,toz2 = 0,0,0
  150. tox2= origpos.x > nextpos.x and -mabs(origpos.x - nextpos.x) *perc or mabs(origpos.x - nextpos.x) *perc
  151. toy2= origpos.y > nextpos.y and -mabs(origpos.y - nextpos.y) *perc or mabs(origpos.y - nextpos.y) *perc
  152. toz2= origpos.z > nextpos.z and -mabs(origpos.z - nextpos.z) *perc or mabs(origpos.z - nextpos.z) *perc
  153. WeldLib[weld][CO] = v3(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  154. weld['C'..CO] = CF(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*CA(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  155. end
  156. ----------------------------------------
  157. function GetTriangleValues(Points)
  158. local G, V = 0
  159. for S = 1, 3 do
  160. local L = (Points[1+(S+1)%3]-Points[1+S%3]).magnitude
  161. G, V = L > G and L or G, L > G and {Points[1+(S-1)%3], Points[1+(S)%3], Points[1+(S+1)%3]} or V
  162. end
  163. local D = V[2]+(V[3]-V[2]).unit*((V[3]-V[2]).unit:Dot(V[1]-V[2]))
  164. local C, B = (D-V[1]).unit, (V[2]-V[3]).unit
  165. local A = B:Cross(C)
  166. S1 = V3(0, (V[2]-D).magnitude, (V[1]-D).magnitude)/1 --0.2
  167. S2 = V3(0, (V[3]-D).magnitude, (V[1]-D).magnitude)/1 --0.2
  168. C1 = CF(0,0,0,A.X,B.X,C.X,A.Y,B.Y,C.Y,A.Z,B.Z,C.Z)+(V[1]+V[2])/2
  169. C2 = CF(0,0,0,-A.X,-B.X,C.X,-A.Y,-B.Y,C.Y,-A.Z,-B.Z,C.Z)+(V[1]+V[3])/2
  170. return C1, C2, S1, S2
  171. end
  172. ------
  173. LoopFunctions={}
  174. function DoLoop(times,func)
  175. LoopFunctions[#LoopFunctions+1]={times,0,func}
  176. end
  177. ----------
  178. MeshPack={}
  179. MeshEffect=function(i,ofs,trans,mesh,ofss,col,sc1,sc2) -- Interval>CFrame>Adj
  180. local sc2=sc2
  181. if sc2 and type(sc2)=="number" then sc2=sc1*sc2 end
  182. local ob=INEW("Part",Model)
  183. ob.Anchored=true
  184. ob.CanCollide=false
  185. ob.TopSurface,ob.BottomSurface=0,0
  186. ob.formFactor="Custom"
  187. ob.Name="Effect"
  188. ob.Size=v3(1,1,1)
  189. ob.CFrame=ofs
  190. ob.BrickColor=BrickColor.new(col or EffectColor)
  191. ob.Transparency=trans or 0.5
  192. local obm
  193. if mesh=="Block" or mesh=="Cylinder" then
  194. obm=INEW(mesh.."Mesh",ob)
  195. elseif mesh:sub(1,3)=="htt" or mesh:sub(1,3)=="rbx" then
  196. obm=INEW("SpecialMesh",ob)
  197. obm.MeshType="FileMesh"
  198. obm.MeshId=mesh
  199. else
  200. obm=INEW("SpecialMesh",ob)
  201. obm.MeshType=mesh
  202. end
  203. obm.Scale=sc1 or v3(1,1,1)
  204. MeshPack[#MeshPack+1]={ob,1,-i,ofss or CF0,obm.Scale,sc2 or v30,ob.Transparency}
  205. end
  206. Effect1 = function(orig,adjj,radius,deg,parts,fade,wide,fadespeed)
  207. local orig = orig
  208. local adjj = adjj or CF(0,0,0)
  209. local radius=radius or 8
  210. local deg=deg or 65
  211. local parts=parts or 6
  212. local fade=fade or 1
  213. local wide = wide or 0.2 --mrnd(500,1500)/1000
  214. local fadespeed=fadespeed or 0.05
  215. local part={}
  216. for x=-deg/2,deg/2,deg/parts do
  217. local function reframe(x,radius,wide,orig)
  218. local xa=x-deg/parts/2
  219. local xb=x+deg/parts/2
  220. local xxa=math.sin(math.rad(xa))*radius*wide
  221. local zza=math.cos(math.rad(xa))*radius
  222. local xxb=math.sin(math.rad(xb))*radius*wide
  223. local zzb=math.cos(math.rad(xb))*radius
  224. local xx=math.sin(math.rad(x))*radius*wide
  225. local zz=math.cos(math.rad(x))*radius
  226. local kek=CF(orig*CF(xxa,0,zza).p,orig*CF(xxb,0,zzb).p)*CF(0,0,-(orig*CF(xxa,0,zzb).p-orig*CF(xx,0,zz).p).magnitude)
  227. local len=(orig*CF(xxa,0,zza).p-orig*CF(xxb,0,zzb).p).magnitude
  228. return kek,len
  229. end
  230. local kek,len = reframe(x,radius,wide,orig)
  231. local new=INEW("Part",Model)
  232. new.Anchored=true new.TopSurface=10 new.BottomSurface=10
  233. new.CanCollide=false new.formFactor="Custom" new.Size=v3(0.2,0.2,0.2)
  234. new.BrickColor=BrickColor.new(EffectColor) new.Transparency=0.6
  235. new.CFrame=kek
  236. newm=INEW("BlockMesh",new)
  237. newm.Scale=v3(0.5,0.1,len)*5
  238. part[#part+1]={new,newm,x,CF(fade*radius/(1/fadespeed),0,0),reframe} --part,mesh,x,adj,func
  239. end
  240. DoLoop(1/fadespeed,function(i)
  241. orig=orig*adjj
  242. for x=1,#part do
  243. local kek,len=part[x][5](part[x][3],radius+fade*radius*i,wide,orig)
  244. part[x][1].CFrame=kek
  245. part[x][2].Scale=v3(0.5,0.1,0.01+len)*5
  246. part[x][1].Transparency=0.6+0.4*i
  247. if i==1 then part[x][1]:Remove() end
  248. end
  249. end)
  250. end
  251. newMesh=function(parent,type,sx,sy,sz)
  252. local filemesh
  253. local mesh
  254. if type=="Block" or type=="Cylinder" then
  255. mesh=INEW(type.."Mesh",parent)
  256. elseif type:sub(1,4)=="http" or type:sub(1,3)=="rbx" then
  257. mesh=INEW("SpecialMesh",parent)
  258. mesh.MeshType="FileMesh"
  259. mesh.MeshId=type
  260. filemesh=true
  261. else
  262. mesh=INEW("SpecialMesh",parent)
  263. mesh.MeshType=type
  264. end
  265. if parent.Size.x<0.2001 then parent.CanCollide=false end
  266. local yes=parent.Size.x<0.2001 and 5 or 1
  267. if filemesh then yes=1 end
  268. mesh.Scale=V3(sx or 1,sy or 1,sz or 1)*yes
  269. return mesh
  270. end
  271. Ca=function(a,b,c,d,e,f)
  272. local x,y,z=(CA(a,b,c)*CA(d,e,f)):toEulerAnglesXYZ()
  273. return v3(mdeg(x),mdeg(y),mdeg(z))
  274. end
  275. -----
  276. Ghost={}
  277. NewGhost=function(cff)
  278. local gho=#Ghost+1
  279. Ghost[gho]={}
  280. Ghost[gho][1]=cff
  281. local ghom=INEW('Model',workspace)
  282. ghom.Name=Player.Name..'Ghost'
  283. Ghost[gho][2]=ghom
  284. Ghost[gho][3]=CF(0,1.5,0)*CA(0,90,0)
  285. Ghost[gho].Torso=INEW("Part",ghom) --
  286. Ghost[gho].Torso.formFactor='Custom'
  287. Ghost[gho].Torso.Size=v3(2,2,1)
  288. Ghost[gho].Torso.Name='Torso'
  289. local kek=Ghost[gho].Torso
  290. Ghost[gho].Handle=kek:Clone() Ghost[gho].Handle.Name='Handle' Ghost[gho].Handle.Touched:connect(BladeFunc)
  291. Ghost[gho].Handle.Size=v3(0.4,pol+4,1)local mesh=INEW("SpecialMesh",Ghost[gho].Handle) mesh.MeshType='FileMesh' mesh.MeshId=as.Spear1 mesh.TextureId=as.Spear1T mesh.Scale=v3(3,3,3)
  292. Ghost[gho].Head=Ghost[gho].Handle:Clone() Ghost[gho].Head.Mesh.MeshId=as.Skull Ghost[gho].Head.Mesh.TextureId=''
  293. Ghost[gho].Head.Mesh.Scale=v3(1,1,1)/0.32 Ghost[gho].Head.Size=v3(1,1,1)
  294. Ghost[gho].Head.Name='Head'
  295. Ghost[gho].LA=kek:Clone() Ghost[gho].LA.Name=LA.Name Ghost[gho].LA.Size=v3(1,2,1) --LA:Clone()
  296. local kek=Ghost[gho].LA
  297. Ghost[gho].RA=kek:Clone() Ghost[gho].RA.Name=RA.Name --RA:Clone()
  298. Ghost[gho].LL=kek:Clone() Ghost[gho].LL.Name=LL.Name --LL:Clone()
  299. Ghost[gho].RL=kek:Clone() Ghost[gho].RL.Name=RL.Name --RL:Clone()
  300. Ghost[gho].Torso.Parent=ghom
  301. Ghost[gho].Head.Parent=ghom
  302. Ghost[gho].LA.Parent,Ghost[gho].RA.Parent,Ghost[gho].LL.Parent,Ghost[gho].RL.Parent,Ghost[gho].Handle.Parent=ghom,ghom,ghom,ghom,ghom
  303. local bp=INEW('BodyPosition',Ghost[gho].Handle)
  304. bp.maxForce=v31
  305. bp.Name='bp'
  306. for i,v in pairs(ghom:children()) do v.CanCollide=false if v.Name~='Handle' then v.Anchored=true
  307. v.BrickColor=BrickColor.new'Really black' v.Transparency=0.1 v.TopSurface=0 v.BottomSurface=0 end end
  308. end
  309. ------
  310. AOEDmg = function(pos,ra,dmg,func) -- range get
  311. local p0,p1=pos-v3(ra/2,ra/2,ra/2),pos+v3(ra/2,ra/2,ra/2)
  312. for i,v in pairs(workspace:FindPartsInRegion3(Region3.new(p0,p1),nil,100)) do
  313. local Hum=v.Parent:findFirstChild'Humanoid'
  314. if Hum and Hum.Health>0 and Hum~=Humanoid and (HitDB[Hum]==nil or (HitDB[Hum] and HitDB[Hum]<time())) then
  315. HitDB[Hum]=time()+0.08
  316. fDamage(dmg,v,Hum)
  317. if func then func(v,Hum) end
  318. elseif not Hum then
  319. ---------
  320. end
  321. end
  322. end
  323. -------
  324. GetX = function(Part,Point)
  325. local x,y,z=Part.CFrame:toObjectSpace(CFrame.new(Part.Position,Point)):toEulerAnglesXYZ()
  326. return math.deg(x)
  327. end
  328. GetY = function(Part,Point)
  329. local x,y,z=Part.CFrame:toObjectSpace(CFrame.new(Part.Position,Point)):toEulerAnglesXYZ()
  330. return math.deg(y)
  331. end
  332. -----
  333. --AddBV=function(str,cfr,par,deb,yy)
  334. --return qi{'BodyVelocity',par,velocity=cfr.lookVector*str,maxForce=v3(1/0,not yy and 1/0 or 0,1/0),Debris=deb,n='LibBV'}
  335. ----
  336.  
  337. Name="weapon"
  338. SkinColor="Pastel brown"
  339. Player=Players.LocalPlayer
  340. Character=Player.Character
  341. Torso,Head,Humanoid=Character.Torso,Character.Head,Character.Humanoid
  342. HRP=Character.HumanoidRootPart.RootJoint
  343. Neck=Torso.Neck
  344. oHRP=Character.HumanoidRootPart
  345.  
  346. pcall(function() Player.Backpack[Name]:Remove() end)
  347. pcall(function() Character[Name]:Remove() end)
  348. for i,v in pairs(workspace:children()) do if v.Name==Player.Name.."Ghost" then v:Remove() end end
  349.  
  350. Tool=INEW("HopperBin",Player.Backpack)
  351. Tool.Name=Name
  352.  
  353. Model=INEW("Model",Character)
  354. Model.Name=Name
  355.  
  356. -----------------------------LimbWelds
  357. LA=Character["Left Arm"]
  358. RA=Character["Right Arm"]
  359. LL=Character["Left Leg"]
  360. RL=Character["Right Leg"]
  361. LS=Torso:findFirstChild("Left Shoulder") or _G.LS
  362. RS=Torso:findFirstChild("Right Shoulder") or _G.RS
  363. LH=Torso:findFirstChild("Left Hip") or _G.LL
  364. RH=Torso:findFirstChild("Right Hip") or _G.RL
  365. _G.LS,_G.RS,_G.LH,_G.RH=LS,RS,LH,RH
  366. LA:BreakJoints() RA:BreakJoints() LL:BreakJoints() LL:BreakJoints()
  367. LS.Parent,RS.Parent,LH.Parent,RH.Parent=Torso,Torso,Torso,Torso
  368. LS.Part0,RS.Part0,LH.Part0,RH.Part0=Torso,Torso,Torso,Torso
  369. LS.Part1,RS.Part1,LH.Part1,RH.Part1=LA,RA,LL,RL
  370. cLA0,cLA1=CF(-1.5,0.5,0),CF(0,0.5,0)
  371. cRA0,cRA1=CF(1.5,0.5,0),CF(0,0.5,0)
  372. cLL0,cLL1=CF(-0.5,-1,0),CF(0,1,0)
  373. cRL0,cRL1=CF(0.5,-1,0),CF(0,1,0)
  374. for i,v in pairs{"LS","RS","LH","RH"} do
  375. local w=getfenv()[v]
  376. getfenv()["a"..v.."0"]=_G["RMo1"..v] or w.C0.p
  377. getfenv()["a"..v.."1"]=_G["RMo2"..v] or w.C1.p
  378. local a,b,c=w.C0:toEulerAnglesXYZ()
  379. local x,y,z=w.C1:toEulerAnglesXYZ()
  380. getfenv()["b"..v.."0"]=_G["RMo3"..v] or v3(mdeg(a),mdeg(b),mdeg(c))
  381. getfenv()["b"..v.."1"]=_G["RMo4"..v] or v3(mdeg(x),mdeg(y),mdeg(z))
  382. _G["RMo1"..v]=getfenv()["a"..v.."0"]
  383. _G["RMo2"..v]=getfenv()["a"..v.."1"]
  384. _G["RMo3"..v]=getfenv()["b"..v.."0"]
  385. _G["RMo4"..v]=getfenv()["b"..v.."1"]
  386. end
  387. ------Sounds
  388. for i,v in pairs(Torso:children()) do
  389. if v:IsA'Sound' then v:Remove() end
  390. end
  391. for i,v in pairs(oHRP:children()) do
  392. if v.Name:sub(1,2)=="RM" then v:Remove() end
  393. end
  394. HRPDist = function(pos,adj) return (oHRP.Position-CF(pos,oHRP.Position)*CF(0,0,adj and -adj or 0).p).magnitude end
  395. oBP=INEW("BodyPosition",oHRP)
  396. oBG=INEW("BodyGyro",oHRP)
  397. oBV=INEW("BodyVelocity",oHRP)
  398. oBP.Name="RMBP"
  399. oBG.Name="RMBG"
  400. oBV.Name="RMBV"
  401. oBP.maxForce=v30
  402. oBP.D=500
  403. oBG.maxTorque=v30
  404. oBG.D=100
  405. oBV.maxForce=v30
  406. DoBP=function(pos,adj)
  407. if not pos then oBP.maxForce=v30 return end
  408. oBP.maxForce=v31 --(1/0,0,1/0)
  409. oBP.position=(CF(pos,oHRP.Position)*CF(0,0,adj and -adj or 0)).p
  410. end
  411. DoBG=function(pos)
  412. if not pos then oBG.maxTorque=v30 return end
  413. oBG.maxTorque=v31
  414. oBG.cframe=CF(oHRP.Position,v3(pos.x,oHRP.Position.y,pos.z))
  415. end
  416. for i,n in pairs(so2) do
  417. so[n]={}
  418. so[n].Pitch=1
  419. so[n].Volume=1
  420. so[n].SoundId=as[n]
  421. so[n].Play=function(table)
  422. local v=INEW("Sound",Torso)
  423. v.Volume=so[n].Volume
  424. v.Pitch=so[n].Pitch
  425. v.Looped=false
  426. v.Name=n
  427. v.SoundId=as[n]
  428. v:Play()
  429. Debris:AddItem(v,5)
  430. end
  431. end
  432. SlashPitch=1.3
  433. so.Slash.Pitch=SlashPitch
  434.  
  435. wLA=newWeld(nil,nil,nil,cLA0,cLA1) wLA.Name="left shoulder"
  436. wRA=newWeld(nil,nil,nil,cRA0,cRA1) wRA.Name="right shoulder"
  437. wLL=newWeld(nil,nil,nil,cLL0,cLL1) wLL.Name="left hip"
  438. wRL=newWeld(nil,nil,nil,cRL0,cRL1) wRL.Name="right hip"
  439. Arms = function(on)
  440. if on then
  441. LS.Parent,RS.Parent=nil,nil
  442. LS.Part0,RS.Part0=nil,nil
  443. LS.Part1,RS.Part1=nil,nil
  444. wLA.Parent,wRA.Parent=Torso,Torso
  445. wLA.Part0,wRA.Part0=Torso,Torso
  446. wLA.Part1,wRA.Part1=LA,RA
  447. else
  448. wLA.Parent,wRA.Parent=nil,nil
  449. wLA.Part0,wRA.Part0=nil,nil
  450. wLA.Part1,wRA.Part1=nil,nil
  451. LS.Parent,RS.Parent=Torso,Torso
  452. LS.Part0,RS.Part0=Torso,Torso
  453. LS.Part1,RS.Part1=LA,RA
  454. end
  455. end
  456. LegUse = false
  457. Legs= function(on)
  458. LegUse=on
  459. if on then
  460. LH.Parent,RH.Parent=nil,nil
  461. LH.Part0,RH.Part0=nil,nil
  462. LH.Part1,RH.Part1=nil,nil
  463. wLL.Parent,wRL.Parent=Torso,Torso
  464. wLL.Part0,wRL.Part0=Torso,Torso
  465. wLL.Part1,wRL.Part1=LL,RL
  466. else
  467. wLL.Parent,wRL.Parent=nil,nil
  468. wLL.Part0,wRL.Part0=nil,nil
  469. wLL.Part1,wRL.Part1=nil,nil
  470. LH.Parent,RH.Parent=Torso,Torso
  471. LH.Part0,RH.Part0=Torso,Torso
  472. LH.Part1,RH.Part1=LL,RL
  473. end
  474. end
  475. Arms()
  476. Legs()
  477. WalkBrick=INEW("Part",Model)
  478. WalkBrick.Anchored=true WalkBrick.Size=Vector3.new(1,1,1)
  479. WalkBrick.Transparency=1 WalkBrick.CanCollide=false
  480. WalkBrick.CFrame=CF(0,-10,0)
  481. -----------------------------------------------------
  482. Color1="Black"
  483. Color2="Bright yellow"
  484. Color3="Pastel brown"
  485. EffectColor="Bright yellow"
  486.  
  487. pol=4
  488. Handle=newPart(0,0,0,nil,nil,Color1)
  489. Handlem=newMesh(Handle,"Cylinder",0.2,pol-0.33,0.2)
  490. wHandle=newWeld(Handle,Torso,Handle,CF(0.8,1.5,0.43)*CA(-25,0,135))
  491. tpol=CF(0,2+(pol+4)/2,0)
  492. HitBox=newPart(0.3,tpol.y,0.8)
  493. HitBox.CanCollide=false
  494. HitBox.Transparency=1
  495. wHitBox=newWeld(HitBox,Handle,HitBox,CF(0,tpol.y/2,0))
  496. oHandle0,oHandle1=GetWeld(wHandle)
  497. ---bottomdesignvv
  498. for x=-1,1,2 do
  499. for xx=-1,1,2 do
  500. part=newPart(0,0,0,nil,nil,'Dark stone grey')
  501. partm=newMesh(part,as.diamond,0.2,0.15,0.4)
  502. partw=newWeld(part,Handle,part,CF(0,x*(pol/2-0.08),0*x)*CA(55*xx,0,0))
  503. end
  504. part=newPart(0,0,0,nil,nil,Color1)
  505. partm=newMesh(part,as.cone,0.06,1,0.06)
  506. partw=newWeld(part,Handle,part,CF(0,-pol/2-1.05,0.1*x)*CA(180,0,0))
  507. local thecf=CF(0,-pol/2-0.7,0.1*x)*CA(90*x+(-90*x/3),0,0)
  508. for i=1,3 do
  509. part=newPart(0,0,0,nil,nil,Color1)
  510. partm=newMesh(part,as.cone,0.09,0.4,0.09)
  511. partw=newWeld(part,Handle,part,thecf)
  512. thecf=thecf*CA(-90*x/3,0,0)*CF(0,0.2,0.035*x)
  513. end
  514. end
  515. ---botomdesign^^^
  516. local xx=37
  517. for x=-1,1,2 do
  518. local thecf=CF(0,pol/2,0)
  519. for lel=0.17,0.31,(0.3-0.17)/2 do
  520. part=newPart(0,0,0,nil,nil,Color1)
  521. partm=newMesh(part,"Block",0.12,lel+0.04,0.06)
  522. thecf=thecf*CA(-xx*x,0,0)*CF(0,lel/2,0)
  523. partw=newWeld(part,Handle,part,thecf)
  524. local outline=part:Clone() outline.Parent=part
  525. newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5)
  526. outline.BrickColor=BrickColor.new(Color2)
  527. ----
  528. part=newPart(0,0,0,nil,nil,Color1)
  529. partm=newMesh(part,"Block",0.12,lel+0.04,0.06)
  530. thecf=thecf*CF(0,lel/2,0)*CA(xx*2*x,0,0)*CF(0,lel/2,0)
  531. partw=newWeld(part,Handle,part,thecf)
  532. local outline=part:Clone() outline.Parent=part
  533. newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5)
  534. outline.BrickColor=BrickColor.new(Color2)
  535. ------
  536. thecf=thecf*CF(0,lel/2,0)*CA(-xx*x,0,0)
  537. end
  538. end
  539. ----botom
  540. local xx=30
  541. for x=-1,1,2 do
  542. local thecf=CF(0,-pol/2,0)*CA(180,0,0)
  543. for lel=0.14,0.26,(0.25-0.14) do
  544. part=newPart(0,0,0,nil,nil,Color1)
  545. partm=newMesh(part,"Block",0.12,lel+0.04,0.06)
  546. thecf=thecf*CA(-xx*x,0,0)*CF(0,lel/2,0)
  547. partw=newWeld(part,Handle,part,thecf)
  548. local outline=part:Clone() outline.Parent=part
  549. newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5)
  550. outline.BrickColor=BrickColor.new(Color2)
  551. ----
  552. part=newPart(0,0,0,nil,nil,Color1)
  553. partm=newMesh(part,"Block",0.12,lel+0.04,0.06)
  554. thecf=thecf*CF(0,lel/2,0)*CA(xx*2*x,0,0)*CF(0,lel/2,0)
  555. partw=newWeld(part,Handle,part,thecf)
  556. local outline=part:Clone() outline.Parent=part
  557. newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5)
  558. outline.BrickColor=BrickColor.new(Color2)
  559. ------
  560. thecf=thecf*CF(0,lel/2,0)*CA(-xx*x,0,0)
  561. end
  562. end
  563. part=newPart(0,0,0,nil,nil,"Bright orange")
  564. partm=newMesh(part,"Sphere",0.2,0.35,0.35)
  565. partw=newWeld(part,Handle,part,CF(0,pol/2+1.4,0))
  566. partx=newPart(0,0,0,nil,nil,Color3)
  567. newMesh(partx,"Cylinder",0.4,0.11,0.4)
  568. newWeld(part,Handle,partx,CF(0,pol/2+1.4,0)*CA(0,0,90))
  569. part=newPart(0,0,0,nil,nil,Color1)
  570. partm=newMesh(part,"Cylinder",0.36,0.1,0.36)
  571. partw=newWeld(part,Handle,part,CF(0,pol/2+1.45,0)*CA(0,0,90))
  572. ----right half
  573. local blade1=CF(0,pol/2+1.6,-0.15)
  574. --
  575. local blens={2.4,1.6,0.8,0.2,0.3,0.4}
  576. for i=1,3 do
  577. local len=blens[i]
  578. local wid=blens[i+3]
  579. part=newPart(0,0,0,nil,nil,Color1)
  580. partm=newMesh(part,"Wedge",0.1+(0.01*i),len,wid)
  581. partw=newWeld(part,Handle,part,blade1*CF(0,len/2,-0.17+0.3-wid/2))
  582. part=newPart(0,0,0)
  583. partm=newMesh(part,"Wedge",0.06,len,wid)
  584. partw=newWeld(part,Handle,part,blade1*CF(0,len/2,-0.18+0.3-wid/2))
  585. end
  586. --
  587. function makedia(cur,xx,len,ii,ad,ad2)
  588. local ad = ad or 0
  589. local ad2=ad2 or 0
  590. part=newPart(0,0,0,nil,nil,Color1)
  591. partm=newMesh(part,as.diamond,0.05+ad/10,0.25+len,xx/120)
  592. partw=newWeld(part,Handle,part,cur*CA(ii,0,0)*CF(0,0.1+len,0))
  593. for x=-1,1,2 do
  594. part=newPart(0,0,0,nil,nil,Color3)
  595. partm=newMesh(part,"Block",0.12+ad+(0.01*x),len+0.02,0.05+ad2)
  596. partw=newWeld(part,Handle,part,cur*CA(ii,0,0)*CF(0,0.18,0)*CA(xx*x,0,0)*CF(0,len/2,0))
  597. part=newPart(0,0,0,nil,nil,Color3)
  598. partm=newMesh(part,"Block",0.12+ad+(0.01*x),len+0.02,0.05+ad2)
  599. partw=newWeld(part,Handle,part,cur*CA(ii,0,0)*CF(0,0.18,0)*CA(xx*x,0,0)*CF(0,len,0)*CA(-xx*x*2,0,0)*CF(0,len/2,0))
  600. end
  601. end
  602. makedia(blade1*CF(0,-0.29,-0.03+0.025),20,0.4,90+33,0,0.03)
  603. makedia(blade1*CF(0,0.04,0.25),20,0.35,-90-20)
  604. makedia(blade1*CF(0,0.05,0.1),20,0.35,-90-60,0.01)
  605. --makedia(blade1*CF(0,-0.15,-0.025),15,0.4,-90-90,0.05)
  606. part=newPart(0,0,0,nil,nil,Color1)
  607. partm=newMesh(part,as.cone,0.04,0.5,0.18)
  608. partw=newWeld(part,Handle,part,blade1*CF(0,-0.625,-0.1)*CA(-135,0,0)*CF(0,-0.15,0))
  609. local cur=blade1*CF(0,-0.625,-0.1)*CA(-135,0,0)*CF(0,0,0)
  610. for i=1,3 do
  611. part=newPart(0,0,0,nil,nil,Color1)
  612. partm=newMesh(part,as.cone,0.1,0.5,0.1)
  613. partw=newWeld(part,Handle,part,cur)
  614. cur=cur*CA(-23,0,0)*CF(0,0.25,0.02)
  615. end
  616. for i=1,4 do
  617. part=newPart(0,0,0,nil,nil,Color1)
  618. partm=newMesh(part,as.cone,0.1,0.5,0.1)
  619. partw=newWeld(part,Handle,part,cur)
  620. cur=cur*CA(i==7 and 20 or 30,0,0)*CF(0,0.25,-0.02)
  621. end
  622. ---------------------------------------------
  623. ----left half
  624. local blade1=CF(0,pol/2+1.4,0.05)*CA(0,180,0)
  625. --
  626. part=newPart(0,0,0,nil,nil,Color1)
  627. partm=newMesh(part,"Wedge",0.1,2,0.2)
  628. partw=newWeld(part,Handle,part,blade1*CF(0,1,-0.1))
  629. part=newPart(0,0,0)
  630. partm=newMesh(part,"Wedge",0.06,2,0.2)
  631. partw=newWeld(part,Handle,part,blade1*CF(0,1,-0.11))
  632. part=newPart(0,0,0,nil,nil,Color1)
  633. partm=newMesh(part,"Wedge",0.1,0.4,0.37)
  634. partw=newWeld(part,Handle,part,blade1*CF(0,-0.06,-0.23)*CA(-10,0,0))
  635. part=newPart(0,0,0,nil,nil,'')
  636. partm=newMesh(part,"Wedge",0.06,0.4,0.37)
  637. partw=newWeld(part,Handle,part,blade1*CF(0,-0.06,-0.24)*CA(-10,0,0))
  638. part=newPart(0,0,0,nil,nil,Color1)
  639. partm=newMesh(part,"Wedge",0.06,0.2,0.425)
  640. partw=newWeld(part,Handle,part,blade1*CF(0,-0.7,-0.16)*CA(-90-35,0,0))
  641. -----------------------------------------------------------WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW--stufs
  642. --Basic poses:
  643. Pose={"None","Walking","Running","Jumping","Jumping2","Sitting"}
  644. for i,v in pairs(Pose) do
  645. Pose[v]={ --1=Adj Speed 0=C0xyz 1=C1xyz 2=C0abc 3=C1abc
  646. ["Handle"]={[0]=v3(0,-1.1,0),[1]=v3(0,0,0),[2]=v3(-90,0,0),[3]=v3(-20,20,0)},
  647. ["HRP"]={[-1]=0,[0]=v30,[1]=v30,[2]=v3(0,0,0),[3]=v3(0,0,0)},
  648. ["Neck"]={[0]=v3(0,1,0),[1]=v3(0,-0.5,0),[2]=v3(0,0,0),[3]=v3(0,0,0)},
  649. ["LA"]={[-1]=1,[0]=cLA0,[1]=cLA1,[2]=v3(-20,0,-10)},
  650. ["RA"]={[-1]=0.75,[0]=cRA0,[1]=cRA1,[2]=v3(20,20,15)},
  651. ["LH"]={[-1]=1,[0]=aLH0,[1]=aLH1,[2]=bLH0,[3]=bLH1},
  652. ["RH"]={[-1]=1,[0]=aRH0,[1]=aRH1,[2]=bRH0,[3]=bRH1}
  653. }
  654. end
  655. --Fixes
  656. xHRP=v3(-90,0,-180)
  657. xNeck=v3(-90,0,180)
  658. local xHRP0,xHRP1=Pose.None.HRP[0],Pose.None.HRP[1]
  659. HRP.C0=CF(xHRP0.x,xHRP0.y,xHRP0.z)*CA(xHRP.x,xHRP.y,xHRP.z)
  660. HRP.C1=CF(xHRP1.x,xHRP1.y,xHRP1.z)*CA(xHRP.x,xHRP.y,xHRP.z)
  661. local xNeck0,xNeck1=Pose.None.Neck[0],Pose.None.Neck[1]
  662. Neck.C0=CF(xNeck0.x,xNeck0.y,xNeck0.z)*CA(xNeck.x,xNeck.y,xNeck.z)
  663. Neck.C1=CF(xNeck1.x,xNeck1.y,xNeck1.z)*CA(xNeck.x,xNeck.y,xNeck.z)
  664. ------Set pose:
  665. RunLean=30
  666. JumpLean=50
  667. -----Walking
  668. Pose.Walking.HRP[-1]=0.25
  669. Pose.Walking.Handle[3]=v3(0,0,0)
  670. Pose.Walking.RA[2]=v3(0,15,30)
  671. Pose.Walking.LA[2]=v3(0,-15,-20)
  672. Pose.Walking.LA[-1]=1
  673. --Running
  674. Pose.Running.HRP[-1]=1.4
  675. Pose.Running.HRP[2]=v3(-RunLean,0,0)
  676. Pose.Running.Neck[2]=v3(RunLean,0,0)
  677. Pose.Running.Handle[1]=v3(0,1.2,0)
  678. Pose.Running.Handle[3]=v3(-30,0,0)
  679. Pose.Running.RA[2]=v3(-30,-35,15)
  680. Pose.Running.LA[0]=v3(-1.35,0.5,-0.6)
  681. Pose.Running.LA[2]=v3(100,0,30)
  682. Pose.Running.LA[-1]=1
  683. --Jumping
  684. Pose.Jumping.Handle[1]=v3(0,-1.5,0)
  685. Pose.Jumping.Handle[3]=v3(-45,0,0)
  686. Pose.Jumping.RA[2]=v3(200,20,0)
  687. Pose.Jumping.LA[2]=v3(-45,0,-20)
  688. Pose.Jumping.LH[0]=Pose.Jumping.LH[0]+v3(-0.03,0.3,-1)
  689. Pose.Jumping.LH[2]=Pose.Jumping.LH[2]+v3(-45,0,18)
  690. Pose.Jumping.RH[0]=Pose.Jumping.RH[0]+v3(0.03,0.25,-0.3)
  691. Pose.Jumping.RH[2]=Pose.Jumping.RH[2]+v3(-15,0,-18)
  692. --Jumping2
  693. Pose.Jumping2.HRP[2]=v3(-JumpLean,0,0)
  694. Pose.Jumping2.Neck[2]=v3(JumpLean,0,0)
  695. Pose.Jumping2.Handle[1]=v3(0,-1.5,0)
  696. Pose.Jumping2.Handle[3]=v3(-45,0,0)
  697. Pose.Jumping2.RA[2]=v3(200,20,0)
  698. Pose.Jumping2.LA[0]=v3(-1.4,0.6,-0.1)
  699. Pose.Jumping2.LA[2]=v3(180-JumpLean,0,10)
  700. Pose.Jumping2.LH[0]=Pose.Jumping2.LH[0]+v3(-0.03,0.3,-1)
  701. Pose.Jumping2.LH[2]=Pose.Jumping2.LH[2]+v3(-45,0,18)
  702. Pose.Jumping2.RH[0]=Pose.Jumping2.RH[0]+v3(0.03,0.25,-0.3)
  703. Pose.Jumping2.RH[2]=Pose.Jumping2.RH[2]+v3(-15,0,-18)
  704. ---Sitting
  705. Pose.Sitting.Handle[1]=v3(0,1,0)
  706. Pose.Sitting.Handle[3]=v3(-10,0,0)
  707. Pose.Sitting.RA[2]=v3(-50,0,150)
  708. Pose.Sitting.RA[-1]=0
  709. Pose.Sitting.HRP[0]=v3(0,-1.75,0)
  710. Pose.Sitting.HRP[2]=v3(20,0,0)
  711. Pose.Sitting.LH[0]=Pose.Sitting.LH[0]+v3(0,0.1,-0.1)
  712. Pose.Sitting.LH[2]=Ca(70,-90,0,-10,-5,0)
  713. Pose.Sitting.RH[0]=Pose.Sitting.RH[0]+v3(0,0.1,-0.1)
  714. Pose.Sitting.RH[2]=Ca(70,90,0,-10,5,0)
  715. ----------------
  716. Anim="Deselected"
  717. LegAnim="None"
  718. ArmAnim="None"
  719. WalkSpeed=18
  720. WalkM={1,1,1,1,1,1,1,1,1,1} -- multiplier
  721. aSpd=8
  722. BladeTrail=false
  723. JumpDebounce=time()
  724. Key={}
  725. ----------
  726. GetFrontRay = function(cff,Dist,X,Y,Z,Exclude)
  727. local cff = cff or oHRP.CFrame
  728. local Hit,Pos,Hum,Torso
  729. local Hits={}
  730. for i,v in pairs(workspace:children()) do
  731. if v~=Exclude and v~=Character and v:findFirstChild'Humanoid' and v.Humanoid.Health>0 and v:findFirstChild'Torso' then
  732. local cor=cff:toObjectSpace(v.Torso.CFrame)
  733. if cor.x<X[2] and cor.x>X[1] and cor.y<Y[2] and cor.y>Y[1] and -cor.z<Z[2] and -cor.z>Z[1] and -cor.z<Dist then
  734. if Dist>800 then
  735. local i=#Hits+1
  736. Hits[i]={}
  737. Hits[i][1]=v.Torso
  738. Hits[i][2]=v.Humanoid
  739. Hits[i][3]=CF(v3(v.Torso.Position.x,cff.y,v.Torso.Position.z),cff.p)*CF(0,0,-(v.Torso.Size.x+v.Torso.Size.z)/2).p
  740. else
  741. Hit,Pos=v.Torso,CF(v3(v.Torso.Position.x,cff.y,v.Torso.Position.z),cff.p)*CF(0,0,-(v.Torso.Size.x+v.Torso.Size.z)/2).p
  742. Dist,Hum,Torso=-cor.z,v.Humanoid,v.Torso
  743. end
  744. end
  745. end
  746. end
  747. if Dist>800 then return Hits end
  748. return Hit,(Pos or cff*CF(0,0,-Dist-1).p),Dist,Hum,Torso
  749. end
  750. ---------------------------------------------------
  751. onKeyDown = function(k)
  752. local FrontHit,FrontHitPos,FrontHitDist,FrontHitHum,FrontHitTorso=GetFrontRay(nil,200,{-3,3},{-3,3},{5,300})
  753. -------------------------
  754. local MouseHit,MouseHitPos=Mouse.Target,Mouse.Hit.p
  755. local MouseHitDist=(oHRP.Position-MouseHitPos).magnitude
  756. MouseHit=(MouseHit and MouseHit.Parent:IsA'Hat') and MouseHit.Parent.Parent:findFirstChild'Torso' or MouseHit
  757. local MouseHitHum=MouseHit and MouseHit.Parent:findFirstChild'Humanoid'
  758. local MouseHitTorso=MouseHit and MouseHit.Parent:findFirstChild'Torso'
  759. --------------------------------
  760. if k=="0" and Anim=="Walking" then
  761. Anim="Running"
  762. --Pierce Burst
  763. elseif k=="0" and Anim=="Stance1" then
  764. Anim="Stance1P"
  765. local bSpd=aSpd-2
  766. GetRecent()
  767. for i=1,bSpd do
  768. SetWeld(wHandle,1,i,bSpd,phandle1,phandle3,Pose.None.Handle[1]+v3(0,-1.5,0),v3(90,-15,0))
  769. SetWeld(wRA,0,i,bSpd,pra0,pra2,v3(1.1,0.5,-0.7),Ca(90,0,-60,3,0,0))
  770. SetWeld(wLA,0,i,bSpd,pla0,pla2,v3(-1.2,0.5,-0.5),Ca(90,0,-45,3,0,0))
  771. MeshEffect(0.1,oHRP.CFrame*CF(0,-GroundRange+0.5,0),0.5,as.blast,CA(0,10,0),GroundColor,v3(0.5,0.1,0.5)*5,v3(0.5,0,0.5)*5)
  772. wait()
  773. end
  774. repeat ------ repeatative
  775. if FrontHitDist>12 and FrontHitHum then --hax
  776. so.Slash:Play()
  777. MeshEffect(0.1,CF(oHRP.Position,FrontHitPos)*CF(0,0,2),0.5,as.ring,nil,EffectColor,v3(1.5,1.5,0)*5,v3(1,1,0)*5)
  778. DoBP(FrontHitPos,5)
  779. DoBG(FrontHitPos)
  780. local timee=time()
  781. repeat
  782. BladeTrail=true
  783. MeshEffect(0.1,oHRP.CFrame*CF(0,-GroundRange+0.5,0),0.5,as.blast,CA(0,10,0),GroundColor,v3(0.5,0.1,0.5)*5,v3(0.5,0,0.5)*5)
  784. wait() until timee+2.5<time() or HRPDist(FrontHitPos,5)<2
  785. DoBP()
  786. DoBG()
  787. Torso.Velocity=v30
  788. oHRP.Velocity=v30
  789. BladeTrail=false
  790. if HRPDist(FrontHitPos,5)<2 then
  791. AOEDmg(HitBox.CFrame*CF(0,HitBox.Size.y,0).p,8,Damage/2,function() so.Hit:Play() end)
  792. so.Abscond:Play()
  793. local BoomCF=CF(v3(FrontHitPos.x,oHRP.Position.y-3,FrontHitPos.z),oHRP.Position-v3(0,3,0))*CA(0,180,0)
  794. MeshEffect(0.07,BoomCF,0.05,'Sphere',CA(0,0,0),GroundColor,v3(5,5,5),v3(5,10,5))
  795. MeshEffect(0.07,BoomCF*CF(0,0.5,0),0.05,as.blast,CA(0,15,0),GroundColor,v3(5,0.75,5),1.1)
  796. for i=30,360,30 do
  797. MeshEffect(0.08,HitBox.CFrame*CF(0,HitBox.Size.y/2,0)*CA(0,i,165)*CF(0,i%60==0 and 1 or 0,0),0.2,as.diamond,CF(0,0.5,0),EffectColor,v3(0.6,2.4,0.6),v3(0,2,0))
  798. end --mesh360
  799. else
  800. DoBP()
  801. DoBG()
  802. end --dist
  803. end --hax
  804. wait()
  805. FrontHit,FrontHitPos,FrontHitDist,FrontHitHum,FrontHitTorso=GetFrontRay(nil,200,{-3,3},{-3,3},{12,300},FrontHit and FrontHit.Parent)
  806. until not Key[k]
  807. Anim="Stance1P2"
  808. local xhrp0,xhrp1=GetWeld(HRP)
  809. local xa,xb=GetWeld(Neck)
  810. local xr1,xr2=GetWeld(wRA)
  811. local xl1,xl2=GetWeld(wLA)
  812. local xhh1,xhh2=GetWeld(wHandle,1)
  813. for i=1,aSpd do
  814. if Anim~="Stance1P2" then break end
  815. SetWeld(HRP,0,i,aSpd,xhrp0,xhrp1,phrp0,phrp2)
  816. SetWeld(wHandle,1,i,aSpd,xhh1,xhh2,phandle1,phandle3)
  817. SetWeld(wRA,0,i,aSpd,xr1,xr2,pra0,pra2)
  818. SetWeld(wLA,0,i,aSpd,xl1,xl2,pla0,pla2)
  819. wait()
  820. end
  821. if Anim~="Stance1P2" then return end
  822. Anim="Stance1"
  823. --Spinning Slash
  824. elseif k=="q" and Anim=="Stance1" then
  825. Anim="Stance1Spin"
  826. BladeTrail=true
  827. local bSpd=aSpd+5
  828. GetRecent()
  829. so.Slash:Play()
  830. for i=1,bSpd do
  831. SetWeld(HRP,0,i,bSpd,phrp0,phrp2,Pose.None.HRP[0],Pose.None.HRP[2]+v3(-3,-360-70,0))
  832. SetWeld(wHandle,1,i,bSpd,phandle1,phandle3,Pose.None.Handle[1]+v3(0,-1.5,0),v3(111,0,-105))
  833. SetWeld(wRA,0,i,bSpd,pra0,pra2,v3(1.1,0.5,-0.7),Ca(90,0,-45,0,0,0))
  834. SetWeld(wLA,0,i,bSpd,pla0,pla2,v3(-1.2,0.5,-0.5),Ca(90,0,30,0,0,0))
  835. SetWeld(LH,0,i,bSpd,plh0,plh2,Pose.None.LH[0],Ca(0,-90,0,-10,0,0))
  836. SetWeld(RH,0,i,bSpd,prh0,prh2,Pose.None.RH[0],Ca(0,90,0,-20,0,0))
  837. wait()
  838. end
  839. ClearWeld(HRP)
  840. BladeTrail=false
  841. local xhrp0,xhrp1=GetWeld(HRP)
  842. local xa,xb=GetWeld(Neck)
  843. local xr1,xr2=GetWeld(wRA)
  844. local xl1,xl2=GetWeld(wLA)
  845. local xlh1,xlh2=GetWeld(LH)
  846. local xrh1,xrh2=GetWeld(RH)
  847. local xhh1,xhh2=GetWeld(wHandle,1)
  848. for i=1,aSpd do
  849. SetWeld(HRP,0,i,aSpd,xhrp0,xhrp1,phrp0,phrp2)
  850. SetWeld(wHandle,1,i,aSpd,xhh1,xhh2,phandle1,phandle3)
  851. SetWeld(wRA,0,i,aSpd,xr1,xr2,pra0,pra2)
  852. SetWeld(wLA,0,i,aSpd,xl1,xl2,pla0,pla2)
  853. SetWeld(LH,0,i,aSpd,xlh1,xlh2,plh0,plh2)
  854. SetWeld(RH,0,i,aSpd,xrh1,xrh2,prh0,prh2)
  855. wait()
  856. end
  857. Anim="Stance1"
  858. --Jump Slash
  859. elseif k==" " and Anim=="Jumping" and JumpDebounce<time() then
  860. JumpDebounce=time()+1
  861. MeshEffect(0.1,Torso.CFrame*CF(0,-1,0)*CA(180,0,0),0.5,as.blast,CF(0,0.6,0)*CA(0,10,0),EffectColor,v3(0.75,0.2,0.75)*5,v3(0,0.8,0)*5)
  862. Torso.Velocity=v3(Torso.Velocity.x,100,Torso.Velocity.z)
  863. so.Abscond.Pitch=1.3
  864. so.Abscond:Play()
  865. elseif k==" " and Anim=="Jumping2" and GroundRange>6 and JumpDebounce<time() then
  866. JumpDebounce=time()+1
  867. MeshEffect(0.1,Torso.CFrame*CF(0,-1,0)*CA(180,0,0),0.5,as.blast,CF(0,0.6,0)*CA(0,10,0),EffectColor,v3(2,0.5,2),0.3)
  868. Torso.Velocity=v3(Torso.Velocity.x,95,Torso.Velocity.z)
  869. so.Abscond.Pitch=1.3
  870. so.Abscond:Play()
  871. WalkM[3]=1.4
  872. repeat wait() until not Falling
  873. WalkM[3]=1
  874. --Stance two
  875. elseif k=="q" and (Anim=="None" or Anim=="Walking") then
  876. Anim="Stance2Ready"
  877. WalkM[2]=0.25
  878. local hrp0,hrp1=GetWeld(HRP)
  879. local a,b=GetWeld(Neck)
  880. local r1,r2=GetWeld(wRA)
  881. local l1,l2=GetWeld(wLA)
  882. local lh1,lh2=GetWeld(LH)
  883. local rh1,rh2=GetWeld(RH)
  884. local hh1,hh2=GetWeld(wHandle,1)
  885. for i=1,aSpd do
  886. SetWeld(HRP,0,i,aSpd,hrp0,hrp1,Pose.None.HRP[0]+v3(0,-0.7-0.3,0),Pose.None.HRP[2]+v3(-20,70,0))
  887. SetWeld(Neck,0,i,aSpd,a,b,Pose.None.Neck[0],Pose.None.Neck[2]+v3(0,-70,0))
  888. SetWeld(wHandle,1,i,aSpd,hh1,hh2,Pose.None.Handle[1]+v3(0,-1.5,0.2),v3(40-110+35,0,-90+30))
  889. SetWeld(wRA,0,i,aSpd,r1,r2,v3(1.2,0.55,-0.5),Ca(90,30,60-20,0,0,0))
  890. SetWeld(wLA,0,i,aSpd,l1,l2,v3(-1,0.5,-0.55),Ca(100-20,30-0,75-30,0,0,0))
  891. SetWeld(LH,0,i,aSpd,lh1,lh2,Pose.None.LH[0]+v3(0,0.45+0.3,-0.95),Ca(-22,-90,0, 15,0,0))
  892. SetWeld(RH,0,i,aSpd,rh1,rh2,Pose.None.RH[0]+v3(-0.1,0.4+0.3,0.05),Ca(0,90,0,-85,0,0))
  893. wait()
  894. end
  895. Anim="Stance2"
  896. repeat wait() until not Key[k] and Anim=="Stance2"
  897. WalkM[2]=1
  898. Anim="None"
  899. --Stance one
  900. elseif k=="e" and (Anim=="None" or Anim=="Walking") then
  901. Anim="Stance1Ready"
  902. WalkM[2]=0.25
  903. local hrp0,hrp1=GetWeld(HRP)
  904. local a,b=GetWeld(Neck)
  905. local r1,r2=GetWeld(wRA)
  906. local l1,l2=GetWeld(wLA)
  907. local lh1,lh2=GetWeld(LH)
  908. local rh1,rh2=GetWeld(RH)
  909. local hh1,hh2=GetWeld(wHandle,1)
  910. for i=1,aSpd do
  911. SetWeld(HRP,0,i,aSpd,hrp0,hrp1,Pose.None.HRP[0]+v3(0,-0.7,0),Pose.None.HRP[2]+v3(-20,-70,0))
  912. SetWeld(Neck,0,i,aSpd,a,b,Pose.None.Neck[0],Pose.None.Neck[2]+v3(0,70,0))
  913. SetWeld(wHandle,1,i,aSpd,hh1,hh2,Pose.None.Handle[1]+v3(0,-1.5,0.15),v3(40-110,0,-90))
  914. SetWeld(wRA,0,i,aSpd,r1,r2,v3(1.1,0.5,-0.7),Ca(90,-20,60,0,0,0))
  915. SetWeld(wLA,0,i,aSpd,l1,l2,v3(-1,0.75,-0.45),Ca(100,-20,75,0,0,0))
  916. SetWeld(LH,0,i,aSpd,lh1,lh2,Pose.None.LH[0]+v3(0.6,0.4,-0.05),Ca(0,-90,0,-85,0,0))
  917. SetWeld(RH,0,i,aSpd,rh1,rh2,Pose.None.RH[0]+v3(-0.3,0.45,-0.93),Ca(-22,90,0,-15,0,0))
  918. wait()
  919. end
  920. Anim="Stance1"
  921. repeat wait() until not Key[k] and Anim=="Stance1"
  922. WalkM[2]=1
  923. Anim="None"
  924. elseif k=="x" and (Anim=="None" or Anim=="Walking") then
  925. WalkM[2]=0
  926. Anim="Sitting"
  927. elseif (k=="x" or k==" ") and Anim=="Sitting" then
  928. WalkM[2]=1
  929. Anim="None"
  930. elseif k =="p" then
  931. repeat
  932. Effect1(Torso.CFrame*CF(0,4,0)*CA(mrnd(-30,30),mrnd(-200,200),mrnd(-200,200)),CF(0,0,1.5),8,mrnd(45,150),10,1,0.85,0.1)--cf,Radius,Deg,Parts,Fade,Wide
  933. wait(0.3)
  934. until not Key[k]
  935. elseif k=="[" then
  936. if #Ghost==0 then
  937.  
  938. NewGhost(CF(0,8,0))
  939. NewGhost(CF(0,16,0))
  940. NewGhost(CF(0,24,0))
  941.  
  942.  
  943. else
  944. for i=1,1 do Ghost[i][1]=nil end end
  945. end
  946. end
  947. --
  948. ---------------------------------------------------
  949. onKeyUp = function(k)
  950. if k=="0" and Anim=="Running" then
  951. Anim="Walking"
  952. end
  953. end
  954. ---------------------------------------------------------------------------------------------BUTTON -WWWWBUTTON
  955. onButton1Down= function()
  956. --Jump Slash
  957. if Anim=="Jumping" and GroundRange>5 and JumpDebounce<time() then
  958. Anim=" JumpSlash"
  959. BladeTrail=true
  960. local a,b=GetWeld(wRA)
  961. local c,d=GetWeld(wHandle,1)
  962. so.Slash:Play()
  963. for i=1,aSpd do
  964. SetWeld(wRA,0,i,aSpd,a,b,v3(1.5,0.5,0),v3(-20,0,0))
  965. SetWeld(wHandle,1,i,aSpd,c,d,v3(0,-1.5,0),v3(20,0,-20))
  966. wait()
  967. end
  968. local timee=time()
  969. repeat wait() until not Falling or timee+2<time() --if DoubleJump then wait(0.5) end -l---
  970. BladeTrail=false
  971. Anim="None"
  972. --DoubleJump Slash
  973. elseif Anim=="Jumping" and GroundRange>12 and JumpDebounce>time() then
  974. Anim=" JumpSlash2"
  975. BladeTrail=1
  976. GetRecent()
  977. local timee=time()
  978. so.Slash.Pitch=2
  979. local flipdmg=function()
  980. local Hits=GetFrontRay(Torso.CFrame,999,{-3,3},{-8,8},{-8,8}) for i,v in pairs(Hits) do local Huma=v[2]
  981. if HitDB[Huma] and HitDB[Huma]>time() then else
  982. HitDB[Huma]=time()+0.2 fDamage(mrnd(Damage*70,Damage*130)/100,v[1],Huma) so.Hit:Play() end end end
  983. local steer=oHRP.CFrame:toObjectSpace(CF(oHRP.Position,Mouse.Hit.p))
  984. local x,y,z = steer:toEulerAnglesXYZ()
  985. steer=math.deg(-y)
  986. steer = steer>90 and 90 or steer
  987. steer = steer<-90 and -90 or steer
  988. for i=1,aSpd*30 do
  989. if i%4==0 then so.Slash:Play() end
  990. local i2=i>aSpd and aSpd or i
  991. --steer=steer +(Key['q'] and 6 or (Key['e'] and -6 or 0))
  992. SetWeld(wLA,0,i2,aSpd,pla0,pla2,v3(-1,0.9,0),v3(180,0,30))
  993. SetWeld(wRA,0,i2,aSpd,pra0,pra2,v3(1,0.9,0),v3(180,0,-30))
  994. SetWeld(wHandle,1,i2,aSpd,phandle1,phandle3,v3(0.2,-1.5,0),v3(45,30,0))
  995. SetWeld(HRP,1,i,aSpd*30,phrp0,phrp1,phrp0,v3(360*2*10,0,0))
  996. SetWeld(HRP,0,1,1,phrp0,phrp2,phrp0+v3(0,-mabs(steer/45),0),v3(0,0,steer))
  997. flipdmg()
  998. if (not Falling and timee+(mabs(steer)>30 and 1 or 0.6)<time()) or timee+4<time() then break end
  999. wait()
  1000. end
  1001. flipdmg()
  1002. so.Slash.Pitch=SlashPitch
  1003. ClearWeld(HRP)
  1004. BladeTrail=false
  1005. Anim="None"
  1006. --RunningJump Slash
  1007. elseif Anim=="Jumping2" and GroundRange>6 and JumpDebounce<time() then
  1008. Anim=" JumpSlash2"
  1009. WalkM[2]=2.5
  1010. BladeTrail=true
  1011. GetRecent()
  1012. local timee=time()
  1013. so.Slash.Pitch=2
  1014. for i=1,aSpd*30 do
  1015. if i%4==0 then so.Slash:Play() end
  1016. local i2=i>aSpd and aSpd or i
  1017. SetWeld(wLA,0,i2,aSpd,pla0,pla2,v3(-1.5,0.5,0),v3(180,0,0))
  1018. SetWeld(wRA,0,i2,aSpd,pra0,pra2,v3(1.5,0.5,0),v3(0,0,90))
  1019. SetWeld(wHandle,1,i2,aSpd,phandle1,phandle3,v3(0.2,-1.5,0),v3(90,110,0))
  1020. SetWeld(HRP,0,i2,aSpd,phrp0,phrp2,phrp0+v3(0,1,0),v3(-110,0,0))
  1021. SetWeld(HRP,1,i,aSpd*30,phrp1,phrp3,phrp1,v3(0,360*2*15,0))
  1022. if (not Falling and timee+0.5<time()) or timee+4<time() then break end
  1023. wait()
  1024. end
  1025. AOEDmg(HitBox.Position,6.5,Damage,function() so.Hit:Play() end)
  1026. WalkM[2]=1
  1027. so.Slash.Pitch=SlashPitch
  1028. ClearWeld(HRP)
  1029. BladeTrail=false
  1030. Anim="None"
  1031. elseif Anim=="Stance1" then
  1032. Anim="Stance1Stab"
  1033. local r1,r2=GetWeld(wRA)
  1034. local l1,l2=GetWeld(wLA)
  1035. local hh1,hh2=GetWeld(wHandle,1)
  1036. so.Slash.Pitch=2
  1037. repeat
  1038. local raise=mrnd(-4,4)*80/4
  1039. local div=2
  1040. for i=1,div do
  1041. SetWeld(wHandle,1,i,div,hh1,hh2,Pose.None.Handle[1]+v3(0,-1.5,0.1),v3(40,0,-90))
  1042. SetWeld(wRA,0,i,div,r1,r2,v3(0.5,0.5,-0.5),Ca(90+raise,-20,-50,0,0,0))
  1043. SetWeld(wLA,0,i,div,l1,l2,v3(-1.6,0.75,0),Ca(100+raise,-20,-15,0,0,0))
  1044. wait()
  1045. end
  1046. AOEDmg(HitBox.Position,4,Damage/3,function() so.Hit:Play() end)
  1047. so.Slash:Play()
  1048. MeshEffect(0.15,Handle.CFrame*CF(0,tpol.y/4,0),0.5,as.cone,CF(0,0.5,0),EffectColor,v3(0.01,4,0.3),v3(0.1,3,0.1))
  1049. local R1,R2=GetWeld(wRA)
  1050. local L1,L2=GetWeld(wLA)
  1051. local HH1,HH2=GetWeld(wHandle,1)
  1052. for i=1,div do
  1053. SetWeld(wHandle,1,i,div,HH1,HH2,hh1,hh2)
  1054. SetWeld(wRA,0,i,div,R1,R2,r1,r2)
  1055. SetWeld(wLA,0,i,div,L1,L2,l1,l2)
  1056. wait()
  1057. end
  1058. wait() until not Button1 or Anim~="Stance1Stab"
  1059. so.Slash.Pitch=SlashPitch
  1060. Anim="Stance1"
  1061. end
  1062. end
  1063. ---------------------------------------------------
  1064. onButton1Up= function()
  1065. end
  1066. ---------------------------------------------------
  1067. Tool.Selected:connect(function(mouse)
  1068. Mouse=mouse
  1069. if Anim=="Deselected" then
  1070. Anim="Selecting"
  1071. Arms(1)
  1072. for x=1,aSpd do
  1073. SetWeld(wRA,0,x,aSpd,cRA0,v30,cRA0+v3(0,0,-0.2),v3(135,0,15))
  1074. wait()
  1075. end
  1076. local w0,w1=GetWeld(wRA)
  1077. for x=1,aSpd do
  1078. SetWeld(wRA,0,x,aSpd,w0,w1,cRA0,v3(200,0,-15))
  1079. wait()
  1080. end
  1081. local a,b=GetWeld(wRA)
  1082. wHandle.C0=RA.CFrame:toObjectSpace(Handle.CFrame)
  1083. wHandle.Part0=RA
  1084. ClearWeld(wHandle)
  1085. local w0,w1=GetWeld(wHandle)
  1086. w1=v3(-360+w1.x,w1.y,w1.z)
  1087. for x=1,aSpd do
  1088. SetWeld(wHandle,0,x,aSpd,w0,w1,Pose.None.Handle[0],Pose.None.Handle[2])
  1089. SetWeld(wHandle,1,x,aSpd,v30,v30,Pose.None.Handle[1],Pose.None.Handle[3])
  1090. SetWeld(wRA,0,x,aSpd,a,b,cRA0,v3(200,0,20))
  1091. wait()
  1092. end
  1093. local a,b=GetWeld(wRA)
  1094. for x=1,aSpd do
  1095. SetWeld(wRA,0,x,aSpd,a,b,Pose.None.RA[0],Pose.None.RA[2])
  1096. wait()
  1097. end
  1098. SetWeld(Neck,0,1,1,nil,nil,Pose.None.Neck[0],Pose.None.Neck[2])
  1099. SetWeld(Neck,1,1,1,nil,nil,Pose.None.Neck[1],Pose.None.Neck[3])
  1100. SetWeld(HRP,0,1,1,nil,nil,Pose.None.HRP[0],Pose.None.HRP[2])
  1101. SetWeld(HRP,1,1,1,nil,nil,Pose.None.HRP[1],Pose.None.HRP[3])
  1102. pcall(function() Character.Animate.Disabled=true end)
  1103. Anim="None"
  1104. end -- anim
  1105. -------------------
  1106. mouse.KeyDown:connect(function(k)
  1107. Key[k]=true
  1108. onKeyDown(k)
  1109. end)
  1110. -------------------------
  1111. mouse.KeyUp:connect(function(k)
  1112. Key[k]=false
  1113. onKeyUp(k)
  1114. end)
  1115. mouse.Button1Down:connect(function()
  1116. Button1=true
  1117. onButton1Down()
  1118. end)
  1119. mouse.Button1Up:connect(function()
  1120. Button1=false
  1121. onButton1Up()
  1122. end)
  1123. end)
  1124. -------------------------------------------------------
  1125. Tool.Deselected:connect(function()
  1126. Mouse=nil
  1127. if Anim=="None" or Anim=="Walking" then
  1128. Anim="Deselecting"
  1129. local a,b=GetWeld(wRA)
  1130. for x=1,aSpd do
  1131. SetWeld(wRA,0,x,aSpd,a,b,cRA0+v3(0,0,-0.2),v3(135,0,15))
  1132. wait()
  1133. end
  1134. local w0,w1=GetWeld(wRA)
  1135. for x=1,aSpd do
  1136. SetWeld(wRA,0,x,aSpd,w0,w1,cRA0,v3(200,0,-15))
  1137. SetWeld(wHandle,0,x,aSpd,Pose.None.Handle[0],Pose.None.Handle[2],Pose.None.Handle[0],Pose.None.Handle[2]+v3(0,45,45))
  1138. wait()
  1139. end
  1140. wHandle.C0=Torso.CFrame:toObjectSpace(Handle.CFrame)
  1141. wHandle.C1=CF(0,0,0)
  1142. wHandle.Part0=Torso
  1143. ClearWeld(wHandle)
  1144. local w0,w1=GetWeld(wHandle)
  1145. for x=1,aSpd do
  1146. SetWeld(wHandle,0,x,aSpd,w0,w1,oHandle0,oHandle1)
  1147. wait()
  1148. end
  1149. local a,b=GetWeld(wRA)
  1150. for x=1,aSpd do
  1151. SetWeld(wRA,0,x,aSpd,a,b,cRA0,cRA1)
  1152. wait()
  1153. end
  1154. Arms()
  1155. SetWeld(Neck,0,1,1,nil,nil,v3(xNeck0.x,xNeck0.y,xNeck0.z),xNeck)
  1156. SetWeld(Neck,1,1,1,nil,nil,v3(xNeck1.x,xNeck1.y,xNeck1.z),xNeck)
  1157. SetWeld(HRP,0,1,1,nil,nil,v3(xHRP0.x,xHRP0.y,xHRP0.z),xHRP)
  1158. SetWeld(HRP,1,1,1,nil,nil,v3(xHRP1.x,xHRP1.y,xHRP1.z),xHRP)
  1159. pcall(function() Character.Animate.Disabled=false end)
  1160. Anim="Deselected"
  1161. end
  1162. end)
  1163.  
  1164. KillEvade=time()
  1165. Damage=18
  1166. HitDB={}
  1167. BladeFunc=function(Hit)
  1168. if Hit.Parent==Model or Hit.Parent==Character or not BladeTrail then return end
  1169. if BladeTrail==1 then return end
  1170. local Huma=Hit.Parent:findFirstChild'Humanoid'
  1171. if not Huma then return end
  1172. if HitDB[Huma] and HitDB[Huma]>time() then return end
  1173. HitDB[Huma]=time()+0.5
  1174. local Dmg=mrnd(Damage*70,Damage*130)/100
  1175. fDamage(Dmg,Hit,Huma)
  1176. so.Hit.Pitch=mrnd(90,115)/100
  1177. so.Hit:Play()
  1178. end
  1179. fDamage=function(Dmg,Hit,Huma)
  1180. if Huma.Health<=0 then return end
  1181. ----------Damage Bar
  1182. Huma:TakeDamage(Dmg)
  1183. local bdmg=INEW("Model",workspace)
  1184. bdmg.Name=math.floor(Dmg)
  1185. Debris:AddItem(bdmg,1.5)
  1186. local bhead=partx:Clone() --taken from weapon part
  1187. bhead.CanCollide=false
  1188. bhead.Parent=bdmg
  1189. bhead.BrickColor=BrickColor.new'Bright red'
  1190. bhead.Mesh.Scale=v3(0.6,0.2,0.6)*5
  1191. bhead.Name="Head"
  1192. bhead.Anchored=true
  1193. bhead.CFrame=CF(Hit.Position)*CF(mrnd(-100,100)/100*1.5,4.25,mrnd(-100,100)/100*1.5)
  1194. local bhuma=INEW("Humanoid",bdmg)
  1195. bhuma.Name="keks"
  1196. bhuma.MaxHealth=0
  1197. ------------------------Effects
  1198. if Hit then
  1199. local blod
  1200. for i=1,3 do
  1201. local y1=mrnd(300,450)/100
  1202. local z1=mrnd(300,450)/100
  1203. local z2=mrnd(400,600)/100
  1204. local blood=INEW("Part",workspace)
  1205. blood.Transparency=1
  1206. blood.formFactor='Custom'
  1207. blood.Anchored=true
  1208. blood.CanCollide=false
  1209. blood.Size=v3(0.2,0.2,0.2)
  1210. blood.CFrame=CF(Hit.Position,HitBox.Position)*CA(mrnd(-15,15),mrnd(-15,15),mrnd(-180,180))*CF(0,0,-z1/2)*CA(-90,0,0)
  1211. if i==1 then blod=blood:Clone() end
  1212. local bloodm=INEW("BlockMesh",blood)
  1213. Debris:AddItem(blood,1.5)
  1214. bloodm.Scale=v3(0,y1,z1)*5
  1215. for i,v in pairs{'Left','Right'} do local dec=INEW('Decal',blood) dec.Name=v dec.Face=v dec.Texture=as.Blood dec.Transparency=0.1
  1216. DoLoop(10,function(i) blood.CFrame=blood.CFrame*CF(0,z2/2/10,0) bloodm.Scale=v3(0,y1+z2*i,z1-z1/2.1*i)*5 dec.Transparency=0.1+0.9*i if i==1 then blood:Remove() end end) end
  1217. end
  1218. local hit2,pos2=ray(Hit.Position,Hit.Position-Hit.CFrame*CF(0,1,0).p,Hit.Parent,10)
  1219. if hit2 then
  1220. local blad=blod:Clone()
  1221. local bloodmm=INEW("BlockMesh",blad)
  1222. blad.Parent=workspace Debris:AddItem(blad,1.5)
  1223. blad.CFrame=CF(pos2)*CF(mrnd(-250,250)/100,0.08,mrnd(-250,250)/100)*CA(0,mrnd(-180,180),0)
  1224. local decx=INEW('Decal',blad) decx.Face='Top' decx.Texture=as.Blood decx.Transparency=0
  1225. bloodmm.Scale=v3(mrnd(200,400)/100,0,mrnd(300,500)/100)*13
  1226. DoLoop(30,function(i) decx.Transparency=1*i bloodmm.Scale=bloodmm.Scale+v3(1,0,1)*5/30/2 if i==1 then blad:Remove() end end)
  1227. end
  1228. end
  1229. -------Special Evade Move
  1230. if Huma.Health-Dmg<=0 and KillEvade<time() and Key['2'] then
  1231. KillEvade=time()+1
  1232. so.Abscond:Play()
  1233. oHRP.CFrame=oHRP.CFrame*CF(0,0,35)
  1234. for i=1,6 do
  1235. MeshEffect(0.04,oHRP.CFrame*CF(0,0,-i*5+2.5)*CA(90,0,0),0.2,'Cylinder',nil,'',v3(4,6,4)*(i-1)/3,-v3(4,0,4)*(i-1)/3)
  1236. end
  1237. end
  1238. end
  1239. HitBox.Touched:connect(BladeFunc)
  1240.  
  1241. poll=1
  1242.  
  1243.  
  1244. Humanoid.FreeFalling:connect(function(v)
  1245. Falling=v
  1246. end)
  1247. Humanoid.Running:connect(function(v)
  1248. Moving=v>3 and true or false
  1249. end)
  1250. Humanoid.Jumping:connect(function(v)
  1251. --print(v)
  1252. end)
  1253.  
  1254. GetRecent=function()
  1255. pneck0,pneck2=GetWeld(Neck)
  1256. pneck1,pneck3=GetWeld(Neck,1)
  1257. phrp0,phrp2=GetWeld(HRP)
  1258. phrp1,phrp3=GetWeld(HRP,1)
  1259. phandle0,phandle2=GetWeld(wHandle)
  1260. phandle1,phandle3=GetWeld(wHandle,1)
  1261. pla0,pla2=GetWeld(wLA)
  1262. pra0,pra2=GetWeld(wRA)
  1263. plh0,plh2=GetWeld(LH)
  1264. plh1,plh3=GetWeld(LH,1)
  1265. prh0,prh2=GetWeld(RH)
  1266. prh1,prh3=GetWeld(RH,1)
  1267. end
  1268.  
  1269. LastPoints={}
  1270.  
  1271.  
  1272. LS:SetDesiredAngle(0)
  1273. RS:SetDesiredAngle(0)
  1274. LS.CurrentAngle=0
  1275. RS.CurrentAngle=0
  1276. WedgeTrail={}
  1277. -----------------WWWWWWWWWWWW wWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
  1278. game:GetService'RunService'.RenderStepped:connect(function()
  1279. --------ghost sytem
  1280. for x,v in pairs(Ghost) do
  1281. if v[1] then
  1282. v.Torso.CFrame=oHRP.CFrame*v[1]*(oHRP.CFrame:toObjectSpace(Torso.CFrame))
  1283. v.Handle.CFrame=v.Torso.CFrame*(Torso.CFrame:toObjectSpace(wHandle.Part1.CFrame))*v[3]
  1284. v.Handle.bp.position=v.Handle.Position
  1285. v.Handle.Velocity=v30 v.Handle.RotVelocity=v30
  1286. for ii,vv in pairs(v[2]:children()) do if vv.Name~="Torso" and vv.Name~="Handle" then
  1287. local adh=Torso.CFrame:toObjectSpace(Character[vv.Name].CFrame) vv.CFrame=v.Torso.CFrame*adh end end
  1288. else
  1289. for ii,vv in pairs(v[2]:children()) do if v[1]==nil or (v[1] and vv.Name~='Handle') then vv.Transparency=vv.Transparency+0.1
  1290. if vv.Transparency>=1 then v[2]:Remove() Ghost[x]=nil end end end
  1291. end
  1292. end
  1293. end)
  1294. ------------------------------------------------
  1295. local handles={Handle}
  1296. if Character:findFirstChild'Sound' then Character.Sound.Disabled=true end
  1297. Falling=false
  1298. xAngle,yAngle,XAngle,YAngle=0,0,0,0
  1299. Adj=0
  1300. Adjx=1
  1301. GroundRange=0
  1302. Adjt={["None"]=0.3,["Walking"]=1.4,["Running"]=3,["Jumping"]=0,["Jumping2"]=0}
  1303. LegRaise={["None"]={5,0.003},["Walking"]={37,0.1},["Running"]={80,0.22}} LegNega=1
  1304. WSAnim={["Running"]=2,["Jumping2"]=3}
  1305. --sPose={["Jumping"]=1.5}
  1306. count=0
  1307. _G.hrp=wHRP
  1308. _G.rmail=_G.rmail and _G.rmail+1 or 0
  1309. local rmail=_G.rmail
  1310. while _G.rmail==rmail do
  1311. --[[ Anti Fall System
  1312. local tx,ty,tz=oHRP.CFrame:toEulerAnglesXYZ()
  1313. tx,ty,tz=mdeg(tx)%180,mdeg(ty)%180,mdeg(tz)%180
  1314. print(math.floor(tx))
  1315. if v3(oHRP.Velocity.x,0,oHRP.Velocity.z).magnitude>5 and (mabs(tx)>45) then print'kek'
  1316. oHRP.Velocity=v30 oHRP.RotVelocity=v30
  1317. Torso.Velocity=v30 Torso.Velocity=v30
  1318. oHRP.CFrame=CF(oHRP.Position.x+mrnd(-12,12),oHRP.Position.y+1,oHRP.Position.z+mrnd(-12,12))*CA(0,mrnd(-200,200),0)
  1319. end]]
  1320. DoubleJump=JumpDebounce>time() and true or false
  1321. Adjx = mabs(Adj)>16 and -Adjx or Adjx
  1322. local wss=WalkSpeed
  1323. for i,v in pairs(WalkM) do
  1324. wss=wss*v
  1325. end
  1326. WalkM[1]=WSAnim[Anim] or 1
  1327. Humanoid.WalkSpeed=wss
  1328. torvel=(Torso.Velocity*v3(1,0,1)).magnitude
  1329. --Moving=torvel>2 and true or false
  1330. if Anim=="None" and Moving then Anim="Walking" Adj=0 end
  1331. if (Anim=="Walking" or Anim=="Running") and not Moving then Anim="None" Adj=0 end
  1332. if Falling and (Anim=="None" or Anim=="Walking") then Torso.Velocity=Torso.Velocity+v3(0,16,0) Anim="Jumping" Adj=0 end
  1333. if Falling and Anim=="Running" then Torso.Velocity=Torso.Velocity+v3(0,25,0) Anim="Jumping2" so.Slash2:Play()
  1334. MeshEffect(0.1,oHRP.CFrame*CF(0,-GroundRange+0.5,0),0.5,as.blast,CA(0,10,0),GroundColor,v3(0.5,0.1,0.5)*5,v3(0.5,0,0.5)*5) Adj=0 end
  1335. local hit,pos
  1336. local gg=99999
  1337. for i,x in pairs{0,-0.5,0.5,-1.05,1.05} do
  1338. local HCF=oHRP.CFrame*CF(x,0,0)
  1339. hit2,pos2=ray(HCF.p,HCF.p-HCF*CF(0,1,0).p,Character,200)
  1340. local current= (pos2-oHRP.Position).magnitude
  1341. if current<gg then
  1342. gg=current
  1343. GroundRange=current
  1344. hit=hit2
  1345. pos=pos2
  1346. end
  1347. end
  1348. if not Falling and Anim:sub(1,4)=="Jump" then Anim="None" Adj=0 end
  1349. if hit and GroundRange<40 then GroundColor=hit.BrickColor.Name end
  1350. if Pose[Anim] then
  1351. Adj=Adj+(Adjt[Anim] or 1)*Adjx
  1352. local xx = 1 --PoseAnim
  1353. local PoseSpd=10
  1354. local xxAngle=xAngle<-10 and -10 or xAngle
  1355. SetWeld(Neck,0,xx,PoseSpd,pneck10,pneck20,Pose[Anim].Neck[0],Pose[Anim].Neck[2]-v3(-xxAngle/1.5,Adj*Pose[Anim].HRP[-1]-yAngle,-Adj*Pose[Anim].HRP[-1]))
  1356. SetWeld(Neck,1,xx,PoseSpd,pneck30,pneck40,Pose[Anim].Neck[1],Pose[Anim].Neck[3])
  1357. SetWeld(HRP,0,xx,PoseSpd,phrp10,phrp20,Pose[Anim].HRP[0],Pose[Anim].HRP[2]+v3(0,Adj*Pose[Anim].HRP[-1],0))
  1358. SetWeld(HRP,1,xx,PoseSpd,phrp30,phrp40,Pose[Anim].HRP[1],Pose[Anim].HRP[3])
  1359. SetWeld(wHandle,0,xx,PoseSpd,phandle10,phandle20,Pose[Anim].Handle[0],Pose[Anim].Handle[2])
  1360. SetWeld(wHandle,1,xx,PoseSpd,phandle30,phandle40,Pose[Anim].Handle[1],Pose[Anim].Handle[3])
  1361. SetWeld(wRA,0,xx,PoseSpd,pra10,pra20,Pose[Anim].RA[0],Pose[Anim].RA[2]+v3(Adj*Pose[Anim].RA[-1],yAngle,0))
  1362. SetWeld(wLA,0,xx,PoseSpd,pla10,pla20,Pose[Anim].LA[0],Pose[Anim].LA[2]+v3(-Adj*Pose[Anim].LA[-1],yAngle,0))
  1363. SetWeld(LH,0,xx,PoseSpd,plh10,plh20,Pose[Anim].LH[0],Pose[Anim].LH[2])
  1364. SetWeld(LH,1,xx,PoseSpd,plh30,plh40,Pose[Anim].LH[1],Pose[Anim].LH[3])
  1365. SetWeld(RH,0,xx,PoseSpd,prh10,prh20,Pose[Anim].RH[0],Pose[Anim].RH[2])
  1366. SetWeld(RH,1,xx,PoseSpd,prh30,prh40,Pose[Anim].RH[1],Pose[Anim].RH[3])
  1367. else
  1368. end
  1369. --Leg System
  1370. LegNega=LegNega*(LH.DesiredAngle==LH.CurrentAngle and -1 or 1)
  1371. local LegX=35/WalkSpeed*wss
  1372. LegX=LegX>50 and 50 or LegX
  1373. LegX2= 0.065/WalkSpeed*wss
  1374. LegX2=LegX2>0.2 and 0.2 or LegX2
  1375. LH:SetDesiredAngle(math.rad(LegRaise[Anim] and LegRaise[Anim][1] or ((Moving and not Humanoid.Jump) and LegX or 0))*LegNega)
  1376. RH:SetDesiredAngle(LH.DesiredAngle)
  1377. if math.abs(LH.DesiredAngle)>=math.abs(LH.CurrentAngle) then
  1378. LH.MaxVelocity=LegRaise[Anim] and LegRaise[Anim][2] or LegX2
  1379. RH.MaxVelocity=LH.MaxVelocity
  1380. end
  1381. -----------------------
  1382. if BladeTrail then
  1383. for i,handle in pairs(handles) do
  1384. local C1, C2, S1, S2 = GetTriangleValues({
  1385. handle.CFrame*tpol.p,
  1386. handle.Position,
  1387. LastPoints[handle][1]
  1388. })
  1389. local Triangle1 = Instance.new("WedgePart", Model)
  1390. for i,v in pairs{"Top","Bottom","Left","Right","Front","Back"} do Triangle1[v.."Surface"]=10 end
  1391. Triangle1.Anchored = true
  1392. Triangle1.BrickColor = BrickColor.new(EffectColor)
  1393. Triangle1.FormFactor = 3
  1394. Triangle1.Transparency = 0.6
  1395. Triangle1.Size = V3(1, 1, 1)
  1396. Triangle1.CanCollide=false
  1397. Triangle1.CFrame = C1
  1398. local Triangle1Mesh = Instance.new("SpecialMesh", Triangle1)
  1399. Triangle1Mesh.MeshType = "Wedge"
  1400. Triangle1Mesh.Scale = S1
  1401. Triangle1Mesh.Name="kek"
  1402. local Triangle2 = Triangle1:Clone()
  1403. Triangle2.Parent = Model
  1404. Triangle2.CFrame = C2
  1405. Triangle2.kek.Scale = S2
  1406. local C1, C2, S1, S2 = GetTriangleValues({
  1407. handle.Position,
  1408. LastPoints[handle][1],
  1409. LastPoints[handle][2]
  1410. })
  1411. local Triangle3 = Triangle1:Clone()
  1412. Triangle3.Parent = Model
  1413. Triangle3.CFrame = C1
  1414. Triangle3.kek.Scale = S1
  1415. local Triangle4 = Triangle1:Clone()
  1416. Triangle4.Parent = Model
  1417. Triangle4.CFrame = C2
  1418. Triangle4.kek.Scale = S2
  1419. WedgeTrail[#WedgeTrail+1]=Triangle1
  1420. WedgeTrail[#WedgeTrail+1]=Triangle2
  1421. WedgeTrail[#WedgeTrail+1]=Triangle3
  1422. WedgeTrail[#WedgeTrail+1]=Triangle4
  1423. end
  1424. end
  1425. LastPoints[Handle]={[1]=Handle.CFrame*tpol.p,[2]=Handle.Position}
  1426. for i,v in pairs(Ghost) do handles[v.Handle]=v.Handle LastPoints[v.Handle]={[1]=v.Handle.CFrame*tpol.p,[2]=v.Handle.Position} end
  1427. -----------------------
  1428. for i,v in pairs(WedgeTrail) do
  1429. if v.Transparency>=1 then v:Remove() WedgeTrail[i]=nil
  1430. else
  1431. v.Transparency=v.Transparency+0.1
  1432. end
  1433. end
  1434. for i,v in pairs(MeshPack) do
  1435. v[2]=v[2]+v[3]
  1436. if v[2]<=0 then
  1437. v[1]:Remove()
  1438. MeshPack[i]=nil
  1439. else
  1440. v[1].Transparency=v[7]+((1-v[7])-(1-v[7])*v[2])
  1441. v[1].Mesh.Scale=v[5]+(v[6]*(1-v[2]))
  1442. v[1].CFrame=v[1].CFrame*v[4]
  1443. end
  1444. end
  1445. -------------
  1446. --DoLoop Package
  1447. for i,v in pairs(LoopFunctions) do
  1448. v[2]=v[2]+1
  1449. v[3](v[2]/v[1])
  1450. if v[1]<=v[2] then LoopFunctions[i]=nil end
  1451. end
  1452. ----
  1453. if Mouse then
  1454. XAngle = GetX(oHRP,Mouse.Hit.p)
  1455. YAngle = GetY(oHRP,Mouse.Hit.p)
  1456. else
  1457. XAngle = 0
  1458. YAngle = 0
  1459. end
  1460. xAngle=XAngle
  1461. yAngle=YAngle
  1462. xAngle=xAngle>45 and 45 or xAngle
  1463. xAngle=xAngle<-45 and -45 or xAngle
  1464. yAngle=yAngle>45 and 45 or yAngle
  1465. yAngle=yAngle<-45 and -45 or yAngle
  1466. wait(0.0275)
  1467. count=count+1
  1468. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement