Advertisement
Finnegan5

animation

Aug 24th, 2017
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.73 KB | None | 0 0
  1. Character = game.Players.LocalPlayer.Character
  2. Head = Character.Head
  3.  
  4. CV="Blue"
  5. p = game.Players.LocalPlayer
  6. char = p.Character
  7. local txt = Instance.new("BillboardGui", char)
  8. txt.Adornee = char .Head
  9. txt.Name = "_status"
  10. txt.Size = UDim2.new(2, 0, 1.2, 0)
  11. txt.StudsOffset = Vector3.new(-9, 8, 0)
  12. local text = Instance.new("TextLabel", txt)
  13. text.Size = UDim2.new(10, 0, 7, 0)
  14. text.FontSize = "Size24"
  15. text.TextScaled = true
  16. text.TextTransparency = 0
  17. text.BackgroundTransparency = 1
  18. text.TextTransparency = 0
  19. text.TextStrokeTransparency = 0
  20. text.Font = "Cartoon"
  21. text.TextStrokeColor3 = Color3.new(.6,0,0)
  22.  
  23. v=Instance.new("Part")
  24. v.Name = "ColorBrick"
  25. v.Parent=p.Character
  26. v.FormFactor="Symmetric"
  27. v.Anchored=true
  28. v.CanCollide=false
  29. v.BottomSurface="Smooth"
  30. v.TopSurface="Smooth"
  31. v.Size=Vector3.new(10,5,3)
  32. v.Transparency=1
  33. v.CFrame=char.Torso.CFrame
  34. v.BrickColor=BrickColor.new(CV)
  35. v.Transparency=1
  36. text.TextColor3 = Color3.new(.6,0,0)
  37. v.Shape="Block"
  38. text.Text = "Animation Testing.."
  39.  
  40. local s = Instance.new("Sound",char)
  41. s.Name = "BGMusic"
  42. s.SoundId = "rbxassetid://154305943"
  43. s.Pitch = 1
  44. s.Volume = 7
  45. s.Looped = true
  46. s.archivable = false
  47. s.Parent = char.Head
  48. wait(0.1)
  49. s:play()
  50.  
  51. Instance.new("ForceField", game.Players.LocalPlayer.Character)
  52.  
  53. p = game.Players.LocalPlayer
  54. char = p.Character
  55. torso = char.Torso
  56. neck = char.Torso.Neck
  57.  
  58. Player=game:GetService("Players").LocalPlayer
  59. Character=Player.Character
  60. PlayerGui=Player.PlayerGui
  61. Backpack=Player.Backpack
  62. Torso=Character.Torso
  63. Head=Character.Head
  64. Humanoid=Character.Humanoid
  65. LeftArm=Character["Left Arm"]
  66. LeftLeg=Character["Left Leg"]
  67. RightArm=Character["Right Arm"]
  68. RightLeg=Character["Right Leg"]
  69. cam=game.Workspace.CurrentCamera
  70. LS=Torso["Left Shoulder"]
  71. LH=Torso["Left Hip"]
  72. RS=Torso["Right Shoulder"]
  73. RH=Torso["Right Hip"]
  74. Face = Head.face
  75. Neck=Torso.Neck
  76. it=Instance.new
  77. attacktype=1
  78. vt=Vector3.new
  79. cf=CFrame.new
  80. euler=CFrame.fromEulerAnglesXYZ
  81. angles=CFrame.Angles
  82. cloaked=false
  83. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  84. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  85. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  86. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  87. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  88. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  89. RootPart=Character.HumanoidRootPart
  90. RootJoint=RootPart.RootJoint
  91. RootCF=euler(-1.57,0,3.14)
  92. attack = false
  93. bounce=false
  94. cooldown=false
  95. deeznuts=false
  96. attackdebounce = false
  97. deb=false
  98. equipped=true
  99. hand=false
  100. MMouse=nil
  101. combo=0
  102. mana=0
  103. trispeed=.2
  104. attackmode='none'
  105. local idle=0
  106. local Anim="Idle"
  107. local Effects={}
  108. local gun=false
  109. local shoot=false
  110. player=nil
  111. mana=0
  112. cam = workspace.CurrentCamera
  113. ZTarget = nil
  114. RocketTarget = nil
  115. local m = Instance.new("Model",Character)
  116. m.Name = "WeaponModel"
  117.  
  118. mouse=Player:GetMouse()
  119. --save shoulders
  120. RSH, LSH=nil, nil
  121. --welds
  122. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  123. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  124. LH=Torso["Left Hip"]
  125. RH=Torso["Right Hip"]
  126. TorsoColor=Torso.BrickColor
  127. function NoOutline(Part)
  128. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  129. end
  130. player=Player
  131. ch=Character
  132. RSH=ch.Torso["Right Shoulder"]
  133. LSH=ch.Torso["Left Shoulder"]
  134. --
  135. RSH.Parent=nil
  136. LSH.Parent=nil
  137. --
  138. RW.Name="Right Shoulder"
  139. RW.Part0=ch.Torso
  140. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  141. RW.C1=cf(0, 0.5, 0)
  142. RW.Part1=ch["Right Arm"]
  143. RW.Parent=ch.Torso
  144. --
  145. LW.Name="Left Shoulder"
  146. LW.Part0=ch.Torso
  147. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  148. LW.C1=cf(0, 0.5, 0)
  149. LW.Part1=ch["Left Arm"]
  150. LW.Parent=ch.Torso
  151.  
  152. function swait(num)
  153. if num==0 or num==nil then
  154. game:service'RunService'.Heartbeat:wait(0)
  155. else
  156. for i=0,num do
  157. game:service'RunService'.Heartbeat:wait(0)
  158. end
  159. end
  160. end
  161.  
  162.  
  163. local Player = game.Players.localPlayer
  164. local Character = Player.Character
  165. local red = 255
  166. local green = 255
  167. local blue = 255
  168. local Humanoid = Character.Humanoid
  169. local mouse = Player:GetMouse()
  170. local m = Instance.new("Model", Character)
  171. m.Name = "WeaponModel"
  172. local LeftArm = Character["Left Arm"]
  173. local RightArm = Character["Right Arm"]
  174. local LeftLeg = Character["Left Leg"]
  175. local RightLeg = Character["Right Leg"]
  176. local Head = Character.Head
  177. local Torso = Character.Torso
  178. local cam = game.Workspace.CurrentCamera
  179. local RootPart = Character.HumanoidRootPart
  180. local RootJoint = RootPart.RootJoint
  181. local equipped = false
  182. local attack = false
  183. local Anim = "Idle"
  184. local idle = 0
  185. local attacktype = 1
  186. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  187. local velocity = RootPart.Velocity.y
  188. local sine = 0
  189. local change = 1
  190. local grabbed = false
  191. local cn = CFrame.new
  192. local mr = math.rad
  193. local angles = CFrame.Angles
  194. local ud = UDim2.new
  195. local c3 = Color3.new
  196. local lim = 0
  197. local st = 0
  198. local necko = cn(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  199. local attacktype = 1
  200. local ZTarget, RocketTarget = nil, nil
  201. local euler = CFrame.fromEulerAnglesXYZ
  202. function clerp(a,b,t)
  203. local qa = {QuaternionFromCFrame(a)}
  204. local qb = {QuaternionFromCFrame(b)}
  205. local ax, ay, az = a.x, a.y, a.z
  206. local bx, by, bz = b.x, b.y, b.z
  207. local _t = 1-t
  208. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  209. end
  210.  
  211. function QuaternionFromCFrame(cf)
  212. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  213. local trace = m00 + m11 + m22
  214. if trace > 0 then
  215. local s = math.sqrt(1 + trace)
  216. local recip = 0.5/s
  217. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  218. else
  219. local i = 0
  220. if m11 > m00 then
  221. i = 1
  222. end
  223. if m22 > (i == 0 and m00 or m11) then
  224. i = 2
  225. end
  226. if i == 0 then
  227. local s = math.sqrt(m00-m11-m22+1)
  228. local recip = 0.5/s
  229. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  230. elseif i == 1 then
  231. local s = math.sqrt(m11-m22-m00+1)
  232. local recip = 0.5/s
  233. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  234. elseif i == 2 then
  235. local s = math.sqrt(m22-m00-m11+1)
  236. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  237. end
  238. end
  239. end
  240.  
  241. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  242. local xs, ys, zs = x + x, y + y, z + z
  243. local wx, wy, wz = w*xs, w*ys, w*zs
  244. local xx = x*xs
  245. local xy = x*ys
  246. local xz = x*zs
  247. local yy = y*ys
  248. local yz = y*zs
  249. local zz = z*zs
  250. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  251. end
  252.  
  253. function QuaternionSlerp(a, b, t)
  254. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  255. local startInterp, finishInterp;
  256. if cosTheta >= 0.0001 then
  257. if (1 - cosTheta) > 0.0001 then
  258. local theta = math.acos(cosTheta)
  259. local invSinTheta = 1/math.sin(theta)
  260. startInterp = math.sin((1-t)*theta)*invSinTheta
  261. finishInterp = math.sin(t*theta)*invSinTheta
  262. else
  263. startInterp = 1-t
  264. finishInterp = t
  265. end
  266. else
  267. if (1+cosTheta) > 0.0001 then
  268. local theta = math.acos(-cosTheta)
  269. local invSinTheta = 1/math.sin(theta)
  270. startInterp = math.sin((t-1)*theta)*invSinTheta
  271. finishInterp = math.sin(t*theta)*invSinTheta
  272. else
  273. startInterp = t-1
  274. finishInterp = t
  275. end
  276. end
  277. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  278. end
  279. rayCast = function(Position, Direction, Range, Ignore)
  280. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  281. end
  282. local v = game.Players.localPlayer
  283. local torso = v.Character.Torso
  284.  
  285. plr = game.Players.LocalPlayer
  286. char = game.Players.LocalPlayer.Character
  287. hum = game.Players.LocalPlayer.Character.Humanoid
  288. t = game.Players.LocalPlayer.Character.Torso
  289. h = game.Players.LocalPlayer.Character.Head
  290. ra = game.Players.LocalPlayer.Character["Right Arm"]
  291. la = game.Players.LocalPlayer.Character["Left Arm"]
  292. rl = game.Players.LocalPlayer.Character["Right Leg"]
  293. ll = game.Players.LocalPlayer.Character["Left Leg"]
  294. tors = Character.Torso
  295. lleg = Character["Left Leg"]
  296. root = Character.HumanoidRootPart
  297. hed = Character.Head
  298. rleg = Character["Right Leg"]
  299. rarm = Character["Right Arm"]
  300. larm = Character["Left Arm"]
  301. bsize1 = NumberSequenceKeypoint.new(3,3,3)
  302. bsize2 = NumberSequenceKeypoint.new(10,10,10)
  303. local Effects = {}
  304. attack = false
  305. local attacking = false
  306. vt = Vector3.new
  307. bc = BrickColor.new
  308. br = BrickColor.random
  309. it = Instance.new
  310. cf = CFrame.new
  311. euler = CFrame.fromEulerAnglesXYZ
  312. angles = CFrame.Angles
  313. matr = math.random
  314. local colororg = BrickColor.new("Dark indigo") -- set color u like
  315. local meshtype = "Sphere" -- only for specialmesh
  316. mouse = plr:GetMouse()
  317.  
  318. game:GetService("RunService").Stepped:connect(function()
  319. Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  320. velocity = RootPart.Velocity.y
  321. sine = sine + change
  322. local hit, pos = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  323. if equipped == true or equipped == false then
  324. if RootPart.Velocity.y > 1 and hit == nil then
  325. Anim = "Jump"
  326. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  327. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  328. if attack == false then
  329. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(-2.5),math.rad(0),math.rad(0)),.3)
  330. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(2.5),math.rad(0),math.rad(0)),.3)
  331. RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.65, 0) * angles(math.rad(-10), math.rad(0), math.rad(50)), 0.3)
  332. LW.C0 = clerp(LW.C0, CFrame.new(-1.45, 0.65, 0) * angles(math.rad(-10), math.rad(0), math.rad(-50)), 0.3)
  333. end
  334. else
  335. if RootPart.Velocity.y < -1 and hit == nil then
  336. Anim = "Fall"
  337. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  338. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  339. if attack == false then
  340. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(5),math.rad(0),math.rad(0)),.3)
  341. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(2.5),math.rad(0),math.rad(0)),.3)
  342. RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.65, 0) * angles(math.rad(-10), math.rad(0), math.rad(90)), 0.3)
  343. LW.C0 = clerp(LW.C0, CFrame.new(-1.45, 0.65, 0) * angles(math.rad(-10), math.rad(0), math.rad(-90)), 0.3)
  344. end
  345. else
  346. if Torsovelocity < 1 and hit ~= nil then
  347. Anim = "Idle"
  348. RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(-10),math.rad(0)),.3)
  349. LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(10),math.rad(0)),.3)
  350. if attack == false then
  351. change = 1
  352. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 32))* angles(math.rad(0),math.rad(0),math.rad(-20)),.3)
  353. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(10),math.rad(0),math.rad(20)),.3)
  354. RW.C0 = clerp(RW.C0, CFrame.new(1, 0.35, -0.25) * angles(math.rad(20 + 1.5 * math.cos(sine / 32)), math.rad(-30), math.rad(-90)), 0.3)
  355. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-10 + 1.5 * math.cos(sine / 32))), 0.3)
  356. end
  357. else
  358. if Torsovelocity > 2 and hit ~= nil then
  359. Anim = "Walk"
  360. RH.C0=clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(-25),math.rad(0 + 50 * math.cos(sine / 6))),.3)
  361. LH.C0=clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 32),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(-25),math.rad(0 + 50 * math.cos(sine / 6))),.3)
  362. if attack == false then
  363. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 32))* angles(math.rad(15),math.rad(0),math.rad(25)),.3)
  364. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(10),math.rad(0),math.rad(-25)),.3)
  365. RW.C0 = clerp(RW.C0, CFrame.new(1, 0.35, -0.5) * angles(math.rad(20), math.rad(-30), math.rad(-90)), 0.3)
  366. LW.C0 = clerp(LW.C0, CFrame.new(-1.45, 0.5, 0) * angles(math.rad(0 - 45 * math.cos(sine / 5)), math.rad(0), math.rad(-10)), 0.3)
  367. end
  368. end
  369. end
  370. end
  371. end
  372. end
  373. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement