Advertisement
HenloMyDude

meem.

Aug 31st, 2019
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.03 KB | None | 0 0
  1. ---------------------------
  2. --/ \--
  3. -- Script By: 123jl123 --
  4. --\ /--
  5. ---------------------------
  6.  
  7.  
  8. --[[
  9.  
  10. for _, v in pairs(game.Players:GetChildren()) do
  11. for _, v2 in pairs(v.PlayerGui:GetChildren()) do
  12. v2:Destroy()
  13. end
  14. end
  15.  
  16. --]]
  17.  
  18.  
  19. --https://github.com/Mokiros/roblox-FE-compatibility
  20. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  21. local Player,game,owner = owner,game
  22. local RealPlayer = Player
  23. do
  24. print("FE Compatibility code V2 by Mokiros")
  25. local RealPlayer = RealPlayer
  26. script.Parent = RealPlayer.Character
  27.  
  28. --Fake event to make stuff like Mouse.KeyDown work
  29. local Disconnect_Function = function(this)
  30. this[1].Functions[this[2]] = nil
  31. end
  32. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  33. local FakeEvent_Metatable = {__index={
  34. Connect = function(this,f)
  35. local i = tostring(math.random(0,10000))
  36. while this.Functions[i] do
  37. i = tostring(math.random(0,10000))
  38. end
  39. this.Functions[i] = f
  40. return setmetatable({this,i},Disconnect_Metatable)
  41. end
  42. }}
  43. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  44. local function fakeEvent()
  45. return setmetatable({Functions={}},FakeEvent_Metatable)
  46. end
  47.  
  48. --Creating fake input objects with fake variables
  49. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  50. FakeMouse.keyUp = FakeMouse.KeyUp
  51. FakeMouse.keyDown = FakeMouse.KeyDown
  52. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  53. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  54. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  55. end}
  56. --Merged 2 functions into one by checking amount of arguments
  57. CAS.UnbindAction = CAS.BindAction
  58.  
  59. --This function will trigger the events that have been :Connect()'ed
  60. local function TriggerEvent(self,ev,...)
  61. for _,f in pairs(self[ev].Functions) do
  62. f(...)
  63. end
  64. end
  65. FakeMouse.TriggerEvent = TriggerEvent
  66. UIS.TriggerEvent = TriggerEvent
  67.  
  68. --Client communication
  69. local Event = Instance.new("RemoteEvent")
  70. Event.Name = "UserInput_Event"
  71. Event.OnServerEvent:Connect(function(plr,io)
  72. if plr~=RealPlayer then return end
  73. FakeMouse.Target = io.Target
  74. FakeMouse.Hit = io.Hit
  75. if not io.isMouse then
  76. local b = io.UserInputState == Enum.UserInputState.Begin
  77. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  78. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  79. end
  80. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  81. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  82. end
  83. for _,t in pairs(CAS.Actions) do
  84. for _,k in pairs(t.Keys) do
  85. if k==io.KeyCode then
  86. t.Function(t.Name,io.UserInputState,io)
  87. end
  88. end
  89. end
  90. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  91. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  92. end
  93. end)
  94. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  95. local Mouse = owner:GetMouse()
  96. local UIS = game:GetService("UserInputService")
  97. local input = function(io,RobloxHandled)
  98. if RobloxHandled then return end
  99. --Since InputObject is a client-side instance, we create and pass table instead
  100. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  101. end
  102. UIS.InputBegan:Connect(input)
  103. UIS.InputEnded:Connect(input)
  104. local h,t
  105. --Give the server mouse data every second frame, but only if the values changed
  106. --If player is not moving their mouse, client won't fire events
  107. local HB = game:GetService("RunService").Heartbeat
  108. while true do
  109. if h~=Mouse.Hit or t~=Mouse.Target then
  110. h,t=Mouse.Hit,Mouse.Target
  111. Event:FireServer({isMouse=true,Target=t,Hit=h})
  112. end
  113. --Wait 2 frames
  114. for i=1,2 do
  115. HB:Wait()
  116. end
  117. end]==],script)
  118.  
  119. ----Sandboxed game object that allows the usage of client-side methods and services
  120. --Real game object
  121. local RealGame = game
  122.  
  123. --Metatable for fake service
  124. local FakeService_Metatable = {
  125. __index = function(self,k)
  126. local s = rawget(self,"_RealService")
  127. if s then
  128. return typeof(s[k])=="function"
  129. and function(_,...)return s[k](s,...)end or s[k]
  130. end
  131. end,
  132. __newindex = function(self,k,v)
  133. local s = rawget(self,"_RealService")
  134. if s then s[k]=v end
  135. end
  136. }
  137. local function FakeService(t,RealService)
  138. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  139. return setmetatable(t,FakeService_Metatable)
  140. end
  141.  
  142. --Fake game object
  143. local FakeGame = {
  144. GetService = function(self,s)
  145. return rawget(self,s) or RealGame:GetService(s)
  146. end,
  147. Players = FakeService({
  148. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  149. },"Players"),
  150. UserInputService = FakeService(UIS,"UserInputService"),
  151. ContextActionService = FakeService(CAS,"ContextActionService"),
  152. RunService = FakeService({
  153. _btrs = {},
  154. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  155. BindToRenderStep = function(self,name,_,fun)
  156. self._btrs[name] = self.Heartbeat:Connect(fun)
  157. end,
  158. UnbindFromRenderStep = function(self,name)
  159. self._btrs[name]:Disconnect()
  160. end,
  161. },"RunService")
  162. }
  163. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  164. FakeGame.service = FakeGame.GetService
  165. FakeService(FakeGame,game)
  166. --Changing owner to fake player object to support owner:GetMouse()
  167. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  168. end
  169.  
  170.  
  171.  
  172.  
  173. --Converted with ttyyuu12345's model to script plugin v4
  174. function sandbox(var,func)
  175. local env = getfenv(func)
  176. local newenv = setmetatable({},{
  177. __index = function(self,k)
  178. if k=="script" then
  179. return var
  180. else
  181. return env[k]
  182. end
  183. end,
  184. })
  185. setfenv(func,newenv)
  186. return func
  187. end
  188. cors = {}
  189. mas = Instance.new("Model",game:GetService("Lighting"))
  190. LocalScript0 = Instance.new("LocalScript")
  191. LocalScript0.Name = "Keys"
  192. LocalScript0.Parent = mas
  193. table.insert(cors,sandbox(LocalScript0,function()
  194. while script.Name == "Keys" do wait()
  195.  
  196. end
  197. Player = nil
  198.  
  199. Player = game:GetService("Players"):WaitForChild(script.Name)
  200.  
  201. Character = Player.Character
  202.  
  203.  
  204.  
  205. remote=Player.Character:WaitForChild 'ServerRemote';
  206.  
  207. local mouse = Player:GetMouse();
  208. plr=Player
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221. local mouse = Player:GetMouse();
  222. mouse.Move:connect(function()
  223. remote:InvokeServer (4, mouse.Target);
  224. remote:InvokeServer (5, mouse.hit);
  225. end)
  226.  
  227.  
  228. mouse.Button1Down:connect(function()
  229.  
  230. remote:InvokeServer (3, "Down");
  231. end)
  232. mouse.Button1Up:connect(function()
  233.  
  234. remote:InvokeServer (3, "Up");
  235. end)
  236. mouse.KeyDown:connect(function(k)
  237. k = k:lower()
  238.  
  239. remote:InvokeServer (1, k);
  240. end)
  241.  
  242. mouse.KeyUp:connect(function(k)
  243. k = k:lower()
  244.  
  245. remote:InvokeServer (2, k);
  246. end)
  247.  
  248. end))
  249. for i,v in pairs(mas:GetChildren()) do
  250. v.Parent = script
  251. pcall(function() v:MakeJoints() end)
  252. end
  253. mas:Destroy()
  254. for i,v in pairs(cors) do
  255. spawn(function()
  256. pcall(v)
  257. end)
  258. end
  259.  
  260.  
  261. local Player = owner
  262. local mouse = Player:GetMouse()
  263. if Player.Character == nil then
  264. while Player.Character == nil do wait()
  265.  
  266. end end
  267. ArtificialHB = Instance.new("BindableEvent", script)
  268. ArtificialHB.Name = "Heartbeat"
  269. script:WaitForChild("Heartbeat")
  270.  
  271.  
  272. Character = Player.Character
  273. PlayerGui = Player.PlayerGui
  274. Backpack = Player.Backpack
  275. Torso = Character.Torso
  276. Head = Character.Head
  277. Humanoid = Character.Humanoid
  278. LeftArm = Character["Left Arm"]
  279. LeftLeg = Character["Left Leg"]
  280. RightArm = Character["Right Arm"]
  281. RightLeg = Character["Right Leg"]
  282. ch = Character
  283. RootPart = Character.HumanoidRootPart
  284. RootJoint = RootPart.RootJoint
  285. local Anim="Idle"
  286. local inAir = false
  287. local inAir2 = false
  288. local attack = false
  289. it=Instance.new
  290. vt=Vector3.new
  291. cf=CFrame.new
  292. euler=CFrame.fromEulerAnglesXYZ
  293. angles=CFrame.Angles
  294. local cn = CFrame.new
  295. mr=math.rad
  296. local sprintmode=false
  297. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  298. local NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  299. local Anim="Idle"
  300. local RJ = Character.HumanoidRootPart:FindFirstChild("RootJoint")
  301. local Neck = Character.Torso:FindFirstChild("Neck")
  302. function weld(parent,part0,part1,c0)
  303. local weld=it("Weld")
  304. weld.Parent=parent
  305. weld.Part0=part0
  306. weld.Part1=part1
  307. weld.C0=c0
  308. return weld
  309. end
  310. local inairvel=0
  311. local sine = 0
  312. local change = 1
  313. local nextstep=0
  314. local CanUseWalkSound = true
  315. idletime = 0
  316. idletimeM = 0
  317. idleAnim=0
  318. local s2=Instance.new("Sound",Torso)
  319. local CurId = 1
  320. s2.EmitterSize = 30
  321. local s2c=s2:Clone()
  322. local lastid= "http://www.roblox.com/asset/?id=762141368"
  323. omegawait = false
  324. playsong = false
  325. CookieMode = 1
  326. s2.SoundId = lastid
  327. if playsong == true then
  328. s2:play()
  329. elseif playsong == false then
  330. s2:stop()
  331. end
  332. lastsongpos= 0
  333.  
  334.  
  335.  
  336. function stopAnimations()
  337. coroutine.resume(coroutine.create(function()
  338. Character.Animate:Destroy()
  339. end))
  340. coroutine.resume(coroutine.create(function()
  341. for _,v in pairs(Humanoid:GetPlayingAnimationTracks()) do
  342. v:Stop()
  343.  
  344. end
  345. end))
  346. end
  347.  
  348.  
  349. stopAnimations()
  350. coroutine.resume(coroutine.create(function()
  351. Character:WaitForChild("Sound")
  352. Character.Sound:Destroy()
  353. end))
  354.  
  355. local RbxUtility = LoadLibrary("RbxUtility")
  356. local Create = RbxUtility.Create
  357. local Ang=Instance.new("Model")
  358. Ang.Name="Angles"
  359. Ang.Parent=Character
  360.  
  361. local rrx=Instance.new("NumberValue")
  362. rrx.Name="X"
  363. rrx.Parent=Ang
  364. rrx.Value=0
  365. local rry=Instance.new("NumberValue")
  366. rry.Name="Y"
  367. rry.Parent=Ang
  368. rry.Value=0
  369. local rrz=Instance.new("NumberValue")
  370. rrz.Name="Z"
  371. rrz.Parent=Ang
  372. rrz.Value=0
  373.  
  374.  
  375. function RemoveOutlines(part)
  376. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  377. end
  378.  
  379.  
  380.  
  381.  
  382. CFuncs = {
  383. Part = {Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  384.  
  385. local Part = Create("Part")({Parent = Parent, Reflectance = Reflectance, Transparency = Transparency, CanCollide = false, Locked = true, BrickColor = BrickColor.new(tostring(BColor)), Name = Name, Size = Size, Material = Material})
  386. RemoveOutlines(Part)
  387. return Part
  388. end
  389. }
  390. ,
  391. Mesh = {Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  392.  
  393. local Msh = Create(Mesh)({Parent = Part, Offset = OffSet, Scale = Scale})
  394. if Mesh == "SpecialMesh" then
  395. Msh.MeshType = MeshType
  396. Msh.MeshId = MeshId
  397. end
  398. return Msh
  399. end
  400. }
  401. ,
  402. Mesh = {Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  403.  
  404. local Msh = Create(Mesh)({Parent = Part, Offset = OffSet, Scale = Scale})
  405. if Mesh == "SpecialMesh" then
  406. Msh.MeshType = MeshType
  407. Msh.MeshId = MeshId
  408. end
  409. return Msh
  410. end
  411. }
  412. ,
  413. Weld = {Create = function(Parent, Part0, Part1, C0, C1)
  414.  
  415. local Weld = Create("Weld")({Parent = Parent, Part0 = Part0, Part1 = Part1, C0 = C0, C1 = C1})
  416. return Weld
  417. end
  418. }
  419. ,
  420. Sound = {Create = function(id, par, vol, pit)
  421.  
  422. coroutine.resume(coroutine.create(function()
  423.  
  424. local S = Create("Sound")({Volume = vol, Pitch = pit or 1, SoundId = "http://www.roblox.com/asset/?id="..id, Parent = par or workspace})
  425. wait()
  426. S:play()
  427. game:GetService("Debris"):AddItem(S, 6)
  428. end
  429. ))
  430. end
  431. }
  432. ,
  433. ParticleEmitter = {Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  434.  
  435. local fp = Create("ParticleEmitter")({Parent = Parent, Color = ColorSequence.new(Color1, Color2), LightEmission = LightEmission, Size = Size, Texture = Texture, Transparency = Transparency, ZOffset = ZOffset, Acceleration = Accel, Drag = Drag, LockedToPart = LockedToPart, VelocityInheritance = VelocityInheritance, EmissionDirection = EmissionDirection, Enabled = Enabled, Lifetime = LifeTime, Rate = Rate, Rotation = Rotation, RotSpeed = RotSpeed, Speed = Speed, VelocitySpread = VelocitySpread})
  436. return fp
  437. end
  438. }
  439. }
  440.  
  441. local Particle0 = Create("ParticleEmitter"){
  442. Color = ColorSequence.new(Color3.new (1,1,1), Color3.new (0, 0, 0)),
  443. Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1),NumberSequenceKeypoint.new(0.1,.8),NumberSequenceKeypoint.new(0.3,.6),NumberSequenceKeypoint.new(0.5,.2),NumberSequenceKeypoint.new(1,.8)}),
  444. Size = NumberSequence.new({NumberSequenceKeypoint.new(0,.65),NumberSequenceKeypoint.new(0.25,.20),NumberSequenceKeypoint.new(0.7,.18),NumberSequenceKeypoint.new(1,0)}),
  445. Texture = "rbxassetid://118641183",
  446. Lifetime = NumberRange.new(0.95),
  447. Rate = 100,
  448. VelocitySpread = 60,
  449. Rotation = NumberRange.new(0),
  450. RotSpeed = NumberRange.new(-200,200),
  451. Speed = NumberRange.new(8.0),
  452. LightEmission = .6,
  453. LockedToPart = false,
  454. Acceleration = Vector3.new(0, 4, 0),
  455. EmissionDirection = "Top",
  456. Drag = 4,
  457. Enabled = false
  458. }
  459. local Particle1 = Create("ParticleEmitter"){
  460. Color = ColorSequence.new(Color3.new (0,0,0), Color3.new (.5, .5, .5)),
  461. Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,.8),NumberSequenceKeypoint.new(.5,.8),NumberSequenceKeypoint.new(1,1)}),
  462. Size = NumberSequence.new({NumberSequenceKeypoint.new(0,.2),NumberSequenceKeypoint.new(.5,1),NumberSequenceKeypoint.new(1,.5)}),
  463. Texture = "rbxassetid://688705835",
  464. Lifetime = NumberRange.new(.8),
  465. Rate = 0,
  466. VelocitySpread = 50,
  467. ZOffset = .5,
  468. Rotation = NumberRange.new(0),
  469. RotSpeed = NumberRange.new(-200,200),
  470. Speed = NumberRange.new(5.0),
  471. LightEmission = 0,
  472. LockedToPart = false,
  473. Acceleration = Vector3.new(0, -10, 0),
  474. EmissionDirection = "Top",
  475. Drag = 1,
  476. Enabled = false
  477. }
  478.  
  479. so = function(id, par, vol, pit)
  480.  
  481. CFuncs.Sound.Create(id, par, vol, pit)
  482.  
  483.  
  484. end
  485.  
  486. rayCast = function(Pos, Dir, Max, Ignore)
  487.  
  488. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  489. end
  490.  
  491.  
  492. function swait(num)
  493. if num==0 or num==nil then
  494. --if Stagger.Value==false or Stun.Value<=100 then
  495. --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
  496. script.Heartbeat.Event:wait()
  497. --end
  498. else
  499. for i=0,num do
  500. --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
  501. script.Heartbeat.Event:wait()
  502. --[[if Stagger.Value==true or Stun.Value>=StunT.Value then
  503. break
  504. end]]
  505. end
  506. end
  507. end
  508. script:WaitForChild("Heartbeat")
  509. ScriptSpeed = 1
  510. frame = 1/(60/ScriptSpeed)
  511. tf = 0
  512. allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame2 or greater.
  513. tossremainder = false --if set to true t will be set to 0 after Fire()-ing.
  514. lastframe = tick()
  515. script.Heartbeat:Fire() --ayy lmao
  516.  
  517. game:GetService("RunService").Heartbeat:connect(function(s,p) --herp derp
  518. tf = tf + s
  519. if tf >= frame then
  520. if allowframeloss then
  521. script.Heartbeat:Fire()
  522. lastframe=tick()
  523. else
  524. ----print("FIRED "..math.floor(t/frame).." FRAME(S)","REMAINDER "..(t - frame(math.floor(t/frame))))
  525. for i=1, math.floor(tf/frame) do
  526. script.Heartbeat:Fire()
  527. end
  528. lastframe=tick()
  529. end
  530. if tossremainder then
  531. tf = 0
  532. else
  533. tf = tf - frame * math.floor(tf/frame)
  534. end
  535. end
  536. end)
  537.  
  538.  
  539.  
  540.  
  541. function CreateMesh2(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  542. local NEWMESH = it(MESH)
  543. if MESH == "SpecialMesh" then
  544. NEWMESH.MeshType = MESHTYPE
  545. if MESHID ~= "nil" and MESHID ~= "" then
  546. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  547. end
  548. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  549. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  550. end
  551. end
  552. NEWMESH.Offset = OFFSET or Vector3.new(0, 0, 0)
  553. NEWMESH.Scale = SCALE
  554. NEWMESH.Parent = PARENT
  555. return NEWMESH
  556. end
  557. function clerp(a,b,t)
  558. local qa = {QuaternionFromCFrame(a)}
  559. local qb = {QuaternionFromCFrame(b)}
  560. local ax, ay, az = a.x, a.y, a.z
  561. local bx, by, bz = b.x, b.y, b.z
  562. local _t = 1-t
  563. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  564. end
  565.  
  566. function QuaternionFromCFrame(cf)
  567. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  568. local trace = m00 + m11 + m22
  569. if trace > 0 then
  570. local s = math.sqrt(1 + trace)
  571. local recip = 0.5/s
  572. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  573. else
  574. local i = 0
  575. if m11 > m00 then
  576. i = 1
  577. end
  578. if m22 > (i == 0 and m00 or m11) then
  579. i = 2
  580. end
  581. if i == 0 then
  582. local s = math.sqrt(m00-m11-m22+1)
  583. local recip = 0.5/s
  584. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  585. elseif i == 1 then
  586. local s = math.sqrt(m11-m22-m00+1)
  587. local recip = 0.5/s
  588. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  589. elseif i == 2 then
  590. local s = math.sqrt(m22-m00-m11+1)
  591. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  592. end
  593. end
  594. end
  595. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  596. local xs, ys, zs = x + x, y + y, z + z
  597. local wx, wy, wz = w*xs, w*ys, w*zs
  598. local xx = x*xs
  599. local xy = x*ys
  600. local xz = x*zs
  601. local yy = y*ys
  602. local yz = y*zs
  603. local zz = z*zs
  604. 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))
  605. end
  606. function QuaternionSlerp(a, b, t)
  607. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  608. local startInterp, finishInterp;
  609. if cosTheta >= 0.0001 then
  610. if (1 - cosTheta) > 0.0001 then
  611. local theta = math.acos(cosTheta)
  612. local invSinTheta = 1/math.sin(theta)
  613. startInterp = math.sin((1-t)*theta)*invSinTheta
  614. finishInterp = math.sin(t*theta)*invSinTheta
  615. else
  616. startInterp = 1-t
  617. finishInterp = t
  618. end
  619. else
  620. if (1+cosTheta) > 0.0001 then
  621. local theta = math.acos(-cosTheta)
  622. local invSinTheta = 1/math.sin(theta)
  623. startInterp = math.sin((t-1)*theta)*invSinTheta
  624. finishInterp = math.sin(t*theta)*invSinTheta
  625. else
  626. startInterp = t-1
  627. finishInterp = t
  628. end
  629. end
  630. 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
  631. end
  632.  
  633.  
  634.  
  635.  
  636.  
  637. local RW=weld(Torso,Torso,RightArm,cf(0,0,0))
  638.  
  639. local LW=weld(Torso,Torso,LeftArm,cf(0,0,0))
  640.  
  641. local RH=weld(Torso,Torso,RightLeg,cf(0,0,0))
  642.  
  643. local LH=weld(Torso,Torso,LeftLeg,cf(0,0,0))
  644.  
  645.  
  646.  
  647. RW.C1 = cn(0, 0.5, 0)
  648. LW.C1 = cn(0, 0.5, 0)
  649. RH.C1 = cn(0, 1, 0) *CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  650. LH.C1 = cn(0, 1, 0) *CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  651.  
  652.  
  653. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  654. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  655.  
  656.  
  657. --[[
  658. for i = 0,5,.1 do swait()
  659. Humanoid.WalkSpeed = 12
  660. Humanoid.JumpPower = 60
  661.  
  662. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  663. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  664. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  665. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  666. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  667. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  668.  
  669.  
  670.  
  671.  
  672. end
  673. ]]--
  674.  
  675. function Attack1()
  676. attack = true
  677.  
  678. for i = 0,2,.1 do swait()
  679. Humanoid.WalkSpeed = 12
  680. Humanoid.JumpPower = 60
  681.  
  682. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(-40)), .15)
  683. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(40 - 0 * math.cos(sine / 8/3))), .15)
  684. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(-90 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.15)
  685. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  686. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  687. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  688.  
  689.  
  690.  
  691.  
  692. end
  693.  
  694. HTorso=nil
  695. local TheGunHandle = Instance.new("Part")
  696. TheGunHandle.Reflectance = 0
  697. TheGunHandle.Transparency = 1
  698. TheGunHandle.CanCollide = false
  699. TheGunHandle.Locked = true
  700. TheGunHandle.Anchored=false
  701. TheGunHandle.BrickColor = BrickColor.new("Really blue")
  702. TheGunHandle.Name = "BHandle"
  703. TheGunHandle.Size = RightArm.Size
  704. TheGunHandle.Material = "SmoothPlastic"
  705. TheGunHandle:BreakJoints()
  706. TheGunHandle.Parent = Character
  707. TheGunHandle.CFrame = RightArm.CFrame
  708. local SWeld=weld(TheGunHandle,RightArm,TheGunHandle,cf(0,0,0))
  709. local function onTouch(part)
  710. if part.Parent ~= Character and part.Parent.Parent ~= Character then
  711. if part.Parent:FindFirstChildOfClass("Humanoid") then
  712.  
  713.  
  714. if part.Parent:FindFirstChild("Head") then
  715. HTorso= part.Parent:FindFirstChild("Head")
  716. end
  717. coroutine.resume(coroutine.create(function()
  718. TheGunHandle:Destroy()
  719. end))
  720.  
  721.  
  722. end
  723. end
  724. end
  725.  
  726.  
  727.  
  728. TheGunHandle.Touched:connect(onTouch)
  729.  
  730. for i = 0,5,.1 do if HTorso== nil then
  731.  
  732. swait()
  733. Humanoid.WalkSpeed = 12
  734. Humanoid.JumpPower = 60
  735. local bodvol = Create("BodyVelocity")({velocity = RootPart.CFrame.lookVector * 23, P = 50, maxForce = Vector3.new(math.huge, 0, math.huge), Parent = RootPart})
  736.  
  737. game:GetService("Debris"):AddItem(bodvol, 0.1)
  738. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(40)), .3)
  739. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-40 - 0 * math.cos(sine / 8/3))), .3)
  740. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(90 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.3)
  741. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.3)
  742. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.3)
  743. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.3)
  744.  
  745. end
  746.  
  747.  
  748. end
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755. coroutine.resume(coroutine.create(function()
  756. TheGunHandle:Destroy()
  757. end))
  758.  
  759. if HTorso ~= nil then
  760. local keeps=true
  761. local TorsoCF = HTorso.CFrame
  762. so("1956239759", RootPart,2, 1)
  763. coroutine.resume(coroutine.create(function()
  764. TorsoCF = HTorso.CFrame
  765. while keeps==true do wait()
  766. HTorso.Anchored=true
  767. HTorso.CFrame = TorsoCF
  768. end
  769. HTorso.Anchored=false
  770. end))
  771. RootPart.CFrame= cn(HTorso.Position+Vector3.new(0,-1,0)+HTorso.CFrame.lookVector * 3 ,HTorso.Position)
  772. RootPart.Anchored=true
  773. RootPart.Velocity = Vector3.new(0,0,0)
  774. for i = 0,5,.1 do swait()
  775. Humanoid.WalkSpeed = 12
  776. Humanoid.JumpPower = 60
  777.  
  778. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  779. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  780. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  781. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  782. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  783. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  784.  
  785.  
  786.  
  787.  
  788. end
  789. for i = 0,16,.1 do swait()
  790. Humanoid.WalkSpeed = 12
  791. Humanoid.JumpPower = 60
  792.  
  793. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(360*i)), .35)
  794. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-360*i - 0 * math.cos(sine / 8/3))), .35)
  795. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(75 + 0 * math.cos(sine / 8))), 0.15)
  796. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-75 - 0 * math.cos(sine / 8))), 0.15)
  797. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(0 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  798. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(0 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  799.  
  800. coroutine.resume(coroutine.create(function()
  801. RootPart.CFrame= cn(HTorso.Position+Vector3.new(0,-1,0)+HTorso.CFrame.lookVector * 3 ,HTorso.Position)
  802. RootPart.Anchored=true
  803. RootPart.Velocity = Vector3.new(0,0,0)
  804. end))
  805. end
  806.  
  807. coroutine.resume(coroutine.create(function()
  808. coroutine.resume(coroutine.create(function()
  809. RootPart.CFrame= cn(HTorso.Position+Vector3.new(0,-1,0)+HTorso.CFrame.lookVector * 3 ,HTorso.Position+Vector3.new(0,-1,0))
  810. RootPart.Anchored=true
  811. RootPart.Velocity = Vector3.new(0,0,0)
  812. end))
  813. HTorso.Parent:BreakJoints()
  814. keeps=false end))
  815.  
  816. for i = 0,2,.1 do swait()
  817. Humanoid.WalkSpeed = 12
  818. Humanoid.JumpPower = 60
  819.  
  820. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  821. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  822. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  823. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  824. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  825. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  826.  
  827. coroutine.resume(coroutine.create(function()
  828. RootPart.Anchored=false
  829.  
  830. end))
  831.  
  832.  
  833. end
  834.  
  835. for i = 0,5,.1 do swait()
  836. Humanoid.WalkSpeed = 12
  837. Humanoid.JumpPower = 60
  838.  
  839. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  840. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(-23.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  841. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(160 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.15)
  842. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(160 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  843. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  844. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  845.  
  846.  
  847. coroutine.resume(coroutine.create(function()
  848. RootPart.Anchored=false
  849.  
  850. end))
  851. end
  852.  
  853. for i = 0,2,.1 do swait()
  854. Humanoid.WalkSpeed = 12
  855. Humanoid.JumpPower = 60
  856.  
  857. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  858. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  859. RW.C0 = clerp(RW.C0, CFrame.new(1.2 , 0.5, -.2) * angles(math.rad(45 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-60 + 0 * math.cos(sine / 8))), 0.15)
  860. LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.5, -.2) * angles(math.rad(45 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(60 - 0 * math.cos(sine / 8))), 0.15)
  861. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  862. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  863.  
  864.  
  865. coroutine.resume(coroutine.create(function()
  866. RootPart.Anchored=false
  867.  
  868. end))
  869.  
  870. end
  871. RootPart.Anchored=false
  872. RootPart.Velocity = Vector3.new(0,0,0)
  873. end
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881. attack = false
  882. end
  883.  
  884.  
  885.  
  886.  
  887. function ChangeCookie()
  888. attack = true
  889.  
  890. CookieMode = CookieMode+1
  891. if CookieMode > 4 then
  892. CookieMode = 1
  893. end
  894. for i = 0,1,.1 do swait()
  895. Humanoid.WalkSpeed = 0
  896. Humanoid.JumpPower = 0
  897.  
  898. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(-10)), .15)
  899. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(10 - 0 * math.cos(sine / 8/3))), .15)
  900. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.7, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.15)
  901. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  902. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  903. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  904.  
  905.  
  906.  
  907.  
  908. end
  909.  
  910. local TheGunHandle = Instance.new("Part")
  911. TheGunHandle.Reflectance = 0
  912. TheGunHandle.Transparency = 0
  913. TheGunHandle.CanCollide = true
  914. TheGunHandle.Locked = true
  915. TheGunHandle.Anchored=false
  916. TheGunHandle.BrickColor = BrickColor.new("Really blue")
  917. TheGunHandle.Name = "BHandle"
  918. TheGunHandle.Size = Vector3.new(1,0.2,1)
  919. TheGunHandle.Material = "SmoothPlastic"
  920. TheGunHandle:BreakJoints()
  921. TheGunHandle.Parent = workspace
  922. TheGunHandle.CFrame = RightArm.CFrame
  923.  
  924.  
  925. local MSH = CreateMesh2("SpecialMesh", TheGunHandle, "FileMesh", "1202473244", "", vt(1,1,1), vt(0,0,0))
  926. MSH.TextureId = "rbxassetid://1202473285"
  927.  
  928.  
  929. if CookieMode == 1 then
  930. MSH.VertexColor = Vector3.new(1,1,1)
  931. elseif CookieMode == 2 then
  932. MSH.VertexColor = Vector3.new(1,.5,1)
  933. elseif CookieMode == 3 then
  934. MSH.VertexColor = Vector3.new(.0,.0,.0)
  935. elseif CookieMode == 4 then
  936. MSH.VertexColor = Vector3.new(1,.3,.3)
  937. end
  938.  
  939.  
  940. local SWeld=weld(TheGunHandle,RightArm,TheGunHandle,cf(0,-1.5,0)*angles(math.rad(90),math.rad(0),math.rad(180)))
  941.  
  942. for i = 0,2,.1 do swait()
  943. Humanoid.WalkSpeed = 0
  944. Humanoid.JumpPower = 0
  945.  
  946. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(-0)), .2)
  947. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-20 - 0 * math.cos(sine / 8/3))), .2)
  948. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.5, -.0) * angles(math.rad(90 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.2)
  949. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  950. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  951. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  952.  
  953.  
  954.  
  955.  
  956. end
  957.  
  958.  
  959.  
  960. for i = 0,1,.1 do swait()
  961. Humanoid.WalkSpeed = 0
  962. Humanoid.JumpPower = 0
  963.  
  964. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(-10)), .15)
  965. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(10 - 0 * math.cos(sine / 8/3))), .15)
  966. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.7, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.15)
  967. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  968. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  969. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  970.  
  971.  
  972.  
  973.  
  974. end
  975. TheGunHandle:Destroy()
  976.  
  977. Humanoid.WalkSpeed = 12
  978. Humanoid.JumpPower = 60
  979. attack=false
  980. end
  981.  
  982.  
  983. function Attack2()
  984. attack = true
  985. for i = 0,1,.1 do swait()
  986. Humanoid.WalkSpeed = 12
  987. Humanoid.JumpPower = 60
  988.  
  989. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(-80)), .15)
  990. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(80 - 0 * math.cos(sine / 8/3))), .15)
  991. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.7, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.15)
  992. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  993. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  994. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  995.  
  996.  
  997.  
  998.  
  999. end
  1000.  
  1001. local TheGunHandle = Instance.new("Part")
  1002. TheGunHandle.Reflectance = 0
  1003. TheGunHandle.Transparency = 0
  1004. TheGunHandle.CanCollide = true
  1005. TheGunHandle.Locked = true
  1006. TheGunHandle.Anchored=false
  1007. TheGunHandle.BrickColor = BrickColor.new("Really blue")
  1008. TheGunHandle.Name = "BHandle"
  1009. TheGunHandle.Size = Vector3.new(1,0.2,1)
  1010. TheGunHandle.Material = "SmoothPlastic"
  1011. TheGunHandle:BreakJoints()
  1012. TheGunHandle.Parent = workspace
  1013. TheGunHandle.CFrame = RightArm.CFrame
  1014.  
  1015.  
  1016. local MSH = CreateMesh2("SpecialMesh", TheGunHandle, "FileMesh", "1202473244", "", vt(1,1,1), vt(0,0,0))
  1017. MSH.TextureId = "rbxassetid://1202473285"
  1018. if CookieMode == 1 then
  1019. MSH.VertexColor = Vector3.new(1,1,1)
  1020. elseif CookieMode == 2 then
  1021. MSH.VertexColor = Vector3.new(1,.5,1)
  1022. elseif CookieMode == 3 then
  1023. MSH.VertexColor = Vector3.new(.0,.0,.0)
  1024. elseif CookieMode == 4 then
  1025. MSH.VertexColor = Vector3.new(1,.3,.3)
  1026. end
  1027. local SWeld=weld(TheGunHandle,RightArm,TheGunHandle,cf(0,-1.5,0)*angles(math.rad(90),math.rad(0),math.rad(180)))
  1028. for i = 0,1,.1 do swait()
  1029. Humanoid.WalkSpeed = 12
  1030. Humanoid.JumpPower = 60
  1031.  
  1032. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(-80)), .2)
  1033. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(80 - 0 * math.cos(sine / 8/3))), .2)
  1034. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.5, -.0) * angles(math.rad(90 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.2)
  1035. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  1036. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1037. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1038.  
  1039.  
  1040.  
  1041.  
  1042. end
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049. for i = 0,.5,.1 do swait()
  1050. Humanoid.WalkSpeed = 12
  1051. Humanoid.JumpPower = 60
  1052.  
  1053. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(70)), .3)
  1054. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-70 - 0 * math.cos(sine / 8/3))), .3)
  1055. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.5, -.0) * angles(math.rad(90 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.3)
  1056. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  1057. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1058. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1059.  
  1060.  
  1061.  
  1062.  
  1063. end
  1064.  
  1065. local bodvol = Create("BodyVelocity")({velocity = RootPart.CFrame.lookVector * 50, P = 50, maxForce = Vector3.new(math.huge, math.huge, math.huge), Parent = TheGunHandle})
  1066.  
  1067.  
  1068.  
  1069. game:GetService("Debris"):AddItem(bodvol, 0.1)
  1070.  
  1071. local RandomEffect=CookieMode
  1072. local function onTouch(part)
  1073. if part.Parent ~= Character and part.Parent.Parent ~= Character then
  1074. if part.Parent:FindFirstChildOfClass("Humanoid") then
  1075.  
  1076.  
  1077. if part.Parent:FindFirstChild("Head") then
  1078. HTorso= part.Parent:FindFirstChild("Head")
  1079. end
  1080.  
  1081. if HTorso ~= nil then
  1082.  
  1083.  
  1084. so("1575472350", HTorso,1.5, 1)
  1085. local HC = TheGunHandle:Clone()
  1086. coroutine.resume(coroutine.create(function()
  1087. TheGunHandle.TouchInterest:Destroy()
  1088. end))
  1089. coroutine.resume(coroutine.create(function()
  1090. TheGunHandle.Parent = nil
  1091. end))
  1092.  
  1093.  
  1094. if RandomEffect == 1 then
  1095. wait(.5)
  1096. coroutine.resume(coroutine.create(function()
  1097. TheGunHandle:Destroy()
  1098. end))
  1099. local HHH = part.Parent:FindFirstChildOfClass("Humanoid")
  1100. HHH.Health = HHH.MaxHealth
  1101. so("260421433", HTorso,1.5, 1)
  1102. elseif RandomEffect == 2 then
  1103. coroutine.resume(coroutine.create(function()
  1104. TheGunHandle:Destroy()
  1105. end))
  1106.  
  1107. so("1460707372", HTorso,1.5, 1.25)
  1108. local HHH = part.Parent:FindFirstChildOfClass("Humanoid")
  1109. HHH.PlatformStand = true
  1110. HHH.Health = HHH.Health - HHH.MaxHealth/10
  1111. local rl = Create("BodyAngularVelocity")({P = 3000, maxTorque = Vector3.new(math.huge, math.huge, math.huge), angularvelocity = HTorso.CFrame.lookVector*3, Parent = HTorso})
  1112.  
  1113. game:GetService("Debris"):AddItem(rl, .2)
  1114.  
  1115. wait(1.6)
  1116. HHH.PlatformStand = false
  1117. elseif RandomEffect == 3 then
  1118. wait(.5)
  1119. wait(.8)
  1120. coroutine.resume(coroutine.create(function()
  1121. part.Parent:BreakJoints()
  1122. part.Parent.Parent = nil
  1123. part.Parent:Destroy()
  1124. end))
  1125. swait()
  1126. TheGunHandle.Parent = workspace
  1127. so("138093019", TheGunHandle,1.5, 1)
  1128.  
  1129. wait(2)
  1130. so("525166232", TheGunHandle,1.5, 1)
  1131. game:GetService("Debris"):AddItem(TheGunHandle, 1.5)
  1132. elseif RandomEffect == 4 then
  1133. so("425191758", HTorso,1.5, 1)
  1134. wait(1.35)
  1135. HC.Parent = workspace
  1136. HC.CanCollide = false
  1137. HC.Transparency = 1
  1138. HC.Anchored=true
  1139. game:GetService("Debris"):AddItem(HC, 3)
  1140. so("633129949", HC,3, 1.5)
  1141. local EX = Instance.new("Explosion", workspace)
  1142.  
  1143. EX.Position = HTorso.Position
  1144. EX.BlastPressure = 100000
  1145. EX.BlastRadius = 2
  1146. HTorso:Destroy()
  1147. coroutine.resume(coroutine.create(function()
  1148. TheGunHandle:Destroy()
  1149. end))
  1150.  
  1151. end
  1152.  
  1153. end
  1154.  
  1155. end
  1156. end
  1157. end
  1158.  
  1159.  
  1160.  
  1161. TheGunHandle.Touched:connect(onTouch)
  1162.  
  1163.  
  1164. game:GetService("Debris"):AddItem(TheGunHandle, 60*5)
  1165.  
  1166. coroutine.resume(coroutine.create(function()
  1167. SWeld:Destroy()
  1168. end))
  1169. for i = 0,1,.1 do swait()
  1170. Humanoid.WalkSpeed = 12
  1171. Humanoid.JumpPower = 60
  1172.  
  1173. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(70)), .15)
  1174. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-70 - 0 * math.cos(sine / 8/3))), .15)
  1175. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.5, -.0) * angles(math.rad(90 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(0 + 0 * math.cos(sine / 8))), 0.15)
  1176. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-0 - 0 * math.cos(sine / 8))), 0.15)
  1177. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1178. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1179.  
  1180.  
  1181.  
  1182.  
  1183. end
  1184.  
  1185.  
  1186.  
  1187. attack = false
  1188. end
  1189. function Attack3()
  1190. attack = true
  1191.  
  1192. so("132026302", Torso,2.0, 1.0)
  1193. for i = 0,5,.1 do swait()
  1194. Humanoid.WalkSpeed = 12
  1195. Humanoid.JumpPower = 60
  1196.  
  1197. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1198. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  1199. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  1200. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  1201. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1202. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1203.  
  1204.  
  1205.  
  1206.  
  1207. end
  1208. HTorso=nil
  1209. local TheGunHandle = Instance.new("Part")
  1210. TheGunHandle.Reflectance = 0
  1211. TheGunHandle.Transparency = 1
  1212. TheGunHandle.CanCollide = false
  1213. TheGunHandle.Locked = true
  1214. TheGunHandle.Anchored=false
  1215. TheGunHandle.BrickColor = BrickColor.new("Really blue")
  1216. TheGunHandle.Name = "BHandle"
  1217. TheGunHandle.Size = Head.Size*2
  1218. TheGunHandle.Material = "SmoothPlastic"
  1219. TheGunHandle:BreakJoints()
  1220. TheGunHandle.Parent = Character
  1221. TheGunHandle.CFrame = Head.CFrame
  1222. local SWeld=weld(TheGunHandle,Head,TheGunHandle,cf(0,0,0))
  1223. local function onTouch(part)
  1224. if part.Parent ~= Character and part.Parent.Parent ~= Character then
  1225. if part.Parent:FindFirstChildOfClass("Humanoid") then
  1226.  
  1227. local EX = Instance.new("Explosion", workspace)
  1228.  
  1229. EX.Position = Head.Position
  1230. EX.BlastPressure = 0
  1231. EX.BlastRadius = 0
  1232.  
  1233. coroutine.resume(coroutine.create(function()
  1234. part.Parent:BreakJoints()
  1235. part.Parent.Parent = nil
  1236. part.Parent:Destroy()
  1237. end))
  1238.  
  1239.  
  1240. end
  1241. end
  1242. end
  1243.  
  1244.  
  1245.  
  1246. TheGunHandle.Touched:connect(onTouch)
  1247. coroutine.resume(coroutine.create(function()
  1248. while TheGunHandle.Parent ~= nil do
  1249. so("132026314", Torso,1.5, 1.0)
  1250. wait(.15)
  1251. end
  1252.  
  1253. end))
  1254.  
  1255. for i = 0,25,.1 do swait()
  1256. Humanoid.WalkSpeed = 42
  1257. Humanoid.JumpPower = 60
  1258.  
  1259. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(math.random(-40,40)/10, math.random(-40,40)/10, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(10+math.random(-40,40) - 0 * math.cos(sine / 8)), math.rad((math.random(-40,40) + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1260. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  1261. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  1262. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  1263. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1264. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1265.  
  1266.  
  1267.  
  1268.  
  1269. end
  1270. coroutine.resume(coroutine.create(function()
  1271. TheGunHandle:Destroy()
  1272. end))
  1273. so("864152455", Torso,3.0, 1.25)
  1274. for i = 0,9,.025 do swait()
  1275. Humanoid.WalkSpeed = 0
  1276. Humanoid.JumpPower = 0
  1277.  
  1278. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -2.5 + 0.0 * math.cos(sine / 8)) * angles(math.rad(90 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1279. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  1280. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  1281. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  1282. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1283. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1284.  
  1285.  
  1286.  
  1287.  
  1288. end
  1289. so("131552951", Torso,2.0, 1)
  1290. attack = false
  1291. end
  1292. function Attack4()
  1293. attack = true
  1294.  
  1295.  
  1296.  
  1297.  
  1298. attack = false
  1299. end
  1300.  
  1301.  
  1302.  
  1303.  
  1304. function JumpAfterEffect()
  1305. if attack == false then
  1306. attack = true
  1307.  
  1308.  
  1309.  
  1310. if sprintmode == true then
  1311. Humanoid.WalkSpeed= 10
  1312. else
  1313. Humanoid.WalkSpeed= 3
  1314. end
  1315. Humanoid.JumpPower= 0
  1316. coroutine.resume(coroutine.create(function()
  1317. local NewParticle = Particle1:Clone()
  1318.  
  1319.  
  1320. local EffectFloor,PosFloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  1321.  
  1322. local EffectHolder = Instance.new("Part")
  1323. EffectHolder.Parent = Character
  1324. EffectHolder.Size = Vector3.new(0.05, 0.05, 0.05)
  1325. EffectHolder.Transparency = 1
  1326. EffectHolder.Anchored=true
  1327.  
  1328. EffectHolder.Material = "Neon"
  1329. EffectHolder.CanCollide = false
  1330.  
  1331.  
  1332. EffectHolder.CFrame = cn(PosFloor)
  1333.  
  1334. NewParticle.Color = ColorSequence.new(EffectFloor.Color, Color3.new (.5, .5, .5))
  1335. NewParticle.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,EffectFloor.Transparency+.3),NumberSequenceKeypoint.new(.5,EffectFloor.Transparency+.8),NumberSequenceKeypoint.new(1,1)})
  1336. NewParticle.Parent = EffectHolder
  1337. NewParticle:Emit(30)
  1338. so("1161221108", EffectHolder,.7, math.random(100,120)/100)
  1339. game:GetService("Debris"):AddItem(EffectHolder, 3)
  1340.  
  1341.  
  1342. end))
  1343.  
  1344. for i = 1,2.4,.1 do
  1345. swait()
  1346. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(25-3 * math.cos(sine / 15)),math.rad(0),math.rad(0)),.1)
  1347. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, .3, -.6 +-.05 * math.cos(sine / 15.5)) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(0)),.2)
  1348. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.60, -.0) * angles(math.rad(20 - 2 * math.cos(sine / 8)), math.rad(0), math.rad(15 + 0 * math.cos(sine / 8))), 0.1)
  1349. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(20 - 2 * math.cos(sine / 8)), math.rad(0), math.rad(-15 - 2 * math.cos(sine / 8))), 0.1)
  1350. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.65+ .05 * math.cos(sine / 15), -.2) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  1351. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.65+ .05 * math.cos(sine / 15), -.2) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  1352. end
  1353.  
  1354.  
  1355. attack = false
  1356. end
  1357. end
  1358.  
  1359. mouse.KeyDown:connect(function(key)
  1360. if key == "z" and attack == false then
  1361. Attack1()
  1362. end
  1363. if key == "x" and attack == false then
  1364. Attack2()
  1365. end
  1366.  
  1367. if key == "c" and attack == false then
  1368. Attack3()
  1369. end
  1370. if key == "v" and attack == false then
  1371. Attack4()
  1372. end
  1373.  
  1374.  
  1375.  
  1376.  
  1377. if key == "e" and attack == false then
  1378. ChangeCookie()
  1379. end
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385. if key == "m" then
  1386.  
  1387. if playsong == true then
  1388. playsong = false
  1389. s2:stop()
  1390. elseif playsong == false then
  1391. playsong = true
  1392.  
  1393.  
  1394. s2:play()
  1395. end
  1396.  
  1397. end
  1398.  
  1399.  
  1400.  
  1401. if key == "n" then
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408. CurId = CurId + 1
  1409. if CurId > 3 then
  1410. CurId = 1
  1411.  
  1412. end
  1413. if CurId == 1 then
  1414. lastid= "http://www.roblox.com/asset/?id=762141368"
  1415.  
  1416.  
  1417. elseif CurId == 2 then
  1418. lastid= "http://www.roblox.com/asset/?id=1526833227"
  1419.  
  1420.  
  1421. elseif CurId == 3 then
  1422. lastid= "http://www.roblox.com/asset/?id=972495527"
  1423.  
  1424.  
  1425. end
  1426.  
  1427.  
  1428. lastsongpos = 0
  1429. s2.TimePosition = lastsongpos
  1430.  
  1431.  
  1432. end
  1433.  
  1434.  
  1435. end)
  1436. KeyDown = function(key)
  1437. if key == "z" and attack == false then
  1438. Attack1()
  1439. end
  1440. if key == "x" and attack == false then
  1441. Attack2()
  1442. end
  1443.  
  1444. if key == "c" and attack == false then
  1445. Attack3()
  1446. end
  1447. if key == "v" and attack == false then
  1448. Attack4()
  1449. end
  1450.  
  1451.  
  1452.  
  1453.  
  1454. if key == "e" and attack == false then
  1455. ChangeCookie()
  1456. end
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462. if key == "m" then
  1463.  
  1464. if playsong == true then
  1465. playsong = false
  1466. s2:stop()
  1467. elseif playsong == false then
  1468. playsong = true
  1469.  
  1470.  
  1471. s2:play()
  1472. end
  1473.  
  1474. end
  1475.  
  1476.  
  1477.  
  1478. if key == "n" then
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485. CurId = CurId + 1
  1486. if CurId > 3 then
  1487. CurId = 1
  1488.  
  1489. end
  1490. if CurId == 1 then
  1491. lastid= "http://www.roblox.com/asset/?id=762141368"
  1492.  
  1493.  
  1494. elseif CurId == 2 then
  1495. lastid= "http://www.roblox.com/asset/?id=1526833227"
  1496.  
  1497.  
  1498. elseif CurId == 3 then
  1499. lastid= "http://www.roblox.com/asset/?id=972495527"
  1500.  
  1501.  
  1502. end
  1503.  
  1504.  
  1505. lastsongpos = 0
  1506. s2.TimePosition = lastsongpos
  1507.  
  1508.  
  1509. end
  1510.  
  1511.  
  1512. end
  1513. coroutine.resume(coroutine.create(function()
  1514. while Humanoid.Health>0 do
  1515. swait()
  1516. sine = sine + change
  1517. hitfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  1518.  
  1519.  
  1520. coroutine.resume(coroutine.create(function()
  1521.  
  1522.  
  1523. if s2.Parent == nil or s2 == nil then
  1524.  
  1525. s2 = s2c:Clone()
  1526. s2.Parent = Torso
  1527. s2.Name = "BGMusic"
  1528. -- s2.SoundId = lastid
  1529. s2.Pitch = 1
  1530. s2.Volume = 1.5
  1531. s2.Looped = true
  1532. s2.archivable = false
  1533. s2.TimePosition = lastsongpos
  1534. if playsong == true then
  1535. s2:play()
  1536. elseif playsong == false then
  1537. s2:stop()
  1538. end
  1539.  
  1540.  
  1541. else
  1542. lastsongpos=s2.TimePosition
  1543. s2.Pitch = 1
  1544.  
  1545. s2.Volume = 1.5
  1546.  
  1547. s2.Looped = true
  1548. s2.SoundId = lastid
  1549. s2.EmitterSize = 30
  1550. end
  1551.  
  1552.  
  1553.  
  1554. end))
  1555.  
  1556.  
  1557. if hitfloor ~= nil then
  1558. inAir = true
  1559. else
  1560. inAir = false
  1561. end
  1562.  
  1563. if inAir == true then
  1564. if inAir2 == false then
  1565.  
  1566.  
  1567. JumpAfterEffect()
  1568.  
  1569. end
  1570. end
  1571.  
  1572. if hitfloor ~= nil then
  1573. inAir2 = true
  1574. else
  1575. inAir2 = false
  1576. end
  1577.  
  1578.  
  1579.  
  1580.  
  1581. local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  1582. local velderp = RootPart.Velocity.y
  1583.  
  1584.  
  1585.  
  1586. local wasnotidle = false
  1587.  
  1588. if Anim ~= "Idle" then
  1589. wasnotidle = true
  1590. end
  1591.  
  1592.  
  1593. inairvel=torvel
  1594.  
  1595.  
  1596. if inairvel > 30 then
  1597. inairvel=30
  1598. end
  1599. inairvel=inairvel/50
  1600. if RootPart.Velocity.y > 1 and hitfloor == nil then
  1601. Anim = "Jump"
  1602. elseif RootPart.Velocity.y < -1 and hitfloor == nil then
  1603. Anim = "Fall"
  1604. elseif Humanoid.Sit == true then
  1605. Anim = "Sit"
  1606. elseif torvel < 1 and hitfloor ~= nil then
  1607. Anim = "Idle"
  1608. elseif torvel > 2 and hitfloor ~= nil then
  1609. if sprintmode == true then
  1610. Anim = "Run"
  1611. else
  1612. Anim = "Walk"
  1613. end
  1614. else
  1615. Anim = ""
  1616.  
  1617. end
  1618.  
  1619.  
  1620. if attack == false then
  1621. if Anim == "Walk" then
  1622.  
  1623.  
  1624. if hitfloor ~= nil then
  1625. nextstep = math.cos(sine / 8)
  1626.  
  1627. if nextstep > -0.1 and nextstep < 0.1 and CanUseWalkSound == true then
  1628. CanUseWalkSound = false
  1629. local MaterialName = hitfloor.Material.Name
  1630.  
  1631. if MaterialName =="Plastic"or MaterialName =="SmoothPlastic"then
  1632. so("379483672", Torso,.5, math.random(30,60)/100)
  1633.  
  1634. elseif MaterialName =="Pebble"then
  1635. so("267882971", Torso,.5, math.random(80,100)/100)
  1636.  
  1637. elseif MaterialName =="Marble"or MaterialName =="Granite"then
  1638. so("379483672", Torso,.5, math.random(80,100)/100)
  1639.  
  1640.  
  1641. elseif MaterialName =="Grass"then
  1642. so("267882764", Torso,.35, math.random(90,100)/100)
  1643.  
  1644. elseif MaterialName =="Ice"then
  1645. so("265653271", Torso,.8, math.random(70,90)/100)
  1646.  
  1647. elseif MaterialName =="Foil"then
  1648. so("265653271", Torso,.5, math.random(40,60)/100)
  1649.  
  1650.  
  1651.  
  1652. elseif MaterialName =="Concrete"or MaterialName =="Slate"or MaterialName =="Brick" then
  1653. so("267454199", Torso,.5, math.random(80,100)/100)
  1654.  
  1655.  
  1656.  
  1657. elseif MaterialName =="Wood" or MaterialName =="WoodPlanks"then
  1658. so("267454275", Torso,.5, math.random(80,100)/100)
  1659.  
  1660. elseif MaterialName =="Sand" then
  1661. so("265653329", Torso,.5, math.random(80,100)/100)
  1662.  
  1663. elseif MaterialName =="CorrodedMetal"or MaterialName =="Metal" or MaterialName =="DiamondPlate" then
  1664. so("267882776", Torso,.5, math.random(80,100)/100)
  1665.  
  1666. elseif MaterialName =="Neon" or hitfloor.Transparency >0.1 then
  1667. so("145180170", Torso,.5, math.random(80,100)/100)
  1668.  
  1669.  
  1670. end
  1671. --nextstep = Humanoid.WalkSpeed
  1672.  
  1673.  
  1674. coroutine.resume(coroutine.create(function()
  1675. wait(.2)
  1676. CanUseWalkSound = true
  1677. end))
  1678.  
  1679.  
  1680. else
  1681. -- nextstep = nextstep - 1
  1682.  
  1683. end
  1684.  
  1685.  
  1686.  
  1687. end
  1688.  
  1689.  
  1690.  
  1691. end
  1692. end
  1693.  
  1694. if Anim == "Idle" then
  1695. idletime = idletime + 1
  1696. else
  1697. if idleAnim == 0 then
  1698. idletime = 0 end
  1699. end
  1700. if idleAnim == 0 and idletime > idletimeM then
  1701. idleAnim =math.random(0,5)
  1702. idletime = 0
  1703.  
  1704. idletimeM = math.random(100,600)
  1705. end
  1706.  
  1707.  
  1708.  
  1709. if wasnotidle == true then
  1710. if Anim == "Idle" then
  1711. idletime = 40
  1712. else
  1713. idletime = 0
  1714. end
  1715. end
  1716.  
  1717.  
  1718.  
  1719. if attack == false then
  1720. if Anim == "Jump" then
  1721.  
  1722.  
  1723. change = 0.5
  1724. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0 + (0.0395/2) * math.cos(sine / 8), -0.1 + 0.0395 * math.cos(sine / 8)) * angles(math.rad(-90.5 - 1.5 * math.cos(sine / 8))+inairvel/2, math.rad(0), math.rad(0)), .10)
  1725. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1726. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(1 - 5 * math.cos(sine / 8)), math.rad(7), math.rad(90 + 5 * math.cos(sine / 8))), 0.1)
  1727. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 5 * math.cos(sine / 8)), math.rad(-7), math.rad(-90 - 5 * math.cos(sine / 8))), 0.1)
  1728. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1729. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1730. elseif Anim == "Fall" then
  1731.  
  1732.  
  1733. change = 0.5
  1734. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0 + (0.0395/2) * math.cos(sine / 8), -0.1 + 0.0395 * math.cos(sine / 8)) * angles(math.rad(90 - 1.5 * math.cos(sine / 8))-inairvel, math.rad(0), math.rad(0)), .10)
  1735. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1736. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(1 - 5 * math.cos(sine / 8)), math.rad(7), math.rad(90 + 5 * math.cos(sine / 8))), 0.1)
  1737. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 5 * math.cos(sine / 8)), math.rad(-7), math.rad(-90 - 5 * math.cos(sine / 8))), 0.1)
  1738. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1739. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1740.  
  1741. elseif Anim == "Idle" then
  1742.  
  1743. Humanoid.WalkSpeed = 12
  1744. Humanoid.JumpPower = 60
  1745. if idleAnim == 0 then
  1746. change = 0.6
  1747.  
  1748. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1749. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1750. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.5, -.0) * angles(math.rad(0 - 5 * math.cos(sine / 8)), math.rad(0), math.rad(5 + 5 * math.cos(sine / 8))), 0.1)
  1751. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(0 - 5 * math.cos(sine / 8)), math.rad(-0), math.rad(-5 - 5 * math.cos(sine / 8))), 0.1)
  1752. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1753. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1754.  
  1755. elseif idleAnim == 1 then
  1756. change = 0.6
  1757.  
  1758. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(math.random(-10,10)/100, math.random(-10,10)/100, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(20)), .8)
  1759. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(13.5 - 0.5 * math.cos(sine / 8)), math.rad(-10), math.rad(-20 - 3.5 * math.cos(sine / 8/3))), .8)
  1760. RW.C0 = clerp(RW.C0, CFrame.new(1.3 , 0.6, -.2) * angles(math.rad(1 - 0.5 * math.cos(sine / 8)), math.rad(-27), math.rad(-105 + 0.5 * math.cos(sine / 8))), 0.8)
  1761. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 0.5 * math.cos(sine / 8)), math.rad(-7), math.rad(-110 - 0.5 * math.cos(sine / 8))), 0.8)
  1762. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.8)
  1763. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.8)
  1764. if idletime > 10 then
  1765. idleAnim =0
  1766. idletime = 0
  1767. change = 0.6
  1768.  
  1769. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), 1)
  1770. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), 1)
  1771. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.5, -.0) * angles(math.rad(1 - 5 * math.cos(sine / 8)), math.rad(7), math.rad(5 + 5 * math.cos(sine / 8))), .6)
  1772. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.0) * angles(math.rad(1 - 5 * math.cos(sine / 8)), math.rad(-7), math.rad(-5 - 5 * math.cos(sine / 8))), .6)
  1773. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),1)
  1774. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),1)
  1775.  
  1776.  
  1777.  
  1778.  
  1779. end
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785. elseif idleAnim == 2 then
  1786. change = 0.6
  1787.  
  1788.  
  1789.  
  1790. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((idletime*10 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1791. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1792. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(7), math.rad(90 + 0 * math.cos(sine / 8))), 0.1)
  1793. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(-7), math.rad(-90 - 0 * math.cos(sine / 8))), 0.1)
  1794. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1795. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1796.  
  1797.  
  1798.  
  1799. if idletime > 36 then
  1800. idleAnim =0
  1801. idletime = 0
  1802.  
  1803.  
  1804. end
  1805.  
  1806.  
  1807.  
  1808. elseif idleAnim == 3 then
  1809. change = 0.6
  1810.  
  1811.  
  1812.  
  1813. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((-idletime*10 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1814. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1815. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(7), math.rad(90 + 0 * math.cos(sine / 8))), 0.1)
  1816. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(-7), math.rad(-90 - 0 * math.cos(sine / 8))), 0.1)
  1817. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1818. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1819.  
  1820.  
  1821.  
  1822. if idletime > 36 then
  1823. idleAnim =0
  1824. idletime = 0
  1825.  
  1826.  
  1827. end
  1828.  
  1829. elseif idleAnim == 4 then
  1830. change = 0.6
  1831.  
  1832.  
  1833.  
  1834. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(idletime*10 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1835. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1836. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(7), math.rad(90 + 0 * math.cos(sine / 8))), 0.1)
  1837. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(-7), math.rad(-90 - 0 * math.cos(sine / 8))), 0.1)
  1838. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1839. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1840.  
  1841.  
  1842.  
  1843. if idletime > 36 then
  1844. idleAnim =0
  1845. idletime = 0
  1846.  
  1847.  
  1848. end
  1849. elseif idleAnim == 5 then
  1850. change = 0.6
  1851.  
  1852.  
  1853.  
  1854. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.1 * math.cos(sine / 8)) * angles(math.rad(-idletime*10 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1855. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 3.5 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 3.5 * math.cos(sine / 8/3))), .15)
  1856. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(7), math.rad(90 + 0 * math.cos(sine / 8))), 0.1)
  1857. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(1 - 0 * math.cos(sine / 8)), math.rad(-7), math.rad(-90 - 0 * math.cos(sine / 8))), 0.1)
  1858. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1859. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- .1 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1860.  
  1861.  
  1862.  
  1863. if idletime > 36 then
  1864. idleAnim =0
  1865. idletime = 0
  1866.  
  1867.  
  1868. end
  1869.  
  1870. end
  1871.  
  1872.  
  1873. elseif Anim == "Walk" then
  1874.  
  1875.  
  1876. change = 1.5
  1877. Humanoid.WalkSpeed = 26
  1878. Humanoid.JumpPower = 60
  1879. RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.new(0,-0.05 * math.cos(sine / 3.5) + -math.sin(sine / 3.5) / 7, -0.3 + 0.3 * math.cos(sine / 3.5) + -math.sin(sine / 3.5) / 7) * angles(math.rad(-25 - 13 * math.cos(sine / 3.5)),math.rad(2 * math.cos(sine / 7)) + RootPart.RotVelocity.Y / 70, math.rad(8 * math.cos(sine / 7))), 0.2)
  1880. Neck.C0 = clerp(Neck.C0, NeckCF * CFrame.new(0, 0, 0 + 0.02 * math.cos(sine / 3.5)) * angles(math.rad(-10 + 3.5 * math.cos(sine / 3.5)), math.rad(0 - 0 * math.cos(sine / 3.5)), math.rad(-8 * math.cos(sine / 7)) + RootPart.RotVelocity.Y / 16), 0.2)
  1881. RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.5, -.0) * angles(math.rad(-10.5 * math.cos(sine / 7*2)) ,math.rad(-70-5 * math.cos(sine / 7)), math.rad(80) - RootPart.RotVelocity.Y / 90), 0.2)
  1882. LW.C0 = clerp(LW.C0, CFrame.new(-1.45, 0.5, -.0) * angles(math.rad(-10.5 * math.cos(sine / 7*2)),math.rad(70-5 * math.cos(sine / 7)), math.rad(-80) - RootPart.RotVelocity.Y / 90), 0.2)
  1883. RH.C0 = RH.C0:lerp( cf(.5, -0.625 - 1 * math.cos(sine / 7) / 2,-0.1+ 0.5 * math.cos(sine / 7) / 2) * CFrame.Angles(math.rad(-26.5 - 80 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 10 * math.cos(sine / 7)), math.rad(0)) * CFrame.Angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(-90) + RootPart.RotVelocity.Y / 50, math.rad(1 * math.cos(sine / 7))), 0.2)
  1884. LH.C0 = LH.C0:lerp( cf(-.5, -0.625 + 1 * math.cos(sine / 7) / 2,-0.1+ -0.5 * math.cos(sine / 7) / 2) * CFrame.Angles(math.rad(-26.5 + 80 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 10 * math.cos(sine / 7)), math.rad(0)) * CFrame.Angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(90) + RootPart.RotVelocity.Y / 50, math.rad(1 * math.cos(sine / 7))), 0.2)
  1885.  
  1886. else
  1887. Humanoid.WalkSpeed = 12
  1888. Humanoid.JumpPower = 60
  1889.  
  1890. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.15 + 0.0 * math.cos(sine / 8)) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad((0 + 0* math.cos(sine / 8)/20)), math.rad(0)), .15)
  1891. Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(3.5 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(-0 - 0 * math.cos(sine / 8/3))), .15)
  1892. RW.C0 = clerp(RW.C0, CFrame.new(1.5 , 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(0), math.rad(90 + 0 * math.cos(sine / 8))), 0.15)
  1893. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.0) * angles(math.rad(0 - 0 * math.cos(sine / 8)), math.rad(-0), math.rad(-90 - 0 * math.cos(sine / 8))), 0.15)
  1894. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 8))),.15)
  1895. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.90- 0.0 * math.cos(sine / 8), 0) * CFrame.Angles(math.rad(1.5 - 0 * math.cos(sine / 8)),math.rad(0),math.rad(-2.5- 0.0 * math.cos(sine / 8))),.15)
  1896.  
  1897.  
  1898.  
  1899.  
  1900. end
  1901. end
  1902. end
  1903. end))
  1904.  
  1905.  
  1906. coroutine.resume(coroutine.create(function()
  1907. local remote = Instance.new 'RemoteFunction';
  1908. remote.Parent = Character;
  1909. remote.OnServerInvoke = function (player, request, ...)
  1910. if (player ~= Player) then
  1911. return error ('You cannot invoke this remote', 0);
  1912. end;
  1913.  
  1914.  
  1915.  
  1916. if (request == 1) then
  1917. local k = ...;
  1918.  
  1919. KeyDown(k)
  1920.  
  1921.  
  1922.  
  1923. end;
  1924. if (request == 2) then
  1925. local k = ...;
  1926.  
  1927. --KeyUp(k)
  1928.  
  1929.  
  1930.  
  1931. end;
  1932. if (request == 3) then
  1933. local k = ...;
  1934. if k == "Down" then
  1935. --MouseDown(k)
  1936. elseif k == "Up" then
  1937. --MouseUp(k)
  1938. end
  1939. end;
  1940.  
  1941.  
  1942. if (request == 4) then
  1943. local k=...;
  1944. --MTARGET=k
  1945. end
  1946. if (request == 5) then
  1947. local k=...;
  1948. --MHIT=k
  1949.  
  1950. end
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956. end;
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970. remote.Name = 'ServerRemote';
  1971. --local remote = NLS ([=[
  1972. local localscript = script.Keys
  1973. localscript.Name = Player.Name
  1974. localscript.Parent = Character
  1975.  
  1976. --]=], Player.Character)
  1977. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement