Advertisement
NextFlamePB

ROBLOX Unlimited King Flame Script

Dec 12th, 2015
3,985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 43.23 KB | None | 0 0
  1.  
  2. local Shared = nil
  3. if not Shared or game.Players.LocalPlayer.Name == Shared then
  4. wait(1/30)
  5. pcall(function()
  6.     game.Players.LocalPlayer.Character.Animate.Disabled = true
  7. end)
  8. local active = true
  9. local player = game.Players.LocalPlayer
  10. local mouse = player:GetMouse()
  11. local stats = {
  12.     ["Power"] = 10,
  13.     ["HP"] = math.huge,
  14.     ["HPRegen"] = math.huge,
  15.     ["MP"] = math.huge,
  16.     ["MPRegen"] = 10,
  17.     ["MPCharge"] = 20,
  18.     ["WalkSpeed"] = 16
  19. }
  20. local state = {}
  21. local c0 = {
  22.     ["Neck"] = {Vector3.new(0,1.5,0),CFrame.Angles(math.pi/-2,0,0)},
  23.     ["Right Shoulder"] = {Vector3.new(1.5,0.5,0),CFrame.Angles(0,math.pi/2,0)},
  24.     ["Left Shoulder"] = {Vector3.new(-1.5,0.5,0),CFrame.Angles(0,math.pi/-2,0)},
  25.     ["Right Hip"] = {Vector3.new(0.5,-1,0),CFrame.Angles(0,math.pi/2,0)},
  26.     ["Left Hip"] = {Vector3.new(-0.5,-1,0),CFrame.Angles(0,math.pi/-2,0)}
  27. }
  28. local c1 = {
  29.     ["Neck"] = CFrame.Angles(math.pi/-2,0,0),
  30.     ["Right Shoulder"] = CFrame.new(0,0.5,0)*CFrame.Angles(0,math.pi/2,0),
  31.     ["Left Shoulder"] = CFrame.new(0,0.5,0)*CFrame.Angles(0,math.pi/-2,0),
  32.     ["Right Hip"] = CFrame.new(0,1,0)*CFrame.Angles(0,math.pi/2,0),
  33.     ["Left Hip"] = CFrame.new(0,1,0)*CFrame.Angles(0,math.pi/-2,0)
  34. }
  35. local bodyPart = {}
  36. local limb = {}
  37. local humanoidState = {}
  38. local humanoidCurrentState = "Standing"
  39. for _,v in pairs({"Climbing","FallingDown","FreeFalling","GettingUp","Jumping","Ragdoll","Running","Seated","Strafing","Swimming"}) do
  40.     local number = {"Running","Strafing","Climbing","Swimming"}
  41.     for _,p in pairs(number) do number[p] = true end
  42.     humanoidState[v] = {
  43.     ["Connection"] = nil,
  44.     ["Value"] = number[v] and 0 or false}
  45. end
  46. local humanoid
  47. local bpos
  48. local gyro
  49. local bvel
  50. local ui
  51. local skillName = {
  52.     ["z"] = "Iron Fist",
  53.     ["x"] = "Crushing Fang",
  54.     ["c"] = "Flame Elbow",
  55.     ["v"] = "Claw",
  56.         ["g"] = "FireBreath",
  57.         ["f"] = "Eagle",
  58.     ["b"] = "Roar",
  59.     ["n"] = "Wing Attack",
  60.     ["m"] = "Sword Horn"
  61. }
  62. local skillFunc = {
  63.     ["Iron Fist"] = function()
  64.         local cam = workspace.CurrentCamera
  65.         local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
  66.         local strength = state.MPCharge*stats.Power
  67.         for i=1,5 do
  68.             wait(1/30)
  69.             gyro.cframe = target*CFrame.Angles(-math.pi/3,-math.pi/4,0)
  70.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2
  71.             bodyPart.Torso.Velocity = Vector3.new()
  72.             translateLimb("Neck",Vector3.new(math.pi/6,0,0),Vector3.new(),0.75)
  73.             translateLimb("Right Shoulder",Vector3.new(0,-math.pi/3,math.pi/2),Vector3.new(),0.75)
  74.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/8,-math.pi/1.5),Vector3.new(0.25,0,-0.25),0.75)
  75.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.75,-0.75),0.75)
  76.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  77.             flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  78.         end
  79.         for i=1,5 do
  80.             wait(1/30)
  81.             local ratio = i/5
  82.             gyro.cframe = target*CFrame.Angles(-math.pi/3,math.pi/2,0)
  83.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2*(1-ratio)
  84.             bodyPart.Torso.Velocity = Vector3.new()
  85.             translateLimb("Neck",Vector3.new(),Vector3.new(),0.75)
  86.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/5,math.pi/1.5),Vector3.new(-0.5,0,-0.5),0.75)
  87.             translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/24),Vector3.new(),0.75)
  88.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.5,-0.5),0.75)
  89.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
  90.             AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
  91.             flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  92.         end
  93.     end,
  94.     ["Crushing Fang"] = function()
  95.         local cam = workspace.CurrentCamera
  96.         local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
  97.         local strength = state.MPCharge*stats.Power
  98.         for i=1,5 do
  99.             wait(1/30)
  100.             local ratio = math.min(1,i/3)
  101.             gyro.cframe = target*CFrame.Angles(math.pi/6*ratio,0,math.pi/3*ratio)
  102.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector
  103.             bodyPart.Torso.Velocity = Vector3.new()
  104.             translateLimb("Right Shoulder",Vector3.new(0,-math.pi/3,math.pi/2),Vector3.new(),0.75)
  105.             translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(0.25,0,-0.25),0.75)
  106.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(0,0.5,-0.25),0.75)
  107.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  108.             flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  109.         end
  110.         for i=1,5 do
  111.             wait(1/30)
  112.             local ratio = math.min(1,i/3)
  113.             gyro.cframe = target*CFrame.Angles(math.pi/6-(math.pi+math.pi/6)*ratio,0,math.pi/3)
  114.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*(1-ratio)
  115.             bodyPart.Torso.Velocity = Vector3.new()
  116.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/8,math.pi/2),Vector3.new(),0.75)
  117.             translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(0.25,0,-0.25),0.75)
  118.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(0,0.5,-0.25),0.75)
  119.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  120.             AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/50,target.lookVector*strength/500,true)
  121.             flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  122.         end
  123.     end,
  124.     ["Flame Elbow"] = function()
  125.         local cam = workspace.CurrentCamera
  126.         local cf = bodyPart.Torso.CFrame
  127.         local lookXZ = CFrame.new(cf.p,mouse.Hit.p*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
  128.         local strength = state.MPCharge*stats.Power
  129.         function booster(size)
  130.             local dir = bodyPart["Right Arm"].CFrame
  131.             local maxSize = math.min(10,math.ceil(size/2))
  132.             for i=1,maxSize do
  133.                 wait(1/30)
  134.                 local ratio = i/maxSize
  135.                 local pos = (dir*CFrame.new(0,1+i*math.min(30,math.max(2,size*ratio))/4,0)).p
  136.                 flame(CFrame.new(pos)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,size*ratio)
  137.                 AoE(pos,math.max(2,size*ratio),strength/100,(dir*CFrame.Angles(math.pi/2,0,0)).lookVector*strength/1000)
  138.             end
  139.         end
  140.         for i=1,30 do
  141.             wait(1/30)
  142.             gyro.cframe = lookXZ*CFrame.Angles(0,-math.pi/3,0)
  143.             bodyPart.Torso.CFrame = (bodyPart.Torso.CFrame-bodyPart.Torso.CFrame.p)+cf.p
  144.             bodyPart.Torso.Velocity = Vector3.new()
  145.             translateLimb("Neck",Vector3.new(0,0,math.pi/4),Vector3.new(),0.75)
  146.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/2),Vector3.new(-0.25,0,-0.5),0.75)
  147.             translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(),0.75)
  148.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
  149.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
  150.             if i > 3 then
  151.                 coroutine.wrap(booster)(i)
  152.             end
  153.         end
  154.         for i=1,5 do
  155.             wait(0.01)
  156.             gyro.cframe = lookXZ*CFrame.Angles(0,math.pi/2,0)
  157.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,0,-5*i)*CFrame.Angles(0,math.pi/2,0)
  158.             bodyPart.Torso.Velocity = Vector3.new()
  159.             translateLimb("Neck",Vector3.new(),Vector3.new(),0.9)
  160.             translateLimb("Right Shoulder",Vector3.new(0,-math.pi/2,math.pi/2),Vector3.new(),0.9)
  161.             translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(),0.9)
  162.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
  163.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
  164.             AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,2,strength*10,lookXZ.lookVector*strength*100,true)
  165.         end
  166.     end,
  167.     ["Eagle"] = function()
  168.         local cam = workspace.CurrentCamera
  169.         local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
  170.         local strength = state.MPCharge*stats.Power
  171.         for i=1,5 do
  172.             wait(1/30)
  173.             gyro.cframe = target*CFrame.Angles(-math.pi/3,-math.pi/4,0)
  174.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2
  175.             bodyPart.Torso.Velocity = Vector3.new()
  176.             translateLimb("Neck",Vector3.new(math.pi/6,0,0),Vector3.new(),0.75)
  177.             translateLimb("Right Shoulder",Vector3.new(0,-math.pi/3,math.pi/2),Vector3.new(),0.75)
  178.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/8,-math.pi/1.5),Vector3.new(0.25,0,-0.25),0.75)
  179.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.75,-0.75),0.75)
  180.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  181.             flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  182.         end
  183.                 for i=1,5 do
  184.             wait(1/30)
  185.             gyro.cframe = target*CFrame.Angles(-math.pi/3,-math.pi/4,0)
  186.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2
  187.             bodyPart.Torso.Velocity = Vector3.new()
  188.             translateLimb("Neck",Vector3.new(math.pi/6,0,0),Vector3.new(),0.75)
  189.             translateLimb("Right Shoulder",Vector3.new(0,-math.pi/7,math.pi/1),Vector3.new(),0.75)
  190.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/8,-math.pi/3),Vector3.new(0.50,0,-0.30),0.90)
  191.             translateLimb("Right Hip",Vector3.new(-math.pi/6,0,-math.pi/6),Vector3.new(0,0.75,-0.20),0.50)
  192.             translateLimb("Left Hip",Vector3.new(-math.pi/6,0,-math.pi/12),Vector3.new(),0.50)
  193.                         AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
  194.         end
  195.         for i=1,5 do
  196.             wait(1/30)
  197.             local ratio = i/5
  198.             gyro.cframe = target*CFrame.Angles(-math.pi/3,math.pi/2,0)
  199.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2*(1-ratio)
  200.             bodyPart.Torso.Velocity = Vector3.new()
  201.             translateLimb("Neck",Vector3.new(),Vector3.new(),0.75)
  202.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/5,math.pi/1.5),Vector3.new(-0.5,0,-0.5),0.75)
  203.             translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/24),Vector3.new(),0.75)
  204.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.5,-0.5),0.75)
  205.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
  206.                         explosion((bodyPart["Right Arm"]),5,2,0)
  207.             AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
  208.             flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  209.         end
  210.     end,
  211.     ["Claw"] = function()
  212.         local cam = workspace.CurrentCamera
  213.         local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
  214.         local strength = state.MPCharge*stats.Power
  215.         for i=1,10 do
  216.             wait(1/30)
  217.             local hit,pos = advRay(bodyPart.Torso.Position,target.lookVector*5,{player.Character})
  218.             gyro.cframe = target*CFrame.Angles(0,math.pi/2,math.pi/3)
  219.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*(bodyPart.Torso.Position-pos).magnitude
  220.             bodyPart.Torso.Velocity = Vector3.new()
  221.             translateLimb("Neck",Vector3.new(0,math.pi/12,-math.pi/3),Vector3.new(),0.75)
  222.             translateLimb("Right Shoulder",Vector3.new(-math.pi/3,0,0),Vector3.new(),0.75)
  223.             translateLimb("Left Shoulder",Vector3.new(-math.pi/3,0,0),Vector3.new(0.25,0,-0.25),0.75)
  224.             translateLimb("Right Hip",Vector3.new(-math.pi/8,0,0),Vector3.new(),0.75)
  225.             translateLimb("Left Hip",Vector3.new(math.pi/8,0,-math.pi/12),Vector3.new(-0.5,0.5,0),0.75)
  226.             AoE((bodyPart["Right Leg"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
  227.             flame(CFrame.new((bodyPart["Right Leg"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
  228.             if hit then
  229.                 bodyPart.Torso.Velocity = bodyPart.Torso.Velocity+Vector3.new(0,60,0)-target.lookVector*20
  230.                 break
  231.             end
  232.         end
  233.     end,
  234.             ["FireBreath"] = function()
  235.         local cam = workspace.CurrentCamera
  236.         local mouseHit = mouse.Hit.p
  237.         local cf = bodyPart.Torso.CFrame
  238.         local lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
  239.         local target = (mouseHit-cf.p).unit
  240.         local dir = math.pi/2-math.acos(target.y)
  241.         local strength = state.MPCharge*stats.Power
  242.         for i=1,50 do
  243.             wait(1/30)
  244.             local ratio = math.sin(i/100*math.pi)
  245.             local offset = math.sin(-ratio*math.pi/8)
  246.             gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio,0,0)
  247.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,offset,-offset)*CFrame.Angles(math.pi/4*ratio,0,0)
  248.             bodyPart.Torso.Velocity = Vector3.new()
  249.             translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
  250.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,-math.pi/12),Vector3.new(),0.5)
  251.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,math.pi/12),Vector3.new(),0.5)
  252.             translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio),Vector3.new(),1)
  253.             translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio),Vector3.new(),1)
  254.         end
  255.         for i=1,5 do
  256.             wait(1/30)
  257.             local ratio = 1-i/5
  258.             local offset = math.sin(i/5*dir)+math.sin(-ratio*math.pi/8)
  259.             local rot = dir*i/5
  260.             gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio+rot,0,0)
  261.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(math.pi/4*ratio+rot,0,0)
  262.             bodyPart.Torso.Velocity = Vector3.new()
  263.             translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
  264.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
  265.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
  266.             translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio-rot),Vector3.new(),1)
  267.             translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio+rot),Vector3.new(),1)
  268.         end
  269.         --rune(bodyPart.Head.CFrame*CFrame.new(0,0,-3)*CFrame.Angles(math.pi/2,0,0),5,13/3)
  270.         for i=1,50 do
  271.             wait(1/30)
  272.             mouseHit = mouseHit:Lerp(mouse.Hit.p,0.1)
  273.             lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
  274.             target = (mouseHit-cf.p).unit
  275.             dir = math.pi/2-math.acos(target.y)
  276.             local offset = math.sin(dir)
  277.             gyro.cframe = lookXZ*CFrame.Angles(dir,0,0)
  278.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(dir,0,0)
  279.             bodyPart.Torso.Velocity = Vector3.new()
  280.             translateLimb("Neck",Vector3.new(),Vector3.new(),1)
  281.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
  282.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
  283.             translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-dir),Vector3.new(),0.5)
  284.             translateLimb("Left Hip",Vector3.new(-math.pi/24,0,dir),Vector3.new(),0.5)
  285.             coroutine.wrap(function()
  286.                 local direction = bodyPart.Head.CFrame
  287.                 for n=1,10 do
  288.                     wait(1/30)
  289.                     local scale = math.min(30,n*3)
  290.                     flame(CFrame.new((direction*CFrame.new(0,0,-5-n*scale/4)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,scale)
  291.                     AoE((direction*CFrame.new(0,0,-5-n*scale/4)).p,scale,strength/100,target*strength/1000,false)
  292.                 end
  293.             end)()
  294.         end
  295.     end,
  296.     ["Roar"] = function()
  297.         local cam = workspace.CurrentCamera
  298.         local mouseHit = mouse.Hit.p
  299.         local cf = bodyPart.Torso.CFrame
  300.         local lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
  301.         local target = (mouseHit-cf.p).unit
  302.         local dir = math.pi/2-math.acos(target.y)
  303.         local strength = state.MPCharge*stats.Power
  304.         for i=1,50 do
  305.             wait(1/30)
  306.             local ratio = math.sin(i/100*math.pi)
  307.             local offset = math.sin(-ratio*math.pi/8)
  308.             gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio,0,0)
  309.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,offset,-offset)*CFrame.Angles(math.pi/4*ratio,0,0)
  310.             bodyPart.Torso.Velocity = Vector3.new()
  311.             translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
  312.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,-math.pi/12),Vector3.new(),0.5)
  313.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,math.pi/12),Vector3.new(),0.5)
  314.             translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio),Vector3.new(),1)
  315.             translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio),Vector3.new(),1)
  316.         end
  317.         for i=1,5 do
  318.             wait(1/30)
  319.             local ratio = 1-i/5
  320.             local offset = math.sin(i/5*dir)+math.sin(-ratio*math.pi/8)
  321.             local rot = dir*i/5
  322.             gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio+rot,0,0)
  323.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(math.pi/4*ratio+rot,0,0)
  324.             bodyPart.Torso.Velocity = Vector3.new()
  325.             translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
  326.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
  327.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
  328.             translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio-rot),Vector3.new(),1)
  329.             translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio+rot),Vector3.new(),1)
  330.         end
  331.         --rune(bodyPart.Head.CFrame*CFrame.new(0,0,-3)*CFrame.Angles(math.pi/2,0,0),5,13/3)
  332.         for i=1,50 do
  333.             wait(1/30)
  334.             mouseHit = mouseHit:Lerp(mouse.Hit.p,0.1)
  335.             lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
  336.             target = (mouseHit-cf.p).unit
  337.             dir = math.pi/2-math.acos(target.y)
  338.             local offset = math.sin(dir)
  339.             gyro.cframe = lookXZ*CFrame.Angles(dir,0,0)
  340.             bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(dir,0,0)
  341.             bodyPart.Torso.Velocity = Vector3.new()
  342.             translateLimb("Neck",Vector3.new(),Vector3.new(),1)
  343.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
  344.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
  345.             translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-dir),Vector3.new(),0.5)
  346.             translateLimb("Left Hip",Vector3.new(-math.pi/24,0,dir),Vector3.new(),0.5)
  347.             coroutine.wrap(function()
  348.                 local direction = bodyPart.Head.CFrame
  349.                 for n=1,10 do
  350.                     wait(1/30)
  351.                     local scale = math.min(30,n*3)
  352.                     flame(CFrame.new((direction*CFrame.new(0,0,-5-n*scale/4)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,scale)
  353.                     AoE((direction*CFrame.new(0,0,-5-n*scale/4)).p,scale,strength/100,target*strength/1000,false)
  354.                 end
  355.             end)()
  356.         end
  357.     end,
  358.     ["Wing Attack"] = function()
  359.         local cam = workspace.CurrentCamera
  360.         local cf = bodyPart.Torso.CFrame
  361.         local lookXZ = CFrame.new(cf.p,mouse.Hit.p*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
  362.         local target = CFrame.new(cf.p,mouse.Hit.p)
  363.         local strength = state.MPCharge*stats.Power
  364.         for i=1,5 do
  365.             wait(1/30)
  366.             gyro.cframe = lookXZ*CFrame.Angles(-math.pi/6,0,0)
  367.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+(lookXZ*CFrame.Angles(math.pi/6,0,0)).lookVector*3
  368.             bodyPart.Torso.Velocity = Vector3.new()
  369.             translateLimb("Neck",Vector3.new(math.pi/12,0,0),Vector3.new(),0.75)
  370.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(),0.75)
  371.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/4,-math.pi/1.5),Vector3.new(),0.75)
  372.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.75,-0.75),0.75)
  373.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  374.         end
  375.         function wing()
  376.             local dir1 = bodyPart["Right Arm"].CFrame
  377.             local dir2 = bodyPart["Left Arm"].CFrame
  378.             for n=1,10 do
  379.                 wait(1/30)
  380.                 if dir1 then
  381.                     local hit,pos = advRay(dir1.p,(dir1*CFrame.new(0,-1-n*5,0)).p-dir1.p,{player.Character})
  382.                     flame(CFrame.new(pos)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,10,true)
  383.                     AoE(pos,hit and 20 or 10,strength/(hit and 1 or 10),(dir1*CFrame.Angles(-math.pi,0,0)).lookVector*strength/10,true)
  384.                     if hit then
  385.                         local x = Instance.new("Explosion",workspace)
  386.                         x.Position = pos
  387.                         x.BlastPressure = 0
  388.                         x.BlastRadius = 3
  389.                         dir1 = nil
  390.                     end
  391.                 end
  392.                 if dir2 then
  393.                     local hit,pos = advRay(dir2.p,(dir2*CFrame.new(0,-1-n*5,0)).p-dir2.p,{player.Character})
  394.                     flame(CFrame.new(pos)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,10,true)
  395.                     AoE(pos,hit and 20 or 10,strength/(hit and 1 or 10),(dir2*CFrame.Angles(-math.pi,0,0)).lookVector*strength/(hit and 1 or 10),true)
  396.                     if hit then
  397.                         local x = Instance.new("Explosion",workspace)
  398.                         x.Position = pos
  399.                         x.BlastPressure = 0
  400.                         x.BlastRadius = 3
  401.                         dir2 = nil
  402.                     end
  403.                 end
  404.                 if not dir1 and not dir2 then break end
  405.             end
  406.         end
  407.         for i=1,10 do
  408.             wait(1/30)
  409.             local ratio = i/10
  410.             gyro.cframe = lookXZ*CFrame.Angles(-math.pi/6+math.pi/3*ratio,0,0)
  411.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+(lookXZ*CFrame.Angles(math.pi/6,0,0)).lookVector*3
  412.             bodyPart.Torso.Velocity = Vector3.new()
  413.             translateLimb("Neck",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
  414.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,math.pi*1.25),Vector3.new(),0.5)
  415.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,-math.pi*1.25),Vector3.new(),0.5)
  416.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  417.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
  418.             if i > 3 then
  419.                 coroutine.wrap(wing)()
  420.             end
  421.         end
  422.         for i=1,10 do
  423.             wait(1/30)
  424.             gyro.cframe = lookXZ*CFrame.Angles(math.pi/6-(math.pi/3+math.pi/6)*math.min(1,i/3),0,0)
  425.             bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+(lookXZ*CFrame.Angles(math.pi/6,0,0)).lookVector*3*(1-i/10)
  426.             bodyPart.Torso.Velocity = Vector3.new()
  427.             translateLimb("Neck",Vector3.new(math.pi/12,0,0),Vector3.new(),0.75)
  428.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,-math.pi/6),Vector3.new(),0.25)
  429.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,math.pi/6),Vector3.new(),0.25)
  430.             translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
  431.             translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
  432.             coroutine.wrap(wing)()
  433.         end
  434.         bodyPart.Torso.Velocity = lookXZ.lookVector*20
  435.     end
  436. }
  437. function getRegion(point,range,ignore)
  438.     return workspace:FindPartsInRegion3WithIgnoreList(Region3.new(point-Vector3.new(1,1,1)*range/2,point+Vector3.new(1,1,1)*range/2),ignore,100)
  439. end
  440. function getHumanoid(v)
  441.     if v and v.Parent then
  442.         local h = v.Parent:findFirstChild("Humanoid") or v.Parent.Parent:findFirstChild("Humanoid")
  443.         if not h then
  444.             for _,p in ipairs(v.Parent:GetChildren()) do
  445.                 if p:isA("Humanoid") then
  446.                     h = p
  447.                 end
  448.             end
  449.             if not h and v.Parent.Parent and v.Parent.Parent ~= game and v.Parent.Parent ~= workspace then
  450.                 for _,p in ipairs(v.Parent.Parent:GetChildren()) do
  451.                     if p:isA("Humanoid") then
  452.                         h = p
  453.                     end
  454.                 end
  455.             end
  456.         end
  457.         return h
  458.     end
  459. end
  460. function advRay(start,point)
  461.     local dis = (start-(start+point)).magnitude
  462.     local dir = ((start+point)-start).unit
  463.     if dis > 999 then
  464.         dis = 999
  465.     end
  466.     point = dis*dir
  467.     hit,pos = workspace:FindPartOnRayWithIgnoreList(Ray.new(start,point),{player.Character})
  468.     if hit and not hit.CanCollide and not getHumanoid(hit) then
  469.         function persistentRay(list)
  470.             hit,pos = workspace:FindPartOnRayWithIgnoreList(Ray.new(start,point),{player.Character,unpack(list)})
  471.             if hit and not hit.CanCollide and not getHumanoid(hit) then
  472.                 hit,pos = persistentRay({hit,unpack(list)})
  473.             end
  474.             return hit,pos
  475.         end
  476.         hit,pos = persistentRay({hit})
  477.     end
  478.     return hit,pos
  479. end
  480. function AoE(point,radius,damage,push,trip)
  481.     ypcall(function()
  482.         local push = push or Vector3.new()
  483.         local hit = getRegion(point,radius,{player.Character})
  484.         local humanoidList = {}
  485.         for _,v in pairs(hit) do
  486.             local h = getHumanoid(v)
  487.             if not v.Anchored then
  488.                 if h then
  489.                     if not humanoidList[h] then
  490.                         humanoidList[h] = true
  491.                         h:TakeDamage(damage)
  492.                         if h.Parent:findFirstChild("Torso") and h.Parent.Torso:isA("BasePart") then
  493.                             if push.magnitude > 0 then
  494.                                 local v = Instance.new("BodyVelocity",h.Parent.Torso)
  495.                                 v.maxForce = Vector3.new(1,1,1)*10000000000
  496.                                 v.velocity = push/0.1
  497.                                 game.Debris:AddItem(v,0.1)
  498.                             end
  499.                             if trip then
  500.                                 local v = Instance.new("BodyAngularVelocity",h.Parent.Torso)
  501.                                 v.maxTorque = Vector3.new(1,1,1)*10000000000
  502.                                 v.angularvelocity = Vector3.new(math.pi,0,math.pi)/0.1
  503.                                 game.Debris:AddItem(v,0.1)
  504.                             end
  505.                         end
  506.                     end
  507.                 else v:BreakJoints()
  508.                     v.Velocity = v.Velocity+push/v:GetMass()
  509.                 end
  510.             end
  511.         end
  512.     end)
  513. end
  514. function preloadCharacter()
  515.     humanoid = player.Character.Humanoid
  516.     state = {
  517.         ["Move"] = "Iron Fist",
  518.         ["CD"] = 0,
  519.         ["MP"] = 0,
  520.         ["MPCharge"] = 0,
  521.         ["LastCharge"] = 0,
  522.         ["Falling"] = false,
  523.         ["W"] = 0,
  524.         ["A"] = 0,
  525.         ["S"] = 0,
  526.         ["D"] = 0,
  527.         ["J"] = 0,
  528.         ["Sprint"] = false,
  529.         ["Charge"] = false,
  530.         ["Skill"] = false
  531.     }
  532.     for _,v in pairs({"Head","Torso","Right Arm","Left Arm","Right Leg","Left Leg"}) do
  533.         bodyPart[v] = player.Character:findFirstChild(v)
  534.     end
  535.     for _,v in pairs({"Neck","Right Shoulder","Left Shoulder","Right Hip","Left Hip"}) do
  536.         if bodyPart.Torso:findFirstChild(v) then
  537.             limb[v] = {
  538.                 ["Weld"] = bodyPart.Torso[v],
  539.                 ["Rotation"] = Vector3.new(),
  540.                 ["Offset"] = Vector3.new(),
  541.                 ["C0"] = c0[v],
  542.                 ["C1"] = c1[v]
  543.             }
  544.             bodyPart.Torso[v].DesiredAngle = 0
  545.         end
  546.     end
  547.     for n,v in pairs(humanoidState) do
  548.         pcall(function() v.Connection:disconnect() end)
  549.         v.Connection = humanoid[n]:connect(function(p)
  550.             local running = nil
  551.             if string.match("RunningStrafingClimbingSwimming",n) then
  552.                 if p > 0.1 then
  553.                     running = n == "Climbing" and n or "Running"
  554.                 else running = "Standing"
  555.                 end
  556.             end
  557.             local falling = string.match("JumpingGettingUpFreeFallingFallingDown",n) and "Falling"
  558.             humanoidCurrentState = running or falling or n
  559.             v.Value = p
  560.         end)
  561.     end
  562.     bpos = Instance.new("BodyPosition",bodyPart.Torso)
  563.     bpos.D = 200
  564.     bpos.maxForce = Vector3.new(0,99999,0)
  565.     bpos.position = bodyPart.Torso.Position
  566.     gyro = Instance.new("BodyGyro",bodyPart.Torso)
  567.     gyro.D = 100
  568.     gyro.maxTorque = Vector3.new(1,1,1)*99999
  569.     gyro.cframe = bodyPart.Torso.CFrame
  570.     bvel = Instance.new("BodyVelocity",bodyPart.Torso)
  571.     bvel.maxForce = Vector3.new(1,0,1)*9999
  572.     bvel.velocity = Vector3.new()
  573.     ui = Instance.new("ScreenGui",player.PlayerGui)
  574.     local txt = Instance.new("TextLabel",ui)
  575.     txt.Name = "MP"
  576.     txt.BackgroundTransparency = 1
  577.     txt.Position = UDim2.new(0,210,1,-60)
  578.     txt.Font = "ArialBold"
  579.     txt.FontSize = "Size18"
  580.     txt.Text = "Magic Power: 0"
  581.     txt.TextColor3 = Color3.new(1,1,1)
  582.     txt.TextStrokeTransparency = 0.9
  583.     txt.TextXAlignment = "Left"
  584.     txt.TextYAlignment = "Bottom"
  585.     local txt = txt:Clone()
  586.     txt.Name = "Charge"
  587.     txt.Text = "Charge: 0"
  588.     txt.Position = UDim2.new(0,210,1,-80)
  589.     txt.Parent = ui
  590.     local txt = txt:Clone()
  591.     txt.Name = "Move"
  592.     txt.Text = "Move: Iron Fist"
  593.     txt.Position = UDim2.new(0,210,1,-100)
  594.     txt.Parent = ui
  595. end
  596. preloadCharacter()
  597. function translateLimb(v,rot,pos,alpha)
  598.     rot = rot or limb[v].Rotation
  599.     pos = pos or limb[v].Offset
  600.     limb[v].Rotation = limb[v].Rotation:Lerp(rot,alpha)
  601.     limb[v].Offset = limb[v].Offset:Lerp(pos,alpha)
  602. end
  603. function rune(cf,size,lifespan)
  604.     coroutine.wrap(function()
  605.         local p = Instance.new("Part")
  606.         plight = Instance.new("PointLight",p)
  607.         plight.Color = BrickColor.new("Bright red").Color
  608.         p.formFactor = 0
  609.         p.Size = Vector3.new()
  610.         p.BrickColor = BrickColor.new("Bright red")
  611.         p.Anchored = true
  612.         p.Locked = true
  613.         p.CanCollide = false
  614.         p.CFrame = cf*CFrame.Angles(math.pi/2,0,0)
  615.         p.TopSurface = 0
  616.         p.BottomSurface = 0
  617.         p.Parent = player.Character
  618.         local m = Instance.new("SpecialMesh",p)
  619.         local wave = p:Clone()
  620.         wave.CFrame = cf
  621.         wave.Parent = player.Character
  622.         wave.Mesh.MeshType = Enum.MeshType.Sphere
  623.         wave.Mesh.Scale = Vector3.new(0,size/10,0)
  624.         m.MeshId = "http://www.roblox.com/asset/?id=47260990"
  625.         m.Scale = Vector3.new(size,size,size/10)
  626.         p.Transparency = 1
  627.         game.Debris:AddItem(p)
  628.         game.Debris:AddItem(wave)
  629.         for i=1,5 do
  630.             p.Transparency = 1-math.sin(i/10*math.pi)*0.75
  631.             p.CFrame = p.CFrame*CFrame.Angles(0,0,(i/5)*math.pi/12)
  632.             wave.Mesh.Scale = Vector3.new(size*i,size/10,size*i)/2
  633.             wave.Transparency = i/5
  634.             wait(1/30)
  635.         end
  636.         wave:Remove()
  637.         delay(lifespan,function()
  638.             for i=1,20 do
  639.                 local ratio = math.sin(i/40*math.pi)*0.75
  640.                 p.Transparency = 0.25+ratio
  641.                 wait(1/30)
  642.             end
  643.             p:Remove()
  644.         end)
  645.     end)()
  646. end
  647. function explosion(where,heat,size,pres)
  648.         a = Instance.new("Explosion",Workspace)
  649.         a.BlastRadius = size
  650.         a.BlastPressure = pres
  651.         a.Position = where.Position
  652.     local f = Instance.new("Fire",p)
  653.     f.Size = size
  654.     f.Heat = heat
  655.         f:Remove()
  656. end
  657. function flame(cf,heat,size,instant)
  658.     local p = Instance.new("Part")
  659.     p.formFactor = 3
  660.     p.Anchored = true
  661.     p.CanCollide = false
  662.     p.Locked = true
  663.     p.Transparency = 1
  664.     p.Size = Vector3.new()
  665.     p.CFrame = cf
  666.     p.Parent = player.Character
  667.     local f = Instance.new("Fire",p)
  668.     f.Size = size
  669.     f.Heat = heat
  670.     game.Debris:AddItem(p,1.1)
  671.     delay(0.1,function()
  672.         f.Enabled = false
  673.         if instant then
  674.             p:Destroy()
  675.         end
  676.     end)
  677. end
  678. mouse.KeyDown:connect(function(key)
  679.     state.W = key == "w" and 1 or state.W
  680.     state.A = key == "a" and 1 or state.A
  681.     state.S = key == "s" and 1 or state.S
  682.     state.D = key == "d" and 1 or state.D
  683.     state.J = key == " " and 1 or state.J
  684.     state.Sprint = key == "q" or state.Sprint
  685.     if skillName[key] and not state.Skill then
  686.         state.Move = skillName[key]
  687.         ui.Move.Text = "Move: "..skillName[key]
  688.         if state.CD > 0 and not state.Charge and state.MP > 0 then
  689.             state.MPCharge = math.min(state.MP,state.LastCharge)
  690.             ui.Charge.Text = "Charge: "..state.MPCharge
  691.             state.Skill = true
  692.             ypcall(function()
  693.                 skillFunc[state.Move]()
  694.             end)
  695.             state.Skill = false
  696.             state.CD = state.MP > 0 and 0.2 or 0
  697.             state.MP = math.max(0,state.MP-state.MPCharge)
  698.             state.LastCharge = state.MPCharge
  699.             state.MPCharge = 0
  700.             ui.Charge.Text = "Charge: 0"
  701.         end
  702.     end
  703. end)
  704. mouse.KeyUp:connect(function(key)
  705.     state.W = key == "w" and 0 or state.W
  706.     state.A = key == "a" and 0 or state.A
  707.     state.S = key == "s" and 0 or state.S
  708.     state.D = key == "d" and 0 or state.D
  709.     state.J = key == " " and 0 or state.J
  710.     if key == "q" then
  711.         state.Sprint = false
  712.     end
  713. end)
  714. mouse.Button1Down:connect(function()
  715.     if not state.Skill then
  716.         state.Charge = true
  717.     end
  718. end)
  719. mouse.Button1Up:connect(function()
  720.     if not state.Skill and state.Charge then
  721.         state.Charge = false
  722.         state.Skill = true
  723.         delay(1/30,function()
  724.             rune(bodyPart.Torso.CFrame-Vector3.new(0,2.5,0),20,1)
  725.         end)
  726.         local pos = bodyPart.Torso.Position
  727.         for i=1,10 do
  728.             wait(1/30)
  729.             bodyPart.Torso.CFrame = CFrame.new(pos,pos+bodyPart.Torso.CFrame.lookVector)
  730.             bodyPart.Torso.Velocity = Vector3.new()
  731.             translateLimb("Right Shoulder",Vector3.new(0,math.pi/2.5+(math.random()-0.5)*math.pi/48,math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(-0.25,0,-0.75),0.9)
  732.             translateLimb("Left Shoulder",Vector3.new(0,-math.pi/2.5+(math.random()-0.5)*math.pi/48,-math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(0.25,0,-0.75),0.9)
  733.             translateLimb("Right Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.75)
  734.             translateLimb("Left Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.75)
  735.         end
  736.         ypcall(function()
  737.             skillFunc[state.Move]()
  738.         end)
  739.         state.Skill = false
  740.         state.CD = 0.2
  741.         state.MP = math.max(0,state.MP-state.MPCharge)
  742.         state.LastCharge = state.MPCharge
  743.         state.MPCharge = 0
  744.         ui.Charge.Text = "Charge: 0"
  745.     end
  746. end)
  747. while active do
  748.     local t = wait(1/30)
  749.     state.CD = math.max(0,state.CD-t)
  750.     humanoid.PlatformStand = true
  751.     local cam = workspace.CurrentCamera
  752.     local pos = bodyPart.Torso.Position
  753.     local camXZ = CFrame.new(pos,pos+cam.CoordinateFrame.lookVector*Vector3.new(1,0,1))
  754.     local platform,pos = advRay(bodyPart.Torso.Position,Vector3.new(0,state.Falling and ((bodyPart.Torso.Velocity.y*t))-4.5 or -4.5,0))
  755.     --local platform,pos = advRay(bodyPart.Torso.Position,Vector3.new(0,-4.5,0))
  756.     local moveZ = (not state.Charge and not state.Skill) and state.W-state.S or 0
  757.     local moveX = (not state.Charge and not state.Skill) and state.A-state.D or 0
  758.     local jump = (not state.Charge and not state.Skill) and state.J or 0
  759.     state.Falling = not platform
  760.     bpos.maxForce = Vector3.new(0,(state.Falling and 0 or 1)*(1-jump),0)*99999*(state.Skill and 0 or 1)
  761.     bpos.position = Vector3.new(0,pos.y+3,0)
  762.     bvel.maxForce = Vector3.new(1,state.J*10,1)*9999*(state.Falling and 0 or 1)
  763.     bvel.velocity = ((moveZ == 0 and moveX == 0) and Vector3.new() or (camXZ.lookVector*moveZ+(camXZ*CFrame.Angles(0,math.pi/2,0)).lookVector*moveX).unit*stats.WalkSpeed)+Vector3.new(0,jump*40,0)
  764.     local pos = bodyPart.Torso.Position
  765.     if not state.Skill then
  766.         gyro.cframe = camXZ
  767.         if state.CD <= 0 then
  768.             state.MP = math.min(stats.MP,state.MP+stats.MPRegen*t)
  769.         end
  770.         if state.Charge then
  771.             state.MPCharge = math.min(state.MP,state.MPCharge+stats.MPCharge*t)
  772.             ui.Charge.Text = "Charge: "..state.MPCharge
  773.             translateLimb("Right Shoulder",Vector3.new(0,-math.pi/4+(math.random()-0.5)*math.pi/48,math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(),0.5)
  774.             translateLimb("Left Shoulder",Vector3.new(0,math.pi/4+(math.random()-0.5)*math.pi/48,-math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(),0.5)
  775.             translateLimb("Right Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.5)
  776.             translateLimb("Left Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.5)
  777.         else translateLimb("Neck",Vector3.new(),Vector3.new(),0.25)
  778.             if state.Falling then
  779.                 translateLimb("Right Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.5)
  780.                 translateLimb("Left Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.5)
  781.                 translateLimb("Right Hip",Vector3.new(0,0,math.pi/24),Vector3.new(0,0.25,-0.25),0.5)
  782.                 translateLimb("Left Hip",Vector3.new(0,0,math.pi/24),Vector3.new(),0.5)
  783.             elseif moveZ > 0 then
  784.                 if state.Sprint then
  785.                     bvel.velocity = bvel.velocity*Vector3.new(3,1,3)
  786.                     local ratio = math.sin(tick()*math.pi*5)
  787.                     local swing = math.pi/2
  788.                     gyro.cframe = gyro.cframe*CFrame.Angles(-math.pi/3,ratio*swing/4,0)
  789.                     translateLimb("Right Shoulder",Vector3.new(0,math.max(0,ratio*swing/1.5),math.pi/6+ratio*swing*2),Vector3.new(),0.25)
  790.                     translateLimb("Left Shoulder",Vector3.new(0,math.min(0,ratio*swing/1.5),-math.pi/6+ratio*swing*2),Vector3.new(),0.25)
  791.                     translateLimb("Right Hip",Vector3.new(0,0,math.pi/6-ratio*swing*1.5),Vector3.new(),0.25)
  792.                     translateLimb("Left Hip",Vector3.new(0,0,-math.pi/6-ratio*swing*1.5),Vector3.new(),0.25)
  793.                 else local ratio = math.sin(tick()*math.pi*3)
  794.                     local swing = math.pi/4
  795.                     gyro.cframe = gyro.cframe*CFrame.Angles(0,ratio*swing/12,0)
  796.                     translateLimb("Right Shoulder",Vector3.new(0,math.max(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
  797.                     translateLimb("Left Shoulder",Vector3.new(0,math.min(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
  798.                     translateLimb("Right Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
  799.                     translateLimb("Left Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
  800.                 end
  801.             elseif moveZ < 0 then
  802.                 local ratio = math.sin(-tick()*math.pi*3)
  803.                 local swing = math.pi/4
  804.                 gyro.cframe = gyro.cframe*CFrame.Angles(math.pi/24,ratio*swing/12,0)
  805.                 translateLimb("Right Shoulder",Vector3.new(0,math.max(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
  806.                 translateLimb("Left Shoulder",Vector3.new(0,math.min(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
  807.                 translateLimb("Right Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
  808.                 translateLimb("Left Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
  809.             elseif moveX ~= 0 then
  810.                 local ratio = math.sin(tick()*math.pi*3)*moveX
  811.                 local swing = math.pi/6
  812.                 gyro.cframe = gyro.cframe*CFrame.Angles(0,ratio*swing/12,0)
  813.                 translateLimb("Right Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.25)
  814.                 translateLimb("Left Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.25)
  815.                 translateLimb("Right Hip",Vector3.new(ratio*swing,0,math.max(0,ratio*swing/2)),Vector3.new(),0.25)
  816.                 translateLimb("Left Hip",Vector3.new(ratio*swing,0,math.max(0,ratio*swing/2)),Vector3.new(),0.25)
  817.             else local ratio = math.sin(tick()*math.pi/2)
  818.                 local swing = math.pi/48
  819.                 translateLimb("Right Shoulder",Vector3.new(-swing+ratio*swing,0,0),Vector3.new(),0.125)
  820.                 translateLimb("Left Shoulder",Vector3.new(-swing+ratio*swing,0,0),Vector3.new(),0.125)
  821.                 translateLimb("Right Hip",Vector3.new(),Vector3.new(),0.125)
  822.                 translateLimb("Left Hip",Vector3.new(),Vector3.new(),0.125)
  823.             end
  824.         end
  825.     end
  826.     ui.MP.Text = "Magic Power: "..state.MP
  827.     for _,v in pairs(limb) do
  828.         v.Weld.C0 = CFrame.new(v.C0[1]+v.Offset)*v.C0[2]*CFrame.Angles(v.Rotation.x,v.Rotation.y,v.Rotation.z)
  829.         v.Weld.C1 = v.C1
  830.     end
  831. end
  832. else script:Clone().Parent = game.Players[Shared].Character
  833. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement