Advertisement
Bendy928443534

Untitled

Jul 24th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.13 KB | None | 0 0
  1. local Player = game:GetService("Players").ChristainVsRoblocks --<=== Replace With Your Name
  2.  
  3.  
  4. local Mouse,mouse,UserInputService,ContextActionService
  5. do
  6. script.Parent = Player.Character
  7. local CAS = {Actions={}}
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10. Event.Parent = Player.Character
  11. local fakeEvent = function()
  12. local t = {_fakeEvent=true}
  13. t.Connect = function(self,f)self.Function=f end
  14. t.connect = t.Connect
  15. return t
  16. end
  17. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  18. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  19. function CAS:BindAction(name,fun,touch,...)
  20. CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  21. end
  22. function CAS:UnbindAction(name)
  23. CAS.Actions[name] = nil
  24. end
  25. local function te(self,ev,...)
  26. local t = m[ev]
  27. if t and t._fakeEvent and t.Function then
  28. t.Function(...)
  29. end
  30. end
  31. m.TrigEvent = te
  32. UIS.TrigEvent = te
  33. Event.OnServerEvent:Connect(function(plr,io)
  34. if plr~=Player then return end
  35. if io.isMouse then
  36. m.Target = io.Target
  37. m.Hit = io.Hit
  38. elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  39. if io.UserInputState == Enum.UserInputState.Begin then
  40. m:TrigEvent("Button1Down")
  41. else
  42. m:TrigEvent("Button1Up")
  43. end
  44. else
  45. for n,t in pairs(CAS.Actions) do
  46. for _,k in pairs(t.Keys) do
  47. if k==io.KeyCode then
  48. t.Function(t.Name,io.UserInputState,io)
  49. end
  50. end
  51. end
  52. if io.UserInputState == Enum.UserInputState.Begin then
  53. m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
  54. UIS:TrigEvent("InputBegan",io,false)
  55. else
  56. m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
  57. UIS:TrigEvent("InputEnded",io,false)
  58. end
  59. end
  60. end)
  61. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  62. end
  63.  
  64. wait(1)
  65. local Player, Character = game:service("Players").ChristainVsRoblocks, game:GetService("Players").ChristainVsRoblocks.Character;
  66. local Torso = Character:FindFirstChild("Torso")
  67. local rootPart = Character:FindFirstChild("HumanoidRootPart")
  68. local Humanoid = Character:FindFirstChild("Humanoid")
  69. local Head = Character:FindFirstChild("Head")
  70. local Right_Arm = Character:FindFirstChild("Right Arm")
  71. local Left_Arm = Character:FindFirstChild("Left Arm")
  72. local Right_Leg = Character:FindFirstChild("Right Leg")
  73. local Left_Leg = Character:FindFirstChild("Left Leg")
  74. local Right_Shoulder = Torso:FindFirstChild("Right Shoulder")
  75. local Left_Shoulder = Torso:FindFirstChild("Left Shoulder")
  76. local Right_Hip = Torso:FindFirstChild("Right Hip")
  77. local Left_Hip = Torso:FindFirstChild("Left Hip")
  78. local Neck = Torso:FindFirstChild("Neck")
  79. local rootPart = Character:FindFirstChild("HumanoidRootPart")
  80. local rootJoint = rootPart:FindFirstChild("RootJoint")
  81. local CurrentIdle = "Idling1"
  82. local Degree = 0.0175438596491228
  83. local canremove = false
  84. local debounce = false
  85. local UIService=game:GetService'UserInputService'
  86.  
  87. Chase = "rbxassetid://884552387"
  88. Amb = "rbxassetid://290269649"
  89. ChasePitch = 1
  90. AmbPitch = 0.35
  91.  
  92.  
  93. sin = math.sin
  94. Right_Leg.FormFactor = "Custom";
  95. Left_Leg.FormFactor = "Custom";
  96. rootPart.Archivable = true;
  97. rootJoint.Archivable = true;
  98. c_new = CFrame.new;
  99. c_angles = CFrame.Angles;
  100. i_new = Instance.new
  101. Humanoid:ClearAllChildren();
  102. local isAttacking = false
  103. local isSprinting = false
  104. local Animations = false
  105. local Angle = 0
  106. local Axis = 0
  107. local angleSpeed = 1
  108. local axisSpeed = angleSpeed
  109. local currentAnim
  110. local levetatingheight = 3
  111. local WalkType = "Ground"
  112.  
  113. Humanoid.DisplayDistanceType = "None"
  114. Humanoid.WalkSpeed = 5
  115. Humanoid.MaxHealth = "inf"
  116. Humanoid.Health = "inf"
  117. coroutine.wrap(function()
  118. while true and wait() do
  119. Humanoid.MaxHealth = "inf"
  120. Humanoid.Health = "inf"
  121. end
  122. end)()
  123.  
  124. local Hair = Instance.new("Part",Head)
  125. Hair.Name = "Hair"
  126. Hair.Shape = Enum.PartType.Ball
  127. Hair.CanCollide = false
  128. Hair.BrickColor = BrickColor.new("Really black")
  129. Hair.Transparency = 0
  130. Hair.Material = "Grass"
  131. Hair.Size = Vector3.new(0.1, 0.1, 0.1)
  132. Hair.TopSurface = Enum.SurfaceType.Smooth
  133. Hair.BottomSurface = Enum.SurfaceType.Smooth
  134. local Weld = Instance.new("Weld", Hair)
  135. Weld.Part0 = Head
  136. Weld.Part1 = Hair
  137. Weld.C1 = CFrame.new(0,0.5,-0.1)
  138. HairMesh = Instance.new("FileMesh",Hair)
  139. HairMesh.MeshId = "http://www.roblox.com/asset/?id=243790019"
  140. HairMesh.TextureId = "http://www.roblox.com/asset/?id=7561048"
  141. HairMesh.Scale = Vector3.new(1,1,1)
  142.  
  143. coroutine.wrap(function()
  144. while true and wait() do
  145. Humanoid:SetStateEnabled("Dead",false)
  146. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
  147. Humanoid.DisplayDistanceType = "None"
  148. end
  149. end)()
  150.  
  151. function Sound(parent,loop,vol,id)
  152. local s = Instance.new('Sound',parent)
  153. s.Looped = loop
  154. s.Volume = vol
  155. s.MaxDistance=200
  156. s.EmitterSize=20
  157. s.SoundId = 'rbxassetid://'..tostring(id)
  158. s:Play()
  159. if loop == false then
  160. wait(s.TimeLength)
  161. s:Destroy()
  162. end
  163. end
  164.  
  165. Song = Instance.new("Sound",Character)
  166. Song.SoundId = Amb
  167. Song.Looped = true
  168. Song.Pitch = AmbPitch
  169. Song.Volume = 2
  170. Song.Playing = true
  171.  
  172. newWeld = function(wp0, wp1, wc0x, wc0y, wc0z)
  173. wld = Instance.new("Weld", wp1)
  174. wld.Part0 = wp0
  175. wld.Part1 = wp1
  176. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  177. return wld
  178. end
  179.  
  180. function noOutline(part)
  181. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  182. end
  183.  
  184. local function Part(Name,Color, Material, Transparency,Shape, Size, CFrame,CanCollide,Anchored,parent)
  185. local partie = i_new("Part",parent)
  186. partie.Name=Name
  187. partie.BrickColor = BrickColor.new(Color)
  188. partie.Material = Material
  189. partie.Shape = Shape
  190. partie.Transparency = Transparency
  191. partie.Size = Size
  192. partie.CFrame = CFrame
  193. partie.CanCollide = CanCollide
  194. partie.Anchored = Anchored
  195. return partie
  196. end
  197.  
  198. --//=================================\\
  199. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  200. --\\=================================//
  201. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  202.  
  203. ArtificialHB = Instance.new("BindableEvent", script)
  204. ArtificialHB.Name = "ArtificialHB"
  205.  
  206. script:WaitForChild("ArtificialHB")
  207.  
  208. frame = Frame_Speed
  209. tf = 0
  210. allowframeloss = false
  211. tossremainder = false
  212. lastframe = tick()
  213. script.ArtificialHB:Fire()
  214.  
  215. game:GetService("RunService").Heartbeat:connect(function(s, p)
  216. tf = tf + s
  217. if tf >= frame then
  218. if allowframeloss then
  219. script.ArtificialHB:Fire()
  220. lastframe = tick()
  221. else
  222. for i = 1, math.floor(tf / frame) do
  223. script.ArtificialHB:Fire()
  224. end
  225. lastframe = tick()
  226. end
  227. if tossremainder then
  228. tf = 0
  229. else
  230. tf = tf - frame * math.floor(tf / frame)
  231. end
  232. end
  233. end)
  234.  
  235. --//=================================\\
  236. --\\=================================//
  237.  
  238. function swait(num)
  239. if num == 0 or num == nil then
  240. ArtificialHB.Event:wait()
  241. else
  242. for i = 0, num do
  243. ArtificialHB.Event:wait()
  244. end
  245. end
  246. end
  247.  
  248. function mesh(Mesh, part, meshtype, meshid, offset, scale)
  249. local mesh = i_new(Mesh)
  250. mesh.Parent = part
  251. if Mesh == "SpecialMesh" then
  252. mesh.MeshType = meshtype
  253. mesh.MeshId = meshid
  254. end
  255. mesh.Offset = offset
  256. mesh.Scale = scale
  257. return mesh
  258. end
  259. --Moves--
  260.  
  261.  
  262. invisible = false
  263. --Moves--
  264. function findCloseHumanoid(centre, distance)
  265. local tab = {}
  266. for _, child in pairs(game.Workspace:GetChildren()) do
  267. if child:findFirstChild("Humanoid") and child:findFirstChild("Humanoid") ~= Humanoid and child:findFirstChild("Torso") then
  268. local vtors = child.Torso
  269. local mag = math.abs((vtors.Position - centre).magnitude)
  270. if distance >= mag then
  271. table.insert(tab, child.Humanoid)
  272. end
  273. end
  274. end
  275. return tab
  276. end
  277.  
  278.  
  279. function onTouch(part)
  280.  
  281. local humanoid = part.Parent:findFirstChild("Humanoid")
  282. local model = part.Parent
  283. local torso = part.Parent:findFirstChild("Torso")
  284. local head = part.Parent:findFirstChild("Head")
  285. local leftleg = part.Parent:findFirstChild("Left Leg")
  286. local rightleg = part.Parent:findFirstChild("Right Leg")
  287. local leftarm = part.Parent:findFirstChild("Left Arm")
  288. local rightarm = part.Parent:findFirstChild("Right Arm")
  289. if humanoid.Health <= 0 then
  290. return
  291. end
  292.  
  293. if sprint == false then
  294. return
  295. end
  296.  
  297. if invisible == true then
  298. return
  299. end
  300.  
  301. for i, v in pairs(findCloseHumanoid(Torso.Position, 10)) do
  302. humanoid.Health = 0
  303. head.BrickColor = BrickColor.new("Really black")
  304. torso.BrickColor = BrickColor.new("Really black")
  305. leftleg.BrickColor = BrickColor.new("Really black")
  306. rightleg.BrickColor = BrickColor.new("Really black")
  307. rightarm.BrickColor = BrickColor.new("Really black")
  308. leftarm.BrickColor = BrickColor.new("Really black")
  309. torso.Anchored = true
  310.  
  311. e=Instance.new('Part', model)
  312. e.Size = Vector3.new(2.25,2.25,2.25)
  313. e.Transparency = 1
  314. e.Anchored = true
  315. e.CFrame = CFrame.new(head.Position)
  316.  
  317.  
  318. q=Instance.new('ParticleEmitter', e)
  319. q.Rate = 500
  320. q.Speed = NumberRange.new(7)
  321. q.VelocitySpread = 40
  322. q.Lifetime = NumberRange.new(0.1,1)
  323. q.Texture = 'rbxassetid://164417280'
  324. q.Acceleration = Vector3.new(0,-50,0)
  325. q.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.5, 0.1), NumberSequenceKeypoint.new(1, 0.01, 0.01)})
  326. q.RotSpeed = NumberRange.new(-180, 180)
  327. q.Rotation = NumberRange.new(-360, 360)
  328. q.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.2, 0), NumberSequenceKeypoint.new(0.8, 0), NumberSequenceKeypoint.new(1, 1)})
  329.  
  330. S = Instance.new("Sound")
  331. S.Parent = Character.Torso
  332. S.SoundId = "rbxassetid://337667089"
  333. S.Volume = 10
  334. S.Looped = false
  335. S.Pitch = 1
  336. S:Play()
  337. end
  338.  
  339. end
  340.  
  341.  
  342.  
  343. Character.Torso.Touched:connect(onTouch)
  344.  
  345. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position, Direction, MaxDistance, IgnoreDescendants
  346. return game:GetService("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  347. end
  348.  
  349. function QuaternionFromCFrame(cf)
  350. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  351. local trace = m00 + m11 + m22
  352. if trace > 0 then
  353. local s = math.sqrt(1 + trace)
  354. local recip = 0.5/s
  355. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  356. else
  357. local i = 0
  358. if m11 > m00 then
  359. i = 1
  360. end
  361. if m22 > (i == 0 and m00 or m11) then
  362. i = 2
  363. end
  364. if i == 0 then
  365. local s = math.sqrt(m00-m11-m22+1)
  366. local recip = 0.5/s
  367. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  368. elseif i == 1 then
  369. local s = math.sqrt(m11-m22-m00+1)
  370. local recip = 0.5/s
  371. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  372. elseif i == 2 then
  373. local s = math.sqrt(m22-m00-m11+1)
  374. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  375. end
  376. end
  377. end
  378.  
  379. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  380. local xs, ys, zs = x + x, y + y, z + z
  381. local wx, wy, wz = w*xs, w*ys, w*zs
  382. local xx = x*xs
  383. local xy = x*ys
  384. local xz = x*zs
  385. local yy = y*ys
  386. local yz = y*zs
  387. local zz = z*zs
  388. 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))
  389. end
  390.  
  391. function QuaternionSlerp(a, b, t)
  392. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  393. local startInterp, finishInterp;
  394. if cosTheta >= 0.0001 then
  395. if (1 - cosTheta) > 0.0001 then
  396. local theta = math.acos(cosTheta)
  397. local invSinTheta = 1/math.sin(theta)
  398. startInterp = math.sin((1-t)*theta)*invSinTheta
  399. finishInterp = math.sin(t*theta)*invSinTheta
  400. else
  401. startInterp = 1-t
  402. finishInterp = t
  403. end
  404. else
  405. if (1+cosTheta) > 0.0001 then
  406. local theta = math.acos(-cosTheta)
  407. local invSinTheta = 1/math.sin(theta)
  408. startInterp = math.sin((t-1)*theta)*invSinTheta
  409. finishInterp = math.sin(t*theta)*invSinTheta
  410. else
  411. startInterp = t-1
  412. finishInterp = t
  413. end
  414. end
  415. 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
  416. end
  417.  
  418. function clerp(a, b, t)
  419. local qa = {QuaternionFromCFrame(a)}
  420. local qb = {QuaternionFromCFrame(b)}
  421. local ax, ay, az = a.x, a.y, a.z
  422. local bx, by, bz = b.x, b.y, b.z
  423. local _t = 1-t
  424. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  425. end
  426.  
  427. swait()
  428. LA_Weld = newWeld(Torso, Left_Arm, -1.5, 0.5, 0)
  429. Left_Arm.Weld.C1 = CFrame.new(0, 0.5, 0)
  430. RA_Weld = newWeld(Torso, Right_Arm, 1.5, 0.5, 0)
  431. Right_Arm.Weld.C1 = CFrame.new(0, 0.5, 0)
  432. LL_Weld = newWeld(Torso, Left_Leg, -0.5, -1, 0)
  433. Left_Leg.Weld.C1 = CFrame.new(0, 1, 0) -- Left_Leg.Weld.C1 = CFrame.new(0, 1, 0.15)
  434. RL_Weld = newWeld(Torso, Right_Leg, 0.5, -1, 0)
  435. Right_Leg.Weld.C1 = CFrame.new(0, 1, 0) -- Right_Leg.Weld.C1 = CFrame.new(0, 1, 0.15)
  436. Torso_Weld = newWeld(rootPart, Torso, 0, -1, 0)
  437. Torso.Weld.C1 = CFrame.new(0, -1, 0)
  438. Head_Weld = newWeld(Torso, Head, 0, 1.5, 0)
  439.  
  440. for i,v in pairs(Character:GetChildren()) do
  441. if v:IsA('Accoutrement') or v:IsA('Shirt') or v:IsA('Pants') then
  442. v:Destroy()
  443. elseif v:IsA('Part') and v.Name=='Head' then
  444. v.face:Destroy()
  445. end
  446. end
  447.  
  448. Character['Body Colors'].HeadColor=BrickColor.new('Really black')
  449. Character['Body Colors'].TorsoColor=BrickColor.new('Really black')
  450. Character['Body Colors'].RightArmColor=BrickColor.new('Really black')
  451. Character['Body Colors'].LeftArmColor=BrickColor.new('Really black')
  452. Character['Body Colors'].RightLegColor=BrickColor.new('Really black')
  453. Character['Body Colors'].LeftLegColor=BrickColor.new('Really black')
  454.  
  455. Humanoid.DisplayDistanceType='None'
  456.  
  457. --Part(Name,Color, Material, Transparency,Shape, Size, CFrame,CanCollide,Anchored,parent)
  458. --newWeld(wp0, wp1, wc0x, wc0y, wc0z)
  459. local LEye=Part('LEye','New Yeller','Neon',0,'Ball',Vector3.new(.1,.1,.1),CFrame.new(0,0,0),false,false,Character)
  460. Mesh = Instance.new("SpecialMesh",LEye)
  461. Mesh.MeshType = "Sphere"
  462. Mesh.Scale = Vector3.new(1,1,1)
  463. Mesh.Offset = Vector3.new(-0.3,0.1,-0.55)
  464. newWeld(Head,LEye,0,0,0)
  465. local LEGlow=Instance.new('SurfaceLight')
  466. LEGlow.Color=Color3.fromRGB(255,0,0)
  467. LEGlow.Range=6
  468. LEGlow.Brightness=10
  469. LEGlow.Parent=LEye
  470.  
  471.  
  472. local BodMesh = Instance.new("CharacterMesh", Character)
  473. BodMesh.BodyPart = "Torso"
  474. wait()
  475. BodMesh.MeshId = "27111894"
  476. local BodMesh = Instance.new("CharacterMesh", Character)
  477. BodMesh.BodyPart = "RightArm"
  478. wait()
  479. BodMesh.MeshId = "98332573"
  480. BodMesh.OverlayTextureId = "136169861"
  481. local BodMesh = Instance.new("CharacterMesh", Character)
  482. BodMesh.BodyPart = "LeftArm"
  483. wait()
  484. BodMesh.MeshId = "98332476"
  485. BodMesh.OverlayTextureId = "136169861"
  486. local BodMesh = Instance.new("CharacterMesh", Character)
  487. BodMesh.BodyPart = "RightLeg"
  488. wait()
  489. BodMesh.MeshId = "27111882"
  490. local BodMesh = Instance.new("CharacterMesh", Character)
  491. BodMesh.BodyPart = "LeftLeg"
  492. wait()
  493. BodMesh.MeshId = "27111857"
  494.  
  495. pants = Instance.new("Pants",Character)
  496. wait()
  497. pants.PantsTemplate = "rbxassetid://192706483"
  498.  
  499. sine = 0
  500. change = 1
  501. sprint=false
  502. local punches={
  503. a=false,
  504. b=false,
  505. c=false
  506. }
  507.  
  508. mouse.KeyDown:Connect(function()
  509. if punches.a==false then
  510. punches.a=true wait(.4) punches.a=false
  511. else
  512. punches.a=true
  513. print('a ',punches.a)
  514. if punches.b==false then
  515. punches.b=true wait(.4) punches.b=false
  516. else
  517. punches.b=true
  518. print('b ',punches.b)
  519. if punches.c==false then
  520. punches.c=true wait(.4) punches.c=false
  521. else
  522. punches.c=true
  523. print('c ',punches.c)
  524. print('a ',punches.a,'b ',punches.b,'c ',punches.c)
  525. end
  526. end
  527. end
  528. end)
  529. mouse.KeyDown:Connect(function(k)
  530. if k == "leftshift" then
  531. sprint=true
  532. if Song.SoundId == Chase then
  533. return
  534. end
  535. if invisible == false and sprint == true then
  536. for i = 1,10 do
  537. Song.Volume = Song.Volume - 0.1
  538. swait()
  539. end
  540. Song.SoundId = Chase
  541. Song.Pitch = ChasePitch
  542. Song:Play()
  543. for i = 1,20 do
  544. Song.Volume = Song.Volume + 0.1
  545. swait()
  546. end
  547. else if invisible == true and sprint == true then
  548. if Song.SoundId == Amb then
  549. return
  550. end
  551. for i = 1,20 do
  552. Song.Volume = Song.Volume - 0.1
  553. swait()
  554. end
  555. Song.SoundId = Amb
  556. Song.Pitch = AmbPitch
  557. Song:Play()
  558. for i = 1,10 do
  559. Song.Volume = Song.Volume + 0.1
  560. swait()
  561. end
  562. end
  563. end
  564. end
  565. if k == "x" then
  566. if invisible == false then
  567. invisible = true
  568. Hair.Transparency = 0.2
  569. Head.Transparency = 0.2
  570. Left_Arm.Transparency = 0.2
  571. Right_Arm.Transparency = 0.2
  572. Torso.Transparency = 0.2
  573. Left_Leg.Transparency = 0.2
  574. Right_Leg.Transparency = 0.2
  575. wait()
  576. Hair.Transparency = 0.4
  577. Head.Transparency = 0.4
  578. Left_Arm.Transparency = 0.4
  579. Right_Arm.Transparency = 0.4
  580. Torso.Transparency = 0.4
  581. Left_Leg.Transparency = 0.4
  582. Right_Leg.Transparency = 0.4
  583. wait()
  584. Hair.Transparency = 0.6
  585. Head.Transparency = 0.6
  586. Left_Arm.Transparency = 0.6
  587. Right_Arm.Transparency = 0.6
  588. Torso.Transparency = 0.6
  589. Left_Leg.Transparency = 0.6
  590. Right_Leg.Transparency = 0.6
  591. wait()
  592. Hair.Transparency = 0.8
  593. Head.Transparency = 0.8
  594. Left_Arm.Transparency = 0.8
  595. Right_Arm.Transparency = 0.8
  596. Torso.Transparency = 0.8
  597. Left_Leg.Transparency = 0.8
  598. Right_Leg.Transparency = 0.8
  599. wait()
  600. Hair.Transparency = 1
  601. Head.Transparency = 1
  602. Left_Arm.Transparency = 1
  603. Right_Arm.Transparency = 1
  604. Torso.Transparency = 1
  605. Left_Leg.Transparency = 1
  606. Right_Leg.Transparency = 1
  607. if sprint==true and Song.SoundId == Chase and invisible == true then
  608. Song.SoundId = Amb
  609. Song.Pitch = AmbPitch
  610. Song:Play()
  611. end
  612. if sprint==true and Song.SoundId == Amb and invisible == false then
  613. Song.SoundId = Chase
  614. Song.Pitch = ChasePitch
  615. Song:Play()
  616. end
  617. elseif invisible == true then
  618. invisible = false
  619. Hair.Transparency = 0.8
  620. Head.Transparency = 0.8
  621. Left_Arm.Transparency = 0.8
  622. Right_Arm.Transparency = 0.8
  623. Torso.Transparency = 0.8
  624. Left_Leg.Transparency = 0.8
  625. Right_Leg.Transparency = 0.8
  626. wait()
  627. Hair.Transparency = 0.6
  628. Head.Transparency = 0.6
  629. Left_Arm.Transparency = 0.6
  630. Right_Arm.Transparency = 0.6
  631. Torso.Transparency = 0.6
  632. Left_Leg.Transparency = 0.6
  633. Right_Leg.Transparency = 0.6
  634. wait()
  635. Hair.Transparency = 0.4
  636. Head.Transparency = 0.4
  637. Left_Arm.Transparency = 0.4
  638. Right_Arm.Transparency = 0.4
  639. Torso.Transparency = 0.4
  640. Left_Leg.Transparency = 0.4
  641. Right_Leg.Transparency = 0.4
  642. wait()
  643. Hair.Transparency = 0.2
  644. Head.Transparency = 0.2
  645. Left_Arm.Transparency = 0.2
  646. Right_Arm.Transparency = 0.2
  647. Torso.Transparency = 0.2
  648. Left_Leg.Transparency = 0.2
  649. Right_Leg.Transparency = 0.2
  650. wait()
  651. Hair.Transparency = 0
  652. Head.Transparency = 0
  653. Left_Arm.Transparency = 0
  654. Right_Arm.Transparency = 0
  655. Torso.Transparency = 0
  656. Left_Leg.Transparency = 0
  657. Right_Leg.Transparency = 0
  658. if sprint==true and Song.SoundId == Chase and invisible == true then
  659. Song.SoundId = Amb
  660. Song.Pitch = AmbPitch
  661. Song:Play()
  662. end
  663. if sprint==true and Song.SoundId == Amb and invisible == false then
  664. Song.SoundId = Chase
  665. Song.Pitch = ChasePitch
  666. Song:Play()
  667. end
  668. end
  669. end
  670. end)
  671.  
  672. mouse.KeyUp:Connect(function(k)
  673. if k == "leftshift" then
  674. sprint=false
  675. if Song.SoundId == Amb then
  676. return
  677. end
  678. if invisible == false and sprint == false then
  679. for i = 1,20 do
  680. Song.Volume = Song.Volume - 0.1
  681. swait()
  682. end
  683. Song.SoundId = Amb
  684. Song.Pitch = AmbPitch
  685. Song:Play()
  686. for i = 1,10 do
  687. Song.Volume = Song.Volume + 0.1
  688. swait()
  689. end
  690. elseif invisible == true and sprint == false then
  691. if Song.SoundId == Amb then
  692. return
  693. end
  694. for i = 1,20 do
  695. Song.Volume = Song.Volume - 0.1
  696. swait()
  697. end
  698. Song.SoundId = Amb
  699. Song.Pitch = AmbPitch
  700. Song:Play()
  701. for i = 1,10 do
  702. Song.Volume = Song.Volume + 0.1
  703. swait()
  704. end
  705. end
  706. end
  707. end)
  708.  
  709. ArtificialHB.Event:connect(function()
  710. Angle = (Angle % 100) + angleSpeed/10
  711. Axis = (Axis % 100) + axisSpeed/10
  712. walkingMagnitude = Vector3.new(rootPart.Velocity.X, 0, rootPart.Velocity.Z).magnitude
  713. jumpVel = Torso.Velocity.Y
  714. sine = change + sine
  715.  
  716. if(Humanoid.Jump) and jumpVel > 1 then
  717. currentAnim = "Jumping"
  718. elseif walkingMagnitude < 2 then
  719. currentAnim = "Idle"
  720. elseif isSprinting == true then
  721. currentAnim = "Sprinting"
  722. elseif walkingMagnitude > 2 then
  723. currentAnim = "Walking"
  724. elseif isAttacking == true then
  725. currentAnim = "Attacking"
  726. end
  727.  
  728. if currentAnim == "Jumping" and Animations == false then
  729. angleSpeed = 2
  730. axisSpeed = 2
  731. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  732. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  733. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  734. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  735. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  736. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  737. elseif currentAnim == "Idle" and Animations == false then
  738. angleSpeed = 1
  739. axisSpeed = 1
  740. change = 0.3
  741. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.2, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(45) - math.sin(sine/10)/10), 0.15)
  742. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.2, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(-45) + math.sin(sine/10)/10), 0.15)
  743. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -0.7 - math.sin(sine/10)/10, 0.1 - math.sin(sine/10)/10) * c_angles(math.rad(-20) - math.sin(sine/10)/10,math.rad(0), math.sin((rootPart.RotVelocity.Y/10))/2, -math.sin((rootPart.RotVelocity.Y/10))/2), 0.15)
  744. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -0.7 - math.sin(sine/10)/10, -0.2) * c_angles(math.rad(0), -math.sin((rootPart.RotVelocity.Y/10))/2, math.sin((-rootPart.RotVelocity.Y/10))/2), 0.15)
  745. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1.35 + math.sin(sine/10)/5, 0) * c_angles(math.rad(0), math.rad(0), math.sin((rootPart.RotVelocity.Y/30))/2), 0.15)
  746. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, -0.5 - math.sin(sine/10)/10) * c_angles(math.rad(-20) - math.sin(sine/10)/10, math.sin((rootPart.RotVelocity.Y/2.5))/2, math.rad(0)), 0.15)
  747. elseif currentAnim == "Walking" and Animations == false then
  748. if sprint==false then
  749. angleSpeed = 1
  750. axisSpeed = 1
  751. change = 0.3
  752. Humanoid.WalkSpeed = 5
  753. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.2, 0.4, 0) * c_angles(math.rad(0), math.rad(0), math.rad(20) - math.sin(sine/10)/10), 0.15)
  754. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.2, 0.4, 0) * c_angles(math.rad(0), math.rad(0), math.rad(-20) + math.sin(sine/10)/10), 0.15)
  755. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1 - math.sin(sine/10)/10, 0 + (-math.sin(sine/4)/5)) * c_angles(math.sin(sine/4)/5, math.sin((rootPart.RotVelocity.Y/10))/2, -math.sin((rootPart.RotVelocity.Y/10))/2), 0.15)
  756. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1 - math.sin(sine/10)/10, 0 + math.sin(sine/4)/5) * c_angles(-math.sin(sine/4)/5, -math.sin((rootPart.RotVelocity.Y/10))/2, math.sin((-rootPart.RotVelocity.Y/10))/2), 0.15)
  757. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1 + math.sin(sine/10)/5, 0) * c_angles(math.rad(0), math.rad(0), math.sin((rootPart.RotVelocity.Y/30))/2), 0.15)
  758. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, -0.3 - math.sin(sine/10)/10) * c_angles(math.rad(0) - math.sin(sine/10)/10, math.sin((rootPart.RotVelocity.Y/2.5))/2, math.rad(0)), 0.15)
  759. else
  760. angleSpeed = 10
  761. axisSpeed = 10
  762. change = 0.5
  763. Humanoid.WalkSpeed = 25
  764. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.3, 0.9 - math.sin(sine/5)/5, 0) * c_angles(math.rad(90)+(-math.sin(sine/20)/5), math.rad(45),math.rad(10)+(-math.sin(sine/10)/5)), 0.15)
  765. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.3, 0.9 - math.sin(sine/5)/5, 0) * c_angles(math.rad(90)+(-math.sin(sine/20)/5), math.rad(-45),math.rad(-10)+math.sin(sine/10)/5), 0.15)
  766. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.sin(sine/3)/1, math.rad(0), math.rad(0)), 0.15)
  767. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(-math.sin(sine/3)/1, math.rad(0), math.rad(0)), 0.15)
  768. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1 + math.sin(sine/1.5)/5, 0) * c_angles(math.rad(-20), math.rad(0), math.sin((rootPart.RotVelocity.Y/15))/2), 0.15)
  769. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(20), math.sin((rootPart.RotVelocity.Y/1))/2, math.rad(0)), 0.15)
  770. end
  771. end
  772. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement