Advertisement
Gystac

idk what this even is

Jan 4th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.24 KB | None | 0 0
  1. function clerp(c1,c2,al)
  2. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  3. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  4. for i,v in pairs(com1) do
  5. com1[i] = v+(com2[i]-v)*al
  6. end
  7. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  8. end
  9.  
  10.  
  11. plr = game:service'Players'.LocalPlayer
  12. plrgui = plr.PlayerGui
  13. char = plr.Character
  14. mouse = plr:GetMouse()
  15. humanoid = char:findFirstChild("Humanoid")
  16. torso = char:findFirstChild("Torso")
  17. head = char.Head
  18. ra = char:findFirstChild("Right Arm")
  19. la = char:findFirstChild("Left Arm")
  20. rl = char:findFirstChild("Right Leg")
  21. ll = char:findFirstChild("Left Leg")
  22. rs = torso:findFirstChild("Right Shoulder")
  23. ls = torso:findFirstChild("Left Shoulder")
  24. rh = torso:findFirstChild("Right Hip")
  25. lh = torso:findFirstChild("Left Hip")
  26. neck = torso:findFirstChild("Neck")
  27. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  28. rootpart = char:findFirstChild("HumanoidRootPart")
  29. camera = workspace.CurrentCamera
  30. anim = char:findFirstChild("Animate")
  31. if anim then
  32. anim:Destroy()
  33. end
  34.  
  35. wait(1)
  36.  
  37. local rm = Instance.new("Motor", torso)
  38. rm.C0 = CFrame.new(1.5, 0.5, 0)
  39. rm.C1 = CFrame.new(0, 0.5, 0)
  40. rm.Part0 = torso
  41. rm.Part1 = ra
  42. rm.Name = 'Right Shoulder'
  43.  
  44. local lm = Instance.new("Motor", torso)
  45. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  46. lm.C1 = CFrame.new(0, 0.5, 0)
  47. lm.Part0 = torso
  48. lm.Part1 = la
  49. lm.Name = 'Left Shoulder'
  50.  
  51. local rlegm = Instance.new("Motor", torso)
  52. rlegm.C0 = CFrame.new(0.5, -1, 0)
  53. rlegm.C1 = CFrame.new(0, 1, 0)
  54. rlegm.Part0 = torso
  55. rlegm.Part1 = rl
  56. local llegm = Instance.new("Motor", torso)
  57. llegm.C0 = CFrame.new(-0.5, -1, 0)
  58. llegm.C1 = CFrame.new(0, 1, 0)
  59. llegm.Part0 = torso
  60. llegm.Part1 = ll
  61.  
  62. rj.C0 = CFrame.new()
  63. rj.C1 = CFrame.new()
  64.  
  65. neck.C0 = CFrame.new(0, 1, 0)
  66. neck.C1 = CFrame.new(0, -0.5, 0)
  67.  
  68. local speed = 0.3
  69. local angle = 0
  70. local anglespeed = 1
  71. rsc0 = rm.C0
  72. lsc0 = lm.C0
  73. llc0 = llegm.C0
  74. rlc0 = rlegm.C0
  75. rootc0 = rj.C0
  76. neckc0 = neck.C0
  77.  
  78. mouse.KeyDown:connect(function(k)
  79. if k == "e" then
  80. fieryhead = not fieryhead
  81. if fieryhead then
  82. coroutine.wrap(function()
  83. while fieryhead and wait() do
  84. local FireColors = {'Really red', 'Bright orange'}
  85. local p = Instance.new('Part', char)
  86. p.BrickColor = BrickColor.new(FireColors[math.random(1,#FireColors)])
  87. p.FormFactor = 'Custom'
  88. p.Size = Vector3.new(3, 3, 3)
  89. p.CanCollide = false
  90. p.Anchored = true
  91. p.Locked = true
  92. Instance.new('PointLight', p).Range = 10
  93. p.CFrame = head.CFrame * CFrame.new(0, 1, 0) * CFrame.Angles(math.random(0,3),math.random(0,3),math.random(0,3))
  94. Instance.new('BlockMesh', p)
  95. coroutine.wrap(function()
  96. for i = 1, 10 do
  97. p.Mesh.Scale = p.Mesh.Scale - Vector3.new(.1, .1, .1)
  98. p.CFrame = p.CFrame * CFrame.new(0, .35, 0)
  99. wait()
  100. end
  101. end)()
  102. game:service'Debris':AddItem(p, .55)
  103. end
  104. end)()
  105. end
  106. end
  107. if k == "r" then
  108. if Charge1Anim or Attack1Anim then return end
  109. Charge1Anim = true
  110. for i = 0, 70 do
  111. local FireColors = {'Really red', 'Bright orange'}
  112. local p = Instance.new('Part', char)
  113. p.BrickColor = BrickColor.new(FireColors[math.random(1,#FireColors)])
  114. p.FormFactor = 'Custom'
  115. p.Size = Vector3.new(.8, .8, .Cool
  116. p.CanCollide = false
  117. p.Anchored = true
  118. p.Locked = true
  119. p.CFrame = ra.CFrame * CFrame.new(0, -1, 0) * CFrame.Angles(math.random(0,3),math.random(0,3),math.random(0,3))
  120. Instance.new('BlockMesh', p)
  121. coroutine.wrap(function()
  122. for i = 1, 10 do
  123. p.Mesh.Scale = p.Mesh.Scale - Vector3.new(.1, .1, .1)
  124. p.CFrame = p.CFrame * CFrame.new(0, .15, 0)
  125. wait()
  126. end
  127. end)()
  128. game:service'Debris':AddItem(p, 2)
  129. wait()
  130. end
  131. Charge1Anim = false
  132. Attack1Anim = true
  133. wait(.35)
  134. local ray = Ray.new(ra.CFrame*CFrame.new(0,-1,0).p, ra.CFrame*CFrame.new(0, -150, 0).p)
  135. local hitz, enz = workspace:FindPartOnRay(ray, char)
  136. local humanoid = hitz and hitz.Parent and hitz.Parent:findFirstChild("Humanoid")
  137. if humanoid then
  138. humanoid:TakeDamage(80)
  139. end
  140. local humanoid = hitz and hitz.Parent and hitz.Parent.Parent and hitz.Parent.Parent:findFirstChild("Humanoid")
  141. if humanoid then
  142. humanoid:TakeDamage(80)
  143. end
  144.  
  145. --draw the ray
  146. local distance = (enz - ra.CFrame*CFrame.new(0,-1,0).p).magnitude
  147. local rayPart = Instance.new("Part", char)
  148. rayPart.BrickColor = BrickColor.new("Bright red")
  149. rayPart.Anchored = true
  150. rayPart.CanCollide = false
  151. rayPart.Locked = true
  152. rayPart.TopSurface = 0
  153. rayPart.BottomSurface = 0
  154. rayPart.formFactor = 'Custom'
  155. Instance.new('CylinderMesh', rayPart)
  156. rayPart.Size = Vector3.new(1, distance, 1)
  157. rayPart.CFrame = CFrame.new((enz + ra.CFrame*CFrame.new(0,-1,0).p)/2,enz) * CFrame.Angles(math.pi/2, 0, 0)
  158. for i = 0, 1, .1 do
  159. rayPart.Transparency = i
  160. wait()
  161. end
  162. rayPart:remove()
  163. Attack1Anim = false
  164. end
  165. if string.byte(k) == 48 then
  166. humanoid.WalkSpeed = 24
  167. end
  168. end)
  169.  
  170. mouse.KeyUp:connect(function(k)
  171. if string.byte(k) == 48 then
  172. humanoid.WalkSpeed = 16
  173. end
  174. end)
  175.  
  176. local action = 'None'
  177. plr.Chatted:connect(function(msg)
  178. if msg == '/e dance' or msg == '/emote dance' then
  179. action = 'Dance'
  180. end
  181. if msg == '/e bernie' or msg == '/emote bernie' then
  182. action = 'MovingLikeBernie'
  183. end
  184. end)
  185.  
  186. local dance_move_wait = 0
  187. print'madiik cannot be resisted kthx'
  188. game:service'RunService'.RenderStepped:connect(function()
  189. rm.MaxVelocity = 0
  190. lm.MaxVelocity = 0
  191. rm.DesiredAngle = 0
  192. rm.CurrentAngle = 0
  193. lm.DesiredAngle = 0
  194. lm.CurrentAngle = 0
  195. angle = (angle % 100) + anglespeed/10
  196. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  197. local rscf = rsc0
  198. local lscf = lsc0
  199. local rlcf = rlc0
  200. local llcf = llc0
  201. local rjcf = rootc0
  202. local ncf = neckc0
  203. local ray = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
  204. local hitz, enz = workspace:FindPartOnRay(ray, char)
  205. for i,object in pairs(char:children()) do
  206. if object:IsA("Tool") then
  207. tool = true
  208. if not debounce then
  209. for x,value in pairs(object:children()) do
  210. if value:IsA("StringValue") and value.Name == "toolanim" and value.Value == "Slash" then
  211. debounce = true
  212. coroutine.wrap(function()
  213. slashing = true
  214. wait(.15)
  215. slashing = false
  216. debounce = false
  217. end)()
  218. value:Destroy()
  219. end
  220. end
  221. end
  222. elseif not object:IsA'Tool' then
  223. tool = false
  224. end
  225. end
  226. if action == 'Dance' then
  227. anglespeed = 2
  228. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  229. rjcf = rootc0 * CFrame.Angles(math.rad(2), math.sin(angle)*.15, 0)
  230. lscf = lsc0 * CFrame.new(0, .5 + math.sin(angle)*0.025, 0) * CFrame.Angles(math.pi/1.2-math.cos(angle)*0.4, math.sin(angle)*0.1, -.15 - -math.sin(angle)*0.4)
  231. rscf = rsc0 * CFrame.new(0, .5 + math.sin(angle)*0.025, 0) * CFrame.Angles(math.pi/1.2+math.cos(angle)*0.4, math.sin(-angle)*0.1, .15 + -math.sin(angle)*0.4)
  232. rlcf = rlc0 * CFrame.new(0, .3 + math.cos(angle)*.3, -.1) * CFrame.Angles(-math.rad(2), 0, 0)
  233. llcf = llc0 * CFrame.new(0, .3 - math.cos(angle)*.3, -.1) * CFrame.Angles(-math.rad(2), 0, 0)
  234. ncf = neckc0 * CFrame.Angles(0, math.sin(angle)*.4, 0)
  235. else
  236. action = 'None'
  237. end
  238. elseif action == 'MovingLikeBernie' then
  239. anglespeed = 1+math.random()
  240. dance_move_wait = (dance_move_wait%40) + 1/60
  241. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  242. if dance_move_wait <= 20 then
  243. rjcf = rootc0 * CFrame.new(0, -.2, .6) * CFrame.Angles(math.rad(25)-math.sin(angle)*0.025, math.cos(angle)*.15, 0)
  244. lscf = lsc0 * CFrame.new(0, math.sin(angle)*0.025, 0) * CFrame.Angles(-math.pi/6 + -math.cos(angle)*0.4, math.sin(angle)*0.1, -.15 - -math.sin(angle)*0.4)
  245. rscf = rsc0 * CFrame.new(0, math.sin(angle)*0.025, 0) * CFrame.Angles(-math.pi/6 + math.cos(angle)*0.4, math.sin(-angle)*0.1, .15 + -math.sin(angle)*0.4)
  246. rlcf = rlc0 * CFrame.new(0, 0, -.1) * CFrame.Angles(-math.rad(25)+math.sin(angle)*0.025, -math.cos(angle)*.15, .1)
  247. llcf = llc0 * CFrame.new(0, 0, -.1) * CFrame.Angles(-math.rad(25)+math.sin(angle)*0.025, -math.cos(angle)*.15, -.1)
  248. ncf = neckc0 * CFrame.Angles(0, math.sin(angle)*.4, 0)
  249. elseif dance_move_wait > 20 then
  250. rjcf = rootc0 * CFrame.new(0, -.2, -.6) * CFrame.Angles(-math.rad(25)-math.sin(angle)*0.025, math.cos(angle)*.15, 0)
  251. lscf = lsc0 * CFrame.new(0, math.sin(angle)*0.025, 0) * CFrame.Angles(math.pi/6 + math.cos(angle)*0.4, math.sin(angle)*0.1, -.15 - -math.sin(angle)*0.4)
  252. rscf = rsc0 * CFrame.new(0, math.sin(angle)*0.025, 0) * CFrame.Angles(math.pi/6 + -math.cos(angle)*0.4, math.sin(-angle)*0.1, .15 + -math.sin(angle)*0.4)
  253. rlcf = rlc0 * CFrame.new(0, 0, -.1) * CFrame.Angles(math.rad(25)-math.sin(angle)*0.025, -math.cos(angle)*.15, .1)
  254. llcf = llc0 * CFrame.new(0, 0, -.1) * CFrame.Angles(math.rad(25)-math.sin(angle)*0.025, -math.cos(angle)*.15, -.1)
  255. ncf = neckc0 * CFrame.Angles(0, math.sin(angle)*.4, 0)
  256. end
  257. else
  258. action = 'None'
  259. end
  260. elseif not hitz and (torso.Velocity.y > 1 or torso.Velocity.y < -1) then
  261. anglespeed = 3
  262. rjcf = rootc0 * CFrame.Angles(math.rad(5), 0, 0)
  263. rscf = rsc0 * CFrame.Angles(math.rad(130) + math.sin(angle)*.8, 0, .15)
  264. lscf = lsc0 * CFrame.Angles(math.rad(130) + -math.sin(angle)*.8, 0, -.15)
  265. rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(angle)*.3, -.3 + -math.cos(angle)*.3) * CFrame.Angles(math.pi/14 + -math.sin(angle)*1, 0, 0)
  266. llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.3 - -math.cos(angle)*.3) * CFrame.Angles(math.pi/14 + math.sin(angle)*1, 0, 0)
  267. ncf = neckc0 * CFrame.Angles(0, math.sin(angle)*.8, 0)
  268. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  269. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  270. anglespeed = 2
  271. rjcf = rootc0 * CFrame.new(0, math.abs(math.sin(angle))*.65, 0) * CFrame.Angles(math.rad(10)+math.rad(torso.Velocity.y)*2, 0, 0)
  272. rscf = rsc0 * CFrame.Angles(math.sin(angle)*1.7, 0, .05)
  273. lscf = lsc0 * CFrame.Angles(-math.sin(angle)*1.7, 0, -.05)
  274. rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*1.4, 0, 0)
  275. llcf = llc0 * CFrame.Angles(math.sin(angle)*1.4, 0, 0)
  276. ncf = neckc0 * CFrame.Angles(-math.rad(30) + math.abs(math.sin(angle))*.95, math.sin(angle)*.8, 0)
  277. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 20 then
  278. anglespeed = 2.5
  279. rjcf = rootc0 * CFrame.new(0, -.3 + math.abs(math.sin(angle))*.65, 0) * CFrame.Angles(-math.rad(10)+math.rad(torso.Velocity.y)*2, 0, 0)
  280. rscf = rsc0 * CFrame.new(0, math.cos(angle)*.5, math.sin(angle)*.5) * CFrame.Angles(math.cos(angle)*2.8, 0, math.abs(math.sin(angle))*.5)
  281. lscf = lsc0 * CFrame.new(0, -math.cos(angle)*.5, -math.sin(angle)*.5) * CFrame.Angles(-math.cos(angle)*2.8, 0, -math.abs(math.sin(angle))*.5)
  282. rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(-angle)*.3, -.2+math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.4, 0, math.rad(.5))
  283. llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.05-math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.4, 0, -math.rad(.5))
  284. ncf = neckc0 * CFrame.Angles(math.cos(angle), math.sin(angle), 0)
  285. end
  286. if Charge1Anim then
  287. rscf = rsc0 * CFrame.new(-.75, 0, .75) * CFrame.Angles(math.pi/4, 0, math.pi/4)
  288. lscf = lsc0 * CFrame.new(.95, 0, -.45) * CFrame.Angles(math.pi/4, 0, math.pi/3)
  289. end
  290. if Attack1Anim then
  291. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  292. lscf = lsc0 * CFrame.Angles(-math.pi/8, 0, 0)
  293. end
  294. if tool then
  295. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  296. if slashing then
  297. rscf = rsc0 * CFrame.Angles(-math.pi/12, 0, -.1)
  298. end
  299. end
  300. rm.C0 = clerp(rm.C0,rscf,speed)
  301. lm.C0 = clerp(lm.C0,lscf,speed)
  302. rj.C0 = clerp(rj.C0,rjcf,speed)
  303. neck.C0 = clerp(neck.C0,ncf,speed)
  304. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  305. llegm.C0 = clerp(llegm.C0,llcf,speed)
  306. end)
  307. avatar
  308. PabloRV
  309.  
  310. Posts : 5
  311. Join date : 2014-07-23
  312.  
  313. View user profile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement