Hebablazin

Orange Blades

May 31st, 2016
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.08 KB | None | 0 0
  1. --Orange Blades Gifted by machontz, Local Script!
  2.  
  3. Players = game:GetService("Players")
  4. Me = Players.LocalPlayer
  5. Char = Me.Character
  6. Neck0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  7. Neck1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  8. Selected = false
  9. Attacking = false
  10. Running = false
  11. Debounce = true
  12. Hurt = false
  13. ModelName = "Weapon"
  14. ToolName = "Weapon"
  15. Speed = 25
  16. Attacks = {"q", "e"}
  17. Find = function(tab, arg)
  18. for _,v in pairs(tab) do
  19. if v==arg then
  20. return true
  21. end
  22. end
  23. return false
  24. end
  25. ContentProvider = game:GetService("ContentProvider")
  26. V3 = Vector3.new
  27. C3 = Color3.new
  28. BN = BrickColor.new
  29. CN = CFrame.new
  30. CA = CFrame.Angles
  31. MR = math.rad
  32. MRA = math.random
  33. MP = math.pi
  34. MH = math.huge
  35. UD = UDim2.new
  36. function RC(Pos, Dir, Max, Ignore)
  37. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  38. end
  39. function RayC(Start, En, MaxDist, Ignore)
  40. return RC(Start, (En - Start), MaxDist, Ignore)
  41. end
  42. function ComputePos(pos1, pos2)
  43. return CN(pos1, V3(pos2.x, pos1.y, pos2.z))
  44. end
  45. function DetectSurface(pos, part)
  46. local surface = nil
  47. local pospos = part.CFrame
  48. local pos2 = pospos:pointToObjectSpace(pos)
  49. local siz = part.Size
  50. local shaep = part.Shape
  51. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  52. surface = {"Anything", CN(pospos.p, pos)*CN(0, 0, -(pospos.p - pos).magnitude)*CA(MR(-90), 0, 0)}
  53. else
  54. if pos2.Y > ((siz.Y/2)-0.04) then
  55. surface = {"Top", CA(0, 0, 0)}
  56. elseif pos2.Y < -((siz.Y/2)-0.04) then
  57. surface = {"Bottom", CA(-MP, 0, 0)}
  58. elseif pos2.X > ((siz.X/2)-0.04) then
  59. surface = {"Right", CA(0, 0, MR(-90))}
  60. elseif pos2.X < -((siz.X/2)-0.04) then
  61. surface = {"Left", CA(0, 0, MR(90))}
  62. elseif pos2.Z > ((siz.Z/2)-0.04) then
  63. surface = {"Back", CA(MR(90), 0, 0)}
  64. elseif pos2.Z < -((siz.Z/2)-0.04) then
  65. surface = {"Front", CA(MR(-90), 0, 0)}
  66. end
  67. end
  68. return surface
  69. end
  70. function Compute(pos1, pos2)
  71. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  72. return CN(pos1, pos3)
  73. end
  74. function waitChild(n, p)
  75. local c = p:findFirstChild(n)
  76. if c then return c end
  77. while true do
  78. c = p.ChildAdded:wait()
  79. if c.Name == n then return c end
  80. end
  81. end
  82. function Notime(func)
  83. coroutine.resume(coroutine.create(function()
  84. func()
  85. end))
  86. end
  87. Torso = waitChild("Torso", Char)
  88. Head = waitChild("Head", Char)
  89. Rarm = waitChild("Right Arm", Char)
  90. Larm = waitChild("Left Arm", Char)
  91. Rleg = waitChild("Right Leg", Char)
  92. Lleg = waitChild("Left Leg", Char)
  93. Neck = waitChild("Neck", Torso)
  94. Hum = waitChild("Humanoid", Char)
  95. RSH = waitChild("Right Shoulder", Torso)
  96. LSH = waitChild("Left Shoulder", Torso)
  97. RH = waitChild("Right Hip", Torso)
  98. LH = waitChild("Left Hip", Torso)
  99. RSH.Part0 = Torso
  100. LSH.Part0 = Torso
  101. RH.Part0 = Torso
  102. LH.Part0 = Torso
  103. Add = {
  104. Mesh = function(P, Type, ID, Scale, Tex)
  105. local m = Instance.new("SpecialMesh")
  106. m.MeshType = Type or "Head"
  107. m.MeshId = ID or ""
  108. m.Scale = Scale or V3(1, 1, 1)
  109. m.TextureId = Tex or ""
  110. m.Parent = P
  111. return m
  112. end,
  113. Cylinder = function(P, Scale)
  114. local m = Instance.new("CylinderMesh")
  115. m.Scale = Scale or V3(1, 1, 1)
  116. m.Parent = P
  117. return m
  118. end,
  119. Block = function(P, Scale)
  120. local m = Instance.new("BlockMesh")
  121. m.Scale = Scale or V3(1, 1, 1)
  122. m.Parent = P
  123. return m
  124. end,
  125. BP = function(P, Pos, Power)
  126. local bp = Instance.new("BodyPosition")
  127. bp.P = Power
  128. bp.position = Pos
  129. bp.maxForce = V3(MH, MH, MH)
  130. bp.Parent = P
  131. return bp
  132. end,
  133. }
  134. Sounds = {
  135. Shoot = {Id = "http://www.roblox.com/asset/?id=2697431", Pitch = 0.3, Volume = 0.5},
  136. Boom = {Id = "http://www.roblox.com/asset/?id=2692806", Pitch = 0.55, Volume = 0.4},
  137. Slash = {Id = "rbxasset://sounds//swordslash.wav", Pitch = 0.5, Volume = 0.5},
  138. Hit = {Id = "http://www.roblox.com/asset/?id=2801263", Pitch = 0.85, Volume = 0.35},
  139. Reload = {Id = "rbxasset://sounds\\metal.ogg", Pitch = 1, Volume = 0.45},
  140. }
  141. for _,v in pairs(Sounds) do
  142. ContentProvider:Preload(v.Id)
  143. end
  144. function PlaySound(Sound, bool)
  145. local s = Instance.new("Sound")
  146. s.Looped = false
  147. s.Volume = Sound.Volume
  148. s.SoundId = Sound.Id
  149. if bool then
  150. s.Pitch = MRA((Sound.Pitch*0.75)*1000, (Sound.Pitch*1.15)*1000)/1000
  151. else
  152. s.Pitch = Sound.Pitch
  153. end
  154. s.PlayOnRemove = true
  155. s.Parent = Torso
  156. Notime(function()
  157. wait()
  158. s.Parent = nil
  159. end)
  160. end
  161. function GetParts(pos, dist)
  162. local parts = {}
  163. local function o(p)
  164. for _,v in pairs(p:children()) do
  165. if v:IsA("BasePart") then
  166. if (pos - v.Position).magnitude <= dist then
  167. table.insert(parts, {v, (pos - v.Position).magnitude, v.Anchored})
  168. end
  169. end
  170. o(v)
  171. end
  172. end
  173. o(workspace)
  174. return parts
  175. end
  176. function GetHum(P)
  177. for _,v in pairs(P:children()) do
  178. if v:IsA("Humanoid") then
  179. if v.Health > 0 then
  180. return v
  181. end
  182. end
  183. end
  184. end
  185. function GetGroup(Pos, Distance, Hit)
  186. local tab = {}
  187. for _,v in pairs(workspace:children()) do
  188. local h = GetHum(v)
  189. local t = v:findFirstChild("Torso")
  190. if h and t and v ~= Hit.Parent then
  191. if (t.Position - Pos).magnitude <= Distance then
  192. table.insert(tab, {h, v, (t.Position - Pos).magnitude})
  193. end
  194. end
  195. end
  196. if Hit then
  197. local h = GetHum(Hit.Parent)
  198. if h then
  199. table.insert(tab, {h, Hit.Parent, 0})
  200. end
  201. end
  202. return tab
  203. end
  204. function Part(Par, Anc, Colli, Tran, Ref, Col, Siz)
  205. local p = Instance.new("Part")
  206. p.formFactor = "Custom"
  207. p.TopSurface = 0
  208. p.BottomSurface = 0
  209. p.Transparency = Tran
  210. p.Reflectance = Ref
  211. p.Anchored = Anc
  212. p.CanCollide = Colli
  213. p.BrickColor = Col
  214. p.Size = Siz
  215. p.Locked = true
  216. p.Parent = Par
  217. p:BreakJoints()
  218. return p
  219. end
  220. function Weld(P0, P1, C0, C1)
  221. local w = Instance.new("Weld")
  222. w.Part0 = P0
  223. w.Part1 = P1
  224. if C0 then
  225. w.C0 = C0
  226. end
  227. if C1 then
  228. w.C1 = C1
  229. end
  230. w.Parent = P0
  231. return w
  232. end
  233. for _,v in pairs(Char:children()) do
  234. if v.Name == ModelName then
  235. v:remove()
  236. end
  237. end
  238. Model = Instance.new("Model")
  239. Model.Name = ModelName
  240. FTorso = Part(Model, false, false, 1, 0, Torso.BrickColor, V3(2, 2, 1))
  241. FW = Weld(Torso, FTorso)
  242. RAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  243. LAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  244. RLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  245. LLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  246. RABW = Weld(Torso, RAB, CN(), CN(-1.5, -0.5, 0))
  247. LABW = Weld(Torso, LAB, CN(), CN(1.5, -0.5, 0))
  248. RLBW = Weld(Torso, RLB, CN(), CN(-0.5, 1, 0))
  249. LLBW = Weld(Torso, LLB, CN(), CN(0.5, 1, 0))
  250. RAW = Weld(RAB, nil, CN(), CN(0, 0.5, 0))
  251. LAW = Weld(LAB, nil, CN(), CN(0, 0.5, 0))
  252. RLW = Weld(RLB, nil, CN(), CN(0, 1, 0))
  253. LLW = Weld(LLB, nil, CN(), CN(0, 1, 0))
  254. FNeck = Weld(FTorso, nil, CN(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CN(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
  255. TW = Weld(Torso, nil, CN(0.7, 0.8, 1.2), CA(0, MR(180), MR(55)))
  256. Weapon = Instance.new("Model")
  257. Weapon.Name = "Weapon"
  258. HBR = Part(Weapon, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  259. HBWR = Weld(Rarm, HBR, CN(0, -0.9, 0), CA(MR(90), 0, 0))
  260. HWR = Weld(HBR, nil)
  261. HBL = Part(Weapon, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  262. HBWL = Weld(Larm, HBL, CN(0, -0.9, 0), CA(MR(90), 0, 0))
  263. HWL = Weld(HBL, nil)
  264. Limbs = {Rarm = {RAW, Rarm}, Larm = {LAW, Larm}, Rleg = {RLW, Rleg}, Lleg = {LLW, Lleg}, }
  265. function Atta(Lol)
  266. Lol[1].Part1 = Lol[2]
  267. end
  268. function MakeKnife(Arm)
  269. local Parts = {}
  270. local Handle = Part(Weapon, false, false, 0, 0, BN("Navy blue"), V3(0.35, 1.1, 0.35))
  271. local Derp = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.6, 0.2, 0.6))
  272. local Blade1 = Part(Weapon, false, false, 0, 0, BN("Deep orange"), V3(0.2, 0.5, 0.3))
  273. local Blade2 = Part(Weapon, false, false, 0, 0, BN("Deep orange"), V3(0.2, 0.4, 0.4))
  274. local Blade3 = Part(Weapon, false, false, 0, 0, BN("Deep orange"), V3(0.2, 0.8, 0.4))
  275. local Blade4 = Part(Weapon, false, false, 0, 0, BN("Deep orange"), V3(0.2, 0.7, 0.4))
  276. Add.Mesh(Handle)
  277. Add.Cylinder(Derp)
  278. Add.Block(Blade1)
  279. Add.Block(Blade2)
  280. Add.Block(Blade3)
  281. Add.Mesh(Blade4, "Wedge")
  282. Arm.Part1 = Handle
  283. Weld(Handle, Derp, CN(0, -0.5, 0))
  284. Weld(Derp, Blade1, CN(0, -0.25, 0))
  285. Weld(Blade1, Blade2, CN(0, -0.25, -0.04), CA(MR(5), 0, 0))
  286. Weld(Blade2, Blade3, CN(0, -0.55, 0.08), CA(MR(12), 0, 0))
  287. Weld(Blade3, Blade4, CN(0, -0.68, 0.075), CA(MR(-15)+MP, MP, 0))
  288. Parts.Handle = Handle
  289. Parts.Derp = Derp
  290. Parts.Blades = {Blade1, Blade2, Blade3, Blade4}
  291. return Parts
  292. end
  293. MakeKnife(HWR)
  294. MakeKnife(HWL)
  295. function Show_Damage(P, D)
  296. local mo = Instance.new("Model")
  297. mo.Name = D
  298. local p = Part(mo, false, false, 0, 0, BN("Bright red"), V3(0.2, 0.2, 0.2))
  299. p.Name = "Head"
  300. local m = Instance.new("SpecialMesh")
  301. m.MeshType = "Brick"
  302. m.Scale = Vector3.new(4.5, 2.3, 4.5)
  303. m.Parent = p
  304. local bp = Instance.new("BodyPosition", p)
  305. bp.maxForce = V3(MH, MH, MH)
  306. bp.P = 9001
  307. bp.position = CN(P) * CN(0, 1.5, 0).p
  308. local h = Instance.new("Humanoid")
  309. h.Health = 0
  310. h.MaxHealth = 0
  311. h.Name = "asd"
  312. h.Parent = mo
  313. local nah = true
  314. mo.Parent = workspace
  315. p.CFrame = CN(P)
  316. Notime(function()
  317. wait(1.5)
  318. for i = 0, 1, 0.05 do
  319. p.Transparency = i
  320. if nah then mo.Name = "" nah = false else mo.Name = "- "..D nah = true end
  321. wait()
  322. end
  323. mo:remove()
  324. end)
  325. end
  326. Weapon.Parent = Model
  327. Model.Parent = Char
  328. if script.Parent.className ~= "HopperBin" then
  329. h = Instance.new("HopperBin", Me.Backpack)
  330. h.Name = ToolName
  331. script.Parent = h
  332. end
  333. bin = script.Parent
  334. function Attach(t)
  335. RSH.Part0 = t
  336. LSH.Part0 = t
  337. RH.Part0 = t
  338. LH.Part0 = t
  339. RABW.Part0 = t
  340. LABW.Part0 = t
  341. LLBW.Part0 = t
  342. RLBW.Part0 = t
  343. if t == Torso then
  344. FTorso.Transparency = 1
  345. FNeck.Part1 = nil
  346. else
  347. Torso.Transparency = 1
  348. FNeck.Part1 = Head
  349. end
  350. t.Transparency = 0
  351. end
  352. function Idle()
  353. local SpeedAtm = Torso.Velocity.magnitude
  354. for i = 0.02, 1, 0.03 do
  355. SpeedAtm = Torso.Velocity.magnitude
  356. if Attacking == true or Selected == false or SpeedAtm > 0.1 then return end
  357. RAW.C0 = CA(MR(-15-6*i), MR(20-2*i), MR(20-3*i))
  358. LAW.C0 = CA(MR(-15-4*i), MR(-20+3*i), MR(-20+4*i))
  359. RLW.C0 = CA(MR(15+4*i), 0, 0) * CN(0.02, 0.4+0.05*i, -0.75)
  360. LLW.C0 = CA(MR(-50-5*i), 0, 0) * CN(-0.02, 0.45, -0.5)
  361. FW.C0 = CN(0, -0.5-0.1*i, 0) * CA(MR(-10-4*i), 0, 0)
  362. FNeck.C0 = Neck0 * CA(MR(20+4*i), 0, 0)
  363. wait()
  364. end
  365. for i = 0.05, 1, 0.05 do
  366. SpeedAtm = Torso.Velocity.magnitude
  367. if Attacking == true or Selected == false or SpeedAtm > 0.1 then return end
  368. RAW.C0 = CA(MR(-21-2*i), MR(18-1*i), MR(17-1*i))
  369. LAW.C0 = CA(MR(-19-1*i), MR(-17+1*i), MR(-16+1*i))
  370. RLW.C0 = CA(MR(19+1*i), 0, 0) * CN(0.02, 0.45+0.02*i, -0.75)
  371. LLW.C0 = CA(MR(-55-2*i), 0, 0) * CN(-0.02, 0.45, -0.5)
  372. FW.C0 = CN(0, -0.6-0.025*i, 0) * CA(MR(-14-1*i), 0, 0)
  373. FNeck.C0 = Neck0 * CA(MR(24+1*i), 0, 0)
  374. wait()
  375. end
  376. for i = 0.04, 1, 0.04 do
  377. SpeedAtm = Torso.Velocity.magnitude
  378. if Attacking == true or Selected == false or SpeedAtm > 0.1 then return end
  379. RAW.C0 = CA(MR(-23+2*i), MR(17+1*i), MR(16+1*i))
  380. LAW.C0 = CA(MR(-20+1*i), MR(-16-1*i), MR(-15-1*i))
  381. RLW.C0 = CA(MR(20-1*i), 0, 0) * CN(0.02, 0.47-0.02*i, -0.75)
  382. LLW.C0 = CA(MR(-57+2*i), 0, 0) * CN(-0.02, 0.45, -0.5)
  383. FW.C0 = CN(0, -0.625+0.025*i, 0) * CA(MR(-15+1*i), 0, 0)
  384. FNeck.C0 = Neck0 * CA(MR(25-1*i), 0, 0)
  385. wait()
  386. end
  387. for i = 0.03, 1, 0.03 do
  388. SpeedAtm = Torso.Velocity.magnitude
  389. if Attacking == true or Selected == false or SpeedAtm > 0.1 then return end
  390. RAW.C0 = CA(MR(-21+4*i), MR(18+2*i), MR(17+2*i))
  391. LAW.C0 = CA(MR(-19+2*i), MR(-17-3*i), MR(-16-3*i))
  392. RLW.C0 = CA(MR(19-3*i), 0, 0) * CN(0.02, 0.45-0.05*i, -0.75)
  393. LLW.C0 = CA(MR(-55+4*i), 0, 0) * CN(-0.02, 0.45, -0.5)
  394. FW.C0 = CN(0, -0.6+0.06*i, 0) * CA(MR(-14+3*i), 0, 0)
  395. FNeck.C0 = Neck0 * CA(MR(24-3*i), 0, 0)
  396. wait()
  397. end
  398. for i = 0.07, 1, 0.07 do
  399. SpeedAtm = Torso.Velocity.magnitude
  400. if Attacking == true or Selected == false or SpeedAtm >= 0.1 then return end
  401. RAW.C0 = CA(MR(-17+2*i), MR(20), MR(19+1*i))
  402. LAW.C0 = CA(MR(-17+2*i), MR(-20), MR(-19-1*i))
  403. RLW.C0 = CA(MR(16-1*i), 0, 0) * CN(0.02, 0.4, -0.75)
  404. LLW.C0 = CA(MR(-51+1*i), 0, 0) * CN(-0.02, 0.45, -0.5)
  405. FW.C0 = CN(0, -0.54+0.04*i, 0) * CA(MR(-11+1*i), 0, 0)
  406. FNeck.C0 = Neck0 * CA(MR(21-1*i), 0, 0)
  407. wait()
  408. end
  409. wait()
  410. end
  411. function RunStart()
  412. for i = 0.33, 1, 0.33 do
  413. RAW.C0 = CA(MR(-15-5*i), MR(20-3*i), MR(20-3*i))
  414. LAW.C0 = CA(MR(-15-5*i), MR(-20+3*i), MR(-20+3*i))
  415. wait()
  416. end
  417. for i = 0.2, 1, 0.2 do
  418. RAW.C0 = CA(MR(-20-15*i), MR(17-5*i), MR(17-7*i))
  419. LAW.C0 = CA(MR(-20-15*i), MR(-17+5*i), MR(-17+7*i))
  420. wait()
  421. end
  422. for i = 0.5, 1, 0.5 do
  423. RAW.C0 = CA(MR(-35-5*i), MR(12-2*i), MR(10-2*i))
  424. LAW.C0 = CA(MR(-35-5*i), MR(-12+2*i), MR(-10+2*i))
  425. wait()
  426. end
  427. end
  428. function RunEnd()
  429. for i = 0.5, 1, 0.5 do
  430. RAW.C0 = CA(MR(-40+5*i), MR(10+2*i), MR(8+2*i))
  431. LAW.C0 = CA(MR(-40+5*i), MR(-10-2*i), MR(-8-2*i))
  432. wait()
  433. end
  434. for i = 0.2, 1, 0.2 do
  435. RAW.C0 = CA(MR(-35+15*i), MR(12+5*i), MR(10+7*i))
  436. LAW.C0 = CA(MR(-35+15*i), MR(-12-5*i), MR(-10-7*i))
  437. wait()
  438. end
  439. for i = 0.33, 1, 0.33 do
  440. RAW.C0 = CA(MR(-20+5*i), MR(17+3*i), MR(17+3*i))
  441. LAW.C0 = CA(MR(-20+5*i), MR(-17-3*i), MR(-17-3*i))
  442. wait()
  443. end
  444. end
  445. function Run()
  446. local SpeedAtm = Torso.Velocity.magnitude
  447. for i = 0.33, 1, 0.33 do
  448. SpeedAtm = Torso.Velocity.magnitude
  449. if Attacking == true or Selected == false or SpeedAtm < 0.1 or Torso.Velocity.Y > 0.5 or Torso.Velocity.Y < -0.5 then return end
  450. RLW.C0 = CA(MR(15-15*i), 0, 0) * CN(0.02, 0.4-0.1*i, -0.75+0.25*i)
  451. LLW.C0 = CA(MR(-50+15*i), 0, 0) * CN(-0.02, 0.45+0.3*i, -0.5)
  452. FW.C0 = CN(0, -0.5+0.2*i, 0) * CA(MR(-10+2*i), 0, 0)
  453. wait()
  454. end
  455. for i = 0.25, 1, 0.25 do
  456. SpeedAtm = Torso.Velocity.magnitude
  457. if Attacking == true or Selected == false or SpeedAtm < 0.1 or Torso.Velocity.Y > 0.5 or Torso.Velocity.Y < -0.5 then return end
  458. RLW.C0 = CA(MR(-60*i), 0, 0) * CN(0.02, 0.3-0.25*i, -0.5+0.75*i)
  459. LLW.C0 = CA(MR(-35+45*i), 0, 0) * CN(-0.02, 0.75+0.4*i, -0.5-0.2*i)
  460. FW.C0 = CN(0, -0.3+0.2*i, 0) * CA(MR(-8+1*i), 0, 0)
  461. wait()
  462. end
  463. for i = 0.5, 1, 0.5 do
  464. SpeedAtm = Torso.Velocity.magnitude
  465. if Attacking == true or Selected == false or SpeedAtm < 0.1 or Torso.Velocity.Y > 0.5 or Torso.Velocity.Y < -0.5 then return end
  466. RLW.C0 = CA(MR(-60-5*i), 0, 0) * CN(0.02, 0.05-0.1*i, 0.25+0.1*i)
  467. LLW.C0 = CA(MR(10+5*i), 0, 0) * CN(-0.02, 1.15-0.15*i, -0.7-0.05*i)
  468. FW.C0 = CN(0, -0.1+0.05*i, 0) * CA(MR(-7+1*i), 0, 0)
  469. wait()
  470. end
  471. for i = 0.33, 1, 0.33 do
  472. SpeedAtm = Torso.Velocity.magnitude
  473. if Attacking == true or Selected == false or SpeedAtm < 0.1 or Torso.Velocity.Y > 0.5 or Torso.Velocity.Y < -0.5 then return end
  474. RLW.C0 = CA(MR(-65+30*i), 0, 0) * CN(0.02, -0.05+0.5*i, 0.35-0.2*i)
  475. LLW.C0 = CA(MR(15-10*i), 0, 0) * CN(-0.02, 1-0.5*i, -0.75+0.1*i)
  476. FW.C0 = CN(0, -0.05-0.6*i, 0) * CA(MR(-6-3*i), 0, 0)
  477. wait()
  478. end
  479. for i = 0.25, 1, 0.25 do
  480. SpeedAtm = Torso.Velocity.magnitude
  481. if Attacking == true or Selected == false or SpeedAtm < 0.1 or Torso.Velocity.Y > 0.5 or Torso.Velocity.Y < -0.5 then return end
  482. RLW.C0 = CA(MR(-35+40*i), 0, 0) * CN(0.02, 0.45+0.9*i, 0.15-0.6*i)
  483. LLW.C0 = CA(MR(5-55*i), 0, 0) * CN(-0.02, 0.5-0.6*i, -0.65+0.8*i)
  484. FW.C0 = CN(0, -0.65+0.4*i, 0) * CA(MR(-9-3*i), 0, 0)
  485. wait()
  486. end
  487. for i = 0.33, 1, 0.33 do
  488. SpeedAtm = Torso.Velocity.magnitude
  489. if Attacking == true or Selected == false or SpeedAtm < 0.1 or Torso.Velocity.Y > 0.1 then return end
  490. RLW.C0 = CA(MR(5+10*i), 0, 0) * CN(0.02, 1.35-0.95*i, -0.45-0.3*i)
  491. LLW.C0 = CA(MR(-50), 0, 0) * CN(-0.02, -0.1+0.55*i, 0.15-0.7*i)
  492. FW.C0 = CN(0, -0.25-0.35*i, 0) * CA(MR(-12+2*i), 0, 0)
  493. wait()
  494. end
  495. end
  496. coroutine.resume(coroutine.create(function()
  497. while true do
  498. local SpeedAtm = Torso.Velocity.magnitude
  499. if Attacking == false and Selected or Torso.Velocity.Y > 0.5 or Torso.Velocity.Y < -0.5 then
  500. if SpeedAtm < 0.1 then
  501. Idle()
  502. RAW.C0 = CA(MR(-15), MR(20), MR(20))
  503. LAW.C0 = CA(MR(-15), MR(-20), MR(-20))
  504. RLW.C0 = CA(MR(15), 0, 0) * CN(0.02, 0.4, -0.75)
  505. LLW.C0 = CA(MR(-50), 0, 0) * CN(-0.02, 0.45, -0.5)
  506. HWR.C0 = CN()
  507. HWL.C0 = CN()
  508. FW.C0 = CN(0, -0.5, 0) * CA(MR(-10), 0, 0)
  509. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  510. else
  511. Run()
  512. end
  513. end
  514. wait()
  515. end
  516. end))
  517. Notime(function()
  518. local Last = Torso.Velocity.magnitude > 0.1
  519. while true do
  520. Running = Torso.Velocity.magnitude > 0.1
  521. if Torso.Velocity.Y < 0.5 or Torso.Velocity.Y > -0.5 and Attacking == false and Selected then
  522. if Running ~= Last then
  523. Last = Running
  524. if Running then
  525. RunStart()
  526. else
  527. RunEnd()
  528. end
  529. end
  530. end
  531. wait()
  532. end
  533. end)
  534. function Jump()
  535. Attacking = true
  536. --Hum.PlatformStand = true
  537. for i = 0.5, 1, 0.5 do
  538. RAW.C0 = CA(MR(-15+10*i), MR(20-5*i), MR(20-3*i))
  539. LAW.C0 = CA(MR(-15+10*i), MR(-20+5*i), MR(-20+3*i))
  540. RLW.C0 = CA(MR(15-10*i), 0, 0) * CN(0.02, 0.4-0.2*i, -0.75+0.35*i)
  541. LLW.C0 = CA(MR(-50+20*i), 0, 0) * CN(-0.02, 0.45-0.3*i, -0.5+0.5*i)
  542. HWR.C0 = CA(MR(10*i), 0, 0)
  543. HWL.C0 = CA(MR(10*i), 0, 0)
  544. FW.C0 = CN(0, -0.5+0.05*i, 0) * CA(MR(-10-2*i), 0, 0)
  545. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  546. wait()
  547. end
  548. local bp = Add.BP(Torso, Torso.Position, 10000)
  549. local Face = Compute(Torso.Position, Torso.CFrame * CN(0, 0, -10).p)
  550. local Dist = 13
  551. local Center = Face * CN(0, 0, -Dist) + V3(0, -Dist/2, 0)
  552. --bp.position = Center * CA(MR(150-120*i), 0, 0) * CN(0, 0, -Dist).p
  553. for i = 0.33, 1, 0.33 do
  554. RAW.C0 = CA(MR(-5+80*i), MR(15-20*i), MR(17-12*i))
  555. LAW.C0 = CA(MR(-5+80*i), MR(-15+20*i), MR(-17+12*i))
  556. RLW.C0 = CA(MR(10-10*i), 0, 0) * CN(0.02, 0.2-0.2*i, -0.45+0.45*i)
  557. LLW.C0 = CA(MR(-40+40*i), 0, 0) * CN(-0.02, 0.15-0.15*i, -0.25+0.25*i)
  558. HWR.C0 = CA(MR(10+25*i), 0, 0)
  559. HWL.C0 = CA(MR(10+25*i), 0, 0)
  560. FW.C0 = CN(0, -0.45+0.45*i, 0) * CA(MR(-12-13*i), 0, 0)
  561. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  562. bp.position = Center * CA(MR(150-10*i), 0, 0) * CN(0, 0, -Dist).p
  563. wait()
  564. end
  565. for i = 0.2, 1, 0.2 do
  566. RAW.C0 = CA(MR(75+60*i), MR(-5), MR(5))
  567. LAW.C0 = CA(MR(75+60*i), MR(5), MR(-5))
  568. RLW.C0 = CA(0, 0, 0) * CN(0.02, 0.25*i, 0)
  569. LLW.C0 = CA(0, 0, 0) * CN(-0.02, 0.25*i, 0)
  570. HWR.C0 = CA(MR(35+20*i), 0, 0)
  571. HWL.C0 = CA(MR(35+20*i), 0, 0)
  572. FW.C0 = CA(MR(-25-35*i), 0, 0)
  573. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  574. bp.position = Center * CA(MR(140-50*i), 0, 0) * CN(0, 0, -Dist).p
  575. wait()
  576. end
  577. for i = 0.5, 1, 0.5 do
  578. RAW.C0 = CA(MR(135+15*i), MR(-5), MR(5))
  579. LAW.C0 = CA(MR(135+15*i), MR(5), MR(-5))
  580. RLW.C0 = CA(MR(-5*i), 0, 0) * CN(0.02, 0.25+0.4*i, -0.45*i)
  581. LLW.C0 = CA(MR(-5*i), 0, 0) * CN(-0.02, 0.25+0.4*i, -0.45*i)
  582. FW.C0 = CA(MR(-60-15*i), 0, 0)
  583. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  584. bp.position = Center * CA(MR(90-10*i), 0, 0) * CN(0, 0, -Dist).p
  585. wait()
  586. end
  587. Hurt = true
  588. Deb = true
  589. for i = 0.15, 1, 0.15 do
  590. RAW.C0 = CA(MR(150-120*i), MR(-5), MR(5))
  591. LAW.C0 = CA(MR(150-120*i), MR(5), MR(-5))
  592. RLW.C0 = CA(MR(-5-20*i), 0, 0) * CN(0.02, 0.65+0.6*i, -0.45-0.45*i)
  593. LLW.C0 = CA(MR(-5-20*i), 0, 0) * CN(-0.02, 0.65+0.5*i, -0.45-0.45*i)
  594. HWR.C0 = CA(MR(55-60*i), 0, 0)
  595. HWL.C0 = CA(MR(55-60*i), 0, 0)
  596. FW.C0 = CA(MR(-75-130*i), 0, 0)
  597. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  598. bp.position = Center * CA(MR(80-30*i), 0, 0) * CN(0, 0, -Dist).p
  599. wait()
  600. end
  601. Hurt = false
  602. Hum.PlatformStand = false
  603. bp:remove()
  604. Attacking = false
  605. end
  606. function SelectAnim()
  607. Atta(Limbs.Rarm)
  608. Atta(Limbs.Larm)
  609. Attach(FTorso)
  610. for i = 0.33, 1, 0.33 do
  611. RAW.C0 = CA(MR(10*i), MR(4*i), MR(3*i))
  612. LAW.C0 = CA(MR(10*i), MR(-4*i), MR(-3*i))
  613. HWR.C0 = CN(0.15*i, 0, 0) * CA(MR(-35*i), 0, 0)
  614. HWL.C0 = CN(-0.15*i, 0, 0) * CA(MR(-35*i), 0, 0)
  615. FW.C0 = CA(MR(3*i), 0, 0)
  616. FNeck.C0 = Neck0 * CA(MR(-5*i), 0, 0)
  617. wait()
  618. end
  619. for i = 0.2, 1, 0.2 do
  620. RAW.C0 = CA(MR(10+50*i), MR(4+16*i), MR(3+7*i))
  621. LAW.C0 = CA(MR(10+50*i), MR(-4-16*i), MR(-3-7*i))
  622. HWR.C0 = CN(0.15+0.25*i, 0, 0) * CA(MR(-35-180*i), 0, 0)
  623. HWL.C0 = CN(-0.15-0.25*i, 0, 0) * CA(MR(-35-180*i), 0, 0)
  624. FW.C0 = CA(MR(3+7*i), 0, 0)
  625. FNeck.C0 = Neck0 * CA(MR(-5-15*i), 0, 0)
  626. wait()
  627. end
  628. for i = 0.25, 1, 0.25 do
  629. RAW.C0 = CA(MR(60+12*i), MR(20), MR(10+3*i))
  630. LAW.C0 = CA(MR(60+12*i), MR(-20), MR(-10-3*i))
  631. HWR.C0 = CN(0.4+0.05*i, 0, 0) * CA(MR(-215-180*i), 0, 0)
  632. HWL.C0 = CN(-0.4-0.05*i, 0, 0) * CA(MR(-215-180*i), 0, 0)
  633. FW.C0 = CA(MR(10+2*i), 0, 0)
  634. FNeck.C0 = Neck0 * CA(MR(-20-2*i), 0, 0)
  635. wait()
  636. end
  637. Atta(Limbs.Rleg)
  638. Atta(Limbs.Lleg)
  639. for i = 0.2, 1, 0.2 do
  640. RAW.C0 = CA(MR(72-80*i), MR(20), MR(13+7*i))
  641. LAW.C0 = CA(MR(72-80*i), MR(-20), MR(-13-7*i))
  642. RLW.C0 = CA(MR(10*i), 0, 0) * CN(0, 0.3*i, -0.7*i)
  643. LLW.C0 = CA(MR(-40*i), 0, 0) * CN(0, 0.4*i, -0.4*i)
  644. HWR.C0 = CN(0.45-0.35*i, 0, 0) * CA(MR(-35-290*i), 0, 0)
  645. HWL.C0 = CN(-0.45+0.35*i, 0, 0) * CA(MR(-35-290*i), 0, 0)
  646. FW.C0 = CN(0, -0.4*i, 0) * CA(MR(12-18*i), 0, 0)
  647. FNeck.C0 = Neck0 * CA(MR(-22+18*i), 0, 0)
  648. wait()
  649. end
  650. for i = 0.5, 1, 0.5 do
  651. RAW.C0 = CA(MR(-8-7*i), MR(20), MR(20))
  652. LAW.C0 = CA(MR(-8-7*i), MR(-20), MR(-20))
  653. RLW.C0 = CA(MR(10+5*i), 0, 0) * CN(0.02*i, 0.3+0.1*i, -0.7-0.05*i)
  654. LLW.C0 = CA(MR(-40-10*i), 0, 0) * CN(-0.02*i, 0.4+0.05*i, -0.4-0.1*i)
  655. HWR.C0 = CN(0.1-0.1*i, 0, 0) * CA(MR(-325-35*i), 0, 0)
  656. HWL.C0 = CN(-0.1+0.1*i, 0, 0) * CA(MR(-325-35*i), 0, 0)
  657. FW.C0 = CN(0, -0.4-0.1*i, 0) * CA(MR(-6-4*i), 0, 0)
  658. FNeck.C0 = Neck0 * CA(MR(-4+16*i), 0, 0)
  659. wait()
  660. end
  661. RAW.C0 = CA(MR(-15), MR(20), MR(20))
  662. LAW.C0 = CA(MR(-15), MR(-20), MR(-20))
  663. RLW.C0 = CA(MR(15), 0, 0) * CN(0.02, 0.4, -0.75)
  664. LLW.C0 = CA(MR(-50), 0, 0) * CN(-0.02, 0.45, -0.5)
  665. HWR.C0 = CN()
  666. HWL.C0 = CN()
  667. FW.C0 = CN(0, -0.5, 0) * CA(MR(-10), 0, 0)
  668. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  669. end
  670. function DeselAnim()
  671. for i = 0.25, 1, 0.25 do
  672. RAW.C0 = CA(MR(-15+4*i), MR(20-5*i), MR(20-3*i))
  673. LAW.C0 = CA(MR(-15+4*i), MR(-20+5*i), MR(-20+3*i))
  674. RLW.C0 = CA(MR(15-5*i), 0, 0) * CN(0.02-0.02*i, 0.4-0.1*i, -0.75+0.25*i)
  675. LLW.C0 = CA(MR(-50+15*i), 0, 0) * CN(-0.02+0.02*i, 0.45-0.1*i, -0.5+0.2*i)
  676. FW.C0 = CN(0, -0.5+0.15*i, 0) * CA(MR(-10+3*i), 0, 0)
  677. FNeck.C0 = Neck0 * CA(MR(20-15*i), 0, 0)
  678. wait()
  679. end
  680. for i = 0.2, 1, 0.2 do
  681. RAW.C0 = CA(MR(-11+11*i), MR(15-15*i), MR(17-17*i))
  682. LAW.C0 = CA(MR(-11+11*i), MR(-15+15*i), MR(-17+17*i))
  683. RLW.C0 = CA(MR(10-10*i), 0, 0) * CN(0, 0.3-0.3*i, -0.5+0.5*i)
  684. LLW.C0 = CA(MR(-35+35*i), 0, 0) * CN(0, 0.35-0.35*i, -0.3+0.3*i)
  685. FW.C0 = CN(0, -0.35+0.35*i, 0) * CA(MR(-7+7*i), 0, 0)
  686. FNeck.C0 = Neck0 * CA(MR(5-5*i), 0, 0)
  687. wait()
  688. end
  689. RAW.Part1 = nil
  690. LAW.Part1 = nil
  691. RLW.Part1 = nil
  692. LLW.Part1 = nil
  693. Attach(Torso)
  694. end
  695. function _onselected(mouse)
  696. SelectAnim()
  697. Hum.WalkSpeed = Speed
  698. Selected = true
  699. mouse.Button1Down:connect(function()
  700. end)
  701. mouse.KeyDown:connect(function(key)
  702. key = key:lower()
  703. if Find(Attacks, key) then
  704. if key == "q" then
  705. Jump()
  706. end
  707. RAW.C0 = CA(MR(-15), MR(20), MR(20))
  708. LAW.C0 = CA(MR(-15), MR(-20), MR(-20))
  709. RLW.C0 = CA(MR(15), 0, 0) * CN(0.02, 0.4, -0.75)
  710. LLW.C0 = CA(MR(-50), 0, 0) * CN(-0.02, 0.45, -0.5)
  711. HWR.C0 = CN()
  712. HWL.C0 = CN()
  713. FW.C0 = CN(0, -0.5, 0) * CA(MR(-10), 0, 0)
  714. FNeck.C0 = Neck0 * CA(MR(20), 0, 0)
  715. end
  716. end)
  717. end
  718. function onDeselected(mouse)
  719. Selected = false
  720. Hum.WalkSpeed = 16
  721. DeselAnim()
  722. end
  723. bin.Selected:connect( _onselected)
  724. bin.Deselected:connect(onDeselected)
Add Comment
Please, Sign In to add comment