Advertisement
zephpsian

Untitled

Aug 9th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. local plr = game.Players.G_osty
  2. local character = plr.Character
  3. RootPart=character.HumanoidRootPart
  4. RootJoint=RootPart.RootJoint
  5. character.Torso.roblox:Destroy()
  6. tors = character.Torso
  7. local Player_Size = 1
  8. vt=Vector3.new
  9. VT=Vector3.new
  10. cf=CFrame.new
  11. euler=CFrame.fromEulerAnglesXYZ
  12. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  13. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  14. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  15. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  16. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  17. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  18. RootPart=character.HumanoidRootPart
  19. RootJoint=RootPart.RootJoint
  20. RootCF=euler(-1.57,0,3.14)
  21. RAD=math.rad
  22. local CF = CFrame.new
  23. COS=math.cos
  24. local Sin = math.sin
  25. local Cos = math.cos
  26. local Rad = math.rad
  27. local angles=CFrame.Angles
  28. LW=tors["Left Shoulder"]
  29. LH=tors["Left Hip"]
  30. RW=tors["Right Shoulder"]
  31. RH=tors["Right Hip"]
  32. Neck = tors["Neck"]
  33. local ROOTC0 = CF(0, 0, 0) * angles(RAD(-90), RAD(0), RAD(180))
  34. local NECKC0 = CF(0, 1, 0) * angles(RAD(-90), RAD(0), RAD(180))
  35. local RWC0 = CF(-0.5, 0, 0) * angles(RAD(0), RAD(90), RAD(0))
  36. local LWC0 = CF(0.5, 0, 0) * angles(RAD(0), RAD(-90), RAD(0))
  37. Animation_Speed = 3
  38. local sine = 0
  39. local Humanoid = plr.Character.Humanoid
  40.  
  41. local r = 255,0,0
  42. local g = 0,255,0
  43. local b = 0,0,255
  44. coroutine.resume(coroutine.create(function()
  45. while wait(1) do
  46. for i,v in pairs(character:GetChildren()) do
  47. if v:IsA("Part") and v.Name ~= "Head" then
  48. local v2 = v:Clone()
  49. v2:ClearAllChildren()
  50. v2.Name = "Glow"
  51. v2.Transparency = 0.7
  52. v2.CanCollide = false
  53. v2.Anchored = true
  54. v2.Material = Enum.Material.Neon
  55. v2.Parent = character
  56. v2.Color = Color3.fromRGB(r)
  57. v2.Position = v.Position + Vector3.new(-math.random(0.1,3),math.random(0.1,3),-math.random(0.1,3))
  58. local v3 = v:Clone()
  59. v3:ClearAllChildren()
  60. v3.Name = "Glow"
  61. v3.Transparency = 0.7
  62. v3.CanCollide = false
  63. v3.Anchored = true
  64. v3.Material = Enum.Material.Neon
  65. v3.Parent = character
  66. v3.Color = Color3.fromRGB(0,255,0)
  67. v3.Position = v.Position + Vector3.new(math.random(0.1,3),-math.random(0.1,3),math.random(0.1,3))
  68. local v4 = v:Clone()
  69. v4:ClearAllChildren()
  70. v4.Name = "Glow"
  71. v4.Transparency = 0.7
  72. v4.CanCollide = false
  73. v4.Anchored = true
  74. v4.Material = Enum.Material.Neon
  75. v4.Parent = character
  76. v4.Color = Color3.fromRGB(0,0,255)
  77. v4.Position = v.Position + Vector3.new(-math.random(0.1,3),math.random(0.1,3),-math.random(0.1,3))
  78.  
  79. wait()
  80. v3:Destroy()
  81. v4:Destroy()
  82. v2:Destroy()
  83. end
  84. end
  85. end
  86. end))
  87. function clerp(a,b,t)
  88. local qa = {QuaternionFromCFrame(a)}
  89. local qb = {QuaternionFromCFrame(b)}
  90. local ax, ay, az = a.x, a.y, a.z
  91. local bx, by, bz = b.x, b.y, b.z
  92. local _t = 1-t
  93. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  94. end
  95.  
  96.  
  97. function aclerp(startCF,endCF,alpha)
  98. return startCF:lerp(endCF, alpha)
  99. end
  100.  
  101.  
  102. function Clerp(a,b,t)
  103. local qa = {QuaternionFromCFrame(a)}
  104. local qb = {QuaternionFromCFrame(b)}
  105. local ax, ay, az = a.x, a.y, a.z
  106. local bx, by, bz = b.x, b.y, b.z
  107. local _t = 1-t
  108. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  109. end
  110.  
  111. function QuaternionFromCFrame(cf)
  112. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  113. local trace = m00 + m11 + m22
  114. if trace > 0 then
  115. local s = math.sqrt(1 + trace)
  116. local recip = 0.5/s
  117. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  118. else
  119. local i = 0
  120. if m11 > m00 then
  121. i = 1
  122. end
  123. if m22 > (i == 0 and m00 or m11) then
  124. i = 2
  125. end
  126. if i == 0 then
  127. local s = math.sqrt(m00-m11-m22+1)
  128. local recip = 0.5/s
  129. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  130. elseif i == 1 then
  131. local s = math.sqrt(m11-m22-m00+1)
  132. local recip = 0.5/s
  133. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  134. elseif i == 2 then
  135. local s = math.sqrt(m22-m00-m11+1)
  136. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  137. end
  138. end
  139. end
  140.  
  141. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  142. local xs, ys, zs = x + x, y + y, z + z
  143. local wx, wy, wz = w*xs, w*ys, w*zs
  144. local xx = x*xs
  145. local xy = x*ys
  146. local xz = x*zs
  147. local yy = y*ys
  148. local yz = y*zs
  149. local zz = z*zs
  150. 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))
  151. end
  152.  
  153. function QuaternionSlerp(a, b, t)
  154. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  155. local startInterp, finishInterp;
  156. if cosTheta >= 0.0001 then
  157. if (1 - cosTheta) > 0.0001 then
  158. local theta = math.acos(cosTheta)
  159. local invSinTheta = 1/math.sin(theta)
  160. startInterp = math.sin((1-t)*theta)*invSinTheta
  161. finishInterp = math.sin(t*theta)*invSinTheta
  162. else
  163. startInterp = 1-t
  164. finishInterp = t
  165. end
  166. else
  167. if (1+cosTheta) > 0.0001 then
  168. local theta = math.acos(-cosTheta)
  169. local invSinTheta = 1/math.sin(theta)
  170. startInterp = math.sin((t-1)*theta)*invSinTheta
  171. finishInterp = math.sin(t*theta)*invSinTheta
  172. else
  173. startInterp = t-1
  174. finishInterp = t
  175. end
  176. end
  177. 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
  178. end
  179.  
  180. Humanoid.Animator.Parent = nil
  181. coroutine.resume(coroutine.create(function()
  182. while wait() do
  183. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0.1, -0.1 + 0.05 * Sin(sine / 12)) * angles(RAD(-10), RAD(0), RAD(0)), 1 / Animation_Speed)
  184. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * angles(RAD(-5 - 2.5 * Sin(sine / 12)), RAD(7 * COS(sine / 24)), RAD(0)), 1 / Animation_Speed)
  185. RW.C0 = Clerp(RW.C0, CF(1, 0.5 + 0.05 * Sin(sine / 12), -0.5) * angles(RAD(0), RAD(0), RAD(-100)) * angles(RAD(20), RAD(0), RAD(0)) * RWC0, 1 / Animation_Speed)
  186. LW.C0 = Clerp(LW.C0, CF(-1, 0.3 + 0.05 * Sin(sine / 12), -0.35) * angles(RAD(0), RAD(0), RAD(70)) * angles(RAD(20), RAD(0), RAD(0)) * LWC0, 1 / Animation_Speed)
  187. RH.C0 = Clerp(RH.C0, CF(1, -1 - 0.05 * Sin(sine / 12), 0) * angles(RAD(-10), RAD(80), RAD(0)) * angles(RAD(-3), RAD(0), RAD(0)), 1 / Animation_Speed)
  188. LH.C0 = Clerp(LH.C0, CF(-1, -1 - 0.05 * Sin(sine / 12), 0) * angles(RAD(-10), RAD(-80), RAD(0)) * angles(RAD(-3), RAD(0), RAD(0)), 1 / Animation_Speed)
  189.  
  190. end
  191. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement