Advertisement
Freightus2

Wretch Leak Void Script Builder

May 6th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.28 KB | None | 0 0
  1. Wow, 825 looks! it felt like just a little while ago I created this paste account, but people seem to enjoy it!
  2. Here, enjoy the Wretch script!
  3. repeat wait() until script:WaitForChild'Owner'.Value
  4. local Player = script:WaitForChild'Owner'.Value
  5. script.Owner:destroy()
  6. local FakeMouse = script.FakeMouse:Clone();
  7. FakeMouse.Parent = Player.Character;
  8. script.FakeMouse:Destroy()
  9. do
  10. local GUID = {}
  11. do
  12. GUID.IDs = {};
  13. function GUID:new(len)
  14. local id;
  15. if(not len)then
  16. id = (tostring(function() end))
  17. id = id:gsub("function: ","")
  18. else
  19. local function genID(len)
  20. local newID = ""
  21. for i = 1,len do
  22. newID = newID..string.char(math.random(48,90))
  23. end
  24. return newID
  25. end
  26. repeat id = genID(len) until not GUID.IDs[id]
  27. local oid = id;
  28. id = {Trash=function() GUID.IDs[oid]=nil; end;Get=function() return oid; end}
  29. GUID.IDs[oid]=true;
  30. end
  31. return id
  32. end
  33. end
  34.  
  35. local AHB = Instance.new("BindableEvent")
  36.  
  37. local FPS = 30
  38.  
  39. local TimeFrame = 0
  40.  
  41. local LastFrame = tick()
  42. local Frame = 1/FPS
  43.  
  44. game:service'RunService'.Heartbeat:connect(function(s,p)
  45. TimeFrame = TimeFrame + s
  46. if(TimeFrame >= Frame)then
  47. for i = 1,math.floor(TimeFrame/Frame) do
  48. AHB:Fire()
  49. end
  50. LastFrame=tick()
  51. TimeFrame=TimeFrame-Frame*math.floor(TimeFrame/Frame)
  52. end
  53. end)
  54.  
  55.  
  56. function swait(dur)
  57. if(dur == 0 or typeof(dur) ~= 'number')then
  58. AHB.Event:wait()
  59. else
  60. for i = 1, dur*FPS do
  61. AHB.Event:wait()
  62. end
  63. end
  64. end
  65.  
  66. local oPlayer = Player
  67. local Player = oPlayer
  68.  
  69. local loudnesses={}
  70. script.Parent = Player.Character
  71. local CoAS = {Actions={}}
  72. local Event = Instance.new("RemoteEvent")
  73. Event.Name = "UserInputEvent"
  74. Event.Parent = Player.Character
  75. local Func = Instance.new("RemoteFunction")
  76. Func.Name = "GetClientProperty"
  77. Func.Parent = Player.Character
  78. local fakeEvent = function()
  79. local t = {_fakeEvent=true,Waited={},Connected={}}
  80. t.Connect = function(self,f)
  81. local ft={}
  82. ft={Disconnected=false;disconnect=function(s) if(self.Function==ft)then self.Function=nil end s.Disconnected=true end}
  83. ft.Disconnect=ft.disconnect
  84.  
  85. ft.Func=function(...)
  86. for id,_ in next, t.Waited do
  87. t.Waited[id] = true
  88. end
  89. return f(...)
  90. end;
  91.  
  92. table.insert(self.Connected,ft)
  93. return ft;
  94. end
  95. t.connect = t.Connect
  96. t.Wait = function()
  97. local guid = GUID:new(25)
  98. local waitingId = guid:Get()
  99. t.Waited[waitingId]=false
  100. repeat swait() until t.Waited[waitingId]==true
  101. t.Waited[waitingId]=nil;
  102. guid:Trash()
  103. end
  104. t.wait = t.Wait
  105. return t
  106. end
  107. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  108. local UsIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  109. local Run = {RenderStepped=fakeEvent()}
  110.  
  111. function CoAS:BindAction(name,fun,touch,...)
  112. CoAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  113. end
  114. function CoAS:UnbindAction(name)
  115. CoAS.Actions[name] = nil
  116. end
  117. local function te(self,ev,...)
  118. local t = self[ev]
  119. if t and t._fakeEvent and t.Connected then
  120. for i,v in next, t.Connected do
  121. if(v.Func and not v.Disconnected)then
  122. v.Func(...)
  123. else
  124. t.Connected[i]=nil
  125. end
  126. end
  127. end
  128. end
  129. m.TrigEvent = te
  130. UsIS.TrigEvent = te
  131. Run.TrigEvent = te
  132. Event.OnServerEvent:Connect(function(plr,io)
  133. if plr~=Player then return end
  134. --[[table.foreach(io,print)
  135. print'---']]
  136. if io.Mouse then
  137. m.Target = io.Target
  138. m.Hit = io.Hit
  139. elseif io.KeyEvent then
  140. m:TrigEvent('Key'..io.KeyEvent,io.Key)
  141. elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  142. if io.UserInputState == Enum.UserInputState.Begin then
  143. m:TrigEvent("Button1Down")
  144. else
  145. m:TrigEvent("Button1Up")
  146. end
  147. end
  148. if(not io.KeyEvent and not io.Mouse)then
  149.  
  150. for n,t in pairs(CoAS.Actions) do
  151. for _,k in pairs(t.Keys) do
  152. if k==io.KeyCode then
  153. t.Function(t.Name,io.UserInputState,io)
  154. end
  155. end
  156. end
  157. if io.UserInputState == Enum.UserInputState.Begin then
  158. UsIS:TrigEvent("InputBegan",io,false)
  159. else
  160. UsIS:TrigEvent("InputEnded",io,false)
  161. end
  162. end
  163. end)
  164.  
  165. Func.OnServerInvoke = function(plr,inst,play)
  166. if plr~=Player then return end
  167. if(inst and typeof(inst) == 'Instance' and inst:IsA'Sound')then
  168. loudnesses[inst]=play
  169. end
  170. end
  171.  
  172. function GetClientProperty(inst,prop)
  173. if(prop == 'PlaybackLoudness' and loudnesses[inst])then
  174. return loudnesses[inst]
  175. elseif(prop == 'PlaybackLoudness')then
  176. return Func:InvokeClient(Player,'RegSound',inst)
  177. end
  178. return Func:InvokeClient(Player,inst,prop)
  179. end
  180. local oldGame = game;
  181. function GetFakePlayer()
  182. local oldPlayer = Player;
  183. local fakePlayer = newproxy(true)
  184. getmetatable(fakePlayer).__index = function(s,i)
  185. if(i == 'GetMouse')then
  186. return function() return m; end
  187. end
  188. return Player[i]
  189. end
  190. getmetatable(fakePlayer).__newindex = function(s,i,v)
  191. Player[i]=v
  192. end
  193. getmetatable(fakePlayer).__call=function(self,...)
  194. if(self == fakePlayer)then self = Player end
  195. local wh = {...}
  196. local name = table.remove(wh,1)
  197. for i,v in next, wh do
  198. wh[i]=v
  199. end
  200. if(name == 'GetMouse')then
  201. return m;
  202. end
  203. return self(name,unpack(wh))
  204. end
  205. getmetatable(fakePlayer).__namecall=function(self,...)
  206. if(self == fakePlayer)then self = Player end
  207. local tuple={...}
  208. local name = table.remove(tuple,#tuple)
  209.  
  210. if(name == 'GetMouse')then
  211. return m;
  212. else
  213. return self[name](self,unpack(tuple))
  214. end
  215. end
  216.  
  217. return fakePlayer
  218. end
  219. local oll = LoadLibrary;
  220. function LoadLibrary(libtard)
  221. local libtarddestroyed=oll(libtard)
  222. if(libtard=='RbxUtility')then
  223. local library={Create=function(obj)
  224. local inst = Instance.new(obj)
  225. return function(props)
  226. for prop,valu in next, props do
  227. inst[prop]=valu
  228. end
  229. return inst
  230. end
  231. end}
  232. setmetatable(library,{__index=libtarddestroyed,__newindex=function(s,i,v) libtarddestroyed[i]=v end})
  233.  
  234. return library
  235. else
  236. return libtarddestroyed
  237. end
  238. end
  239. fakePlayer = GetFakePlayer()
  240. local function GetService(s,i)
  241. local service = s:GetService(i)
  242. if(i == 'Players')then
  243. local oldService = service;
  244. local fakeService = newproxy(true)
  245. getmetatable(fakeService).__index = function(s,i)
  246. if(s == fakeService)then s=oldService end
  247. if(i == 'LocalPlayer' or i == 'localPlayer')then
  248. return fakePlayer
  249. elseif(i == 'oPlayer')then
  250. return oPlayer
  251. else
  252. return s[i]
  253. end
  254. end
  255. getmetatable(fakeService).__newindex = function(s,i,v)
  256. if(s == fakeService)then s=oldService end
  257. s[i]=v
  258. end
  259. getmetatable(fakeService).__call=function(self,...)
  260. if(self == fakeService)then self = oldService end
  261. local wh = {...}
  262. local name = table.remove(wh,1)
  263. for i,v in next, wh do
  264. wh[i]=v
  265. end
  266. return self(name,unpack(wh))
  267. end
  268. getmetatable(fakeService).__namecall=function(self,...)
  269. if(self == fakeService)then self = oldService end
  270. local tuple={...}
  271. local name = table.remove(tuple,#tuple)
  272.  
  273. return self[name](self,unpack(tuple))
  274. end
  275. getmetatable(fakeService).__metatable = 'gay'
  276. return fakeService
  277. elseif(i == 'RunService')then
  278. local oldService = service;
  279. local fakeService = newproxy(true)
  280. getmetatable(fakeService).__index = function(s,i)
  281. if(s == fakeService)then s=oldService end
  282. return Run[i] or s[i]
  283. end
  284. getmetatable(fakeService).__newindex = function(s,i,v)
  285. if(s == fakeService)then s=oldService end
  286. s[i]=v
  287. end
  288. getmetatable(fakeService).__call=function(self,...)
  289. if(self == fakeService)then self = oldService end
  290. local wh = {...}
  291. local name = table.remove(wh,1)
  292. for i,v in next, wh do
  293. wh[i]=v
  294. end
  295. return self(name,unpack(wh))
  296. end
  297. getmetatable(fakeService).__namecall=function(self,...)
  298. if(self == fakeService)then self = oldService end
  299. local tuple={...}
  300. local name = table.remove(tuple,#tuple)
  301.  
  302. return self[name](self,unpack(tuple))
  303. end
  304. getmetatable(fakeService).__metatable = 'gay'
  305. return fakeService
  306. elseif(i == 'UserInputService')then
  307. return UsIS
  308. elseif(i == 'ContextActionService')then
  309. return CoAS;
  310. else
  311. return service
  312. end
  313. end
  314.  
  315. local new = Instance.new;
  316. Instance = {}
  317. Instance.new = function(inst,obje)
  318. local lp = GetService(oldGame,'Players').localPlayer
  319. local instance = new(inst)
  320. if(inst=='ObjectValue')then
  321. local fake = newproxy(true)
  322. getmetatable(fake).__index=function(self,index)
  323. if(self==fake)then self=instance end
  324. return self[index]
  325. end
  326. getmetatable(fake).__newindex=function(self,index,value)
  327. if(self==fake)then self=instance end
  328. if(index=='Value' and typeof(value)~='Instance' and value==fakePlayer)then
  329. self[index]=oPlayer
  330. else
  331. self[index]=value
  332. end
  333. end
  334. getmetatable(fake).__call=function(self,...)
  335. if(self == fake)then self = instance end
  336. local wh = {...}
  337. local name = table.remove(wh,1)
  338. for i,v in next, wh do
  339. if(v == fake)then v = instance end
  340. wh[i]=v
  341. end
  342. return self(name,unpack(wh))
  343. end
  344. getmetatable(fake). __namecall=function(self,...)
  345. if(self == fake)then self = instance end
  346. local tuple={...}
  347. local name = table.remove(tuple,#tuple)
  348. return self[name](self,unpack(tuple))
  349. end
  350. return fake
  351. else
  352. instance.Parent = obje
  353. return instance;
  354. end
  355.  
  356. end
  357. local serviceFunctions={
  358. service=true,
  359. GetService=true,
  360. }
  361. local fakeGame = newproxy(true)
  362. getmetatable(fakeGame).__index = function(s,i)
  363. if(s == fakeGame)then s=oldGame end
  364. local serv = GetService(oldGame,i)
  365. if serviceFunctions[i] then
  366. return GetService
  367. elseif(serv)then
  368. return serv
  369. else
  370. return s[i]
  371. end
  372. end
  373. getmetatable(fakeGame).__newindex = function(s,i,v)
  374. if(s == fakeGame)then s=oldGame end
  375. s[i]=v
  376. end
  377. getmetatable(fakeGame).__call=function(self,...)
  378. if(self == fakeGame)then self = oldGame end
  379. local wh = {...}
  380. local name = table.remove(wh,1)
  381. for i,v in next, wh do
  382. if(v == fakeGame)then v = oldGame end
  383. wh[i]=v
  384. end
  385. if serviceFunctions[name] then
  386. return GetService(self,unpack(wh))
  387. else
  388. return self(name,unpack(wh))
  389. end
  390. end
  391. getmetatable(fakeGame). __namecall=function(self,...)
  392. if(self == fakeGame)then self = oldGame end
  393. local tuple={...}
  394. local name = table.remove(tuple,#tuple)
  395.  
  396. local funcToCall=self[name]
  397.  
  398. if serviceFunctions[name] then
  399. return GetService(self,unpack(tuple))
  400. else
  401. return self[name](self,unpack(tuple))
  402. end
  403. end
  404. getmetatable(fakeGame).__metatable = 'gay'
  405.  
  406. coroutine.wrap(function()
  407. while true do
  408. Run:TrigEvent('RenderStepped')
  409. swait()
  410. end
  411. end)()
  412. game=fakeGame
  413. UserInputService,ContextActionService = UsIS,CoAS
  414. end
  415. --//====================================================\\--
  416. --|| CREATED BY SHACKLUSTER
  417. --\\====================================================//--
  418.  
  419. wait(0.2)
  420.  
  421. Player = game:GetService("Players").LocalPlayer
  422. PlayerGui = Player.PlayerGui
  423. Cam = workspace.CurrentCamera
  424. Backpack = Player.Backpack
  425. Character = Player.Character
  426. Humanoid = Character.Humanoid
  427. Mouse = Player:GetMouse()
  428. RootPart = Character["HumanoidRootPart"]
  429. Torso = Character["Torso"]
  430. Head = Character["Head"]
  431. RightArm = Character["Right Arm"]
  432. LeftArm = Character["Left Arm"]
  433. RightLeg = Character["Right Leg"]
  434. LeftLeg = Character["Left Leg"]
  435. RootJoint = RootPart["RootJoint"]
  436. Neck = Torso["Neck"]
  437. RightShoulder = Torso["Right Shoulder"]
  438. LeftShoulder = Torso["Left Shoulder"]
  439. RightHip = Torso["Right Hip"]
  440. LeftHip = Torso["Left Hip"]
  441. local sick = Instance.new("Sound",Character)
  442.  
  443. IT = Instance.new
  444. CF = CFrame.new
  445. VT = Vector3.new
  446. RAD = math.rad
  447. C3 = Color3.new
  448. UD2 = UDim2.new
  449. BRICKC = BrickColor.new
  450. ANGLES = CFrame.Angles
  451. EULER = CFrame.fromEulerAnglesXYZ
  452. COS = math.cos
  453. ACOS = math.acos
  454. SIN = math.sin
  455. ASIN = math.asin
  456. ABS = math.abs
  457. MRANDOM = math.random
  458. FLOOR = math.floor
  459.  
  460. --//=================================\\
  461. --|| USEFUL VALUES
  462. --\\=================================//
  463.  
  464. Animation_Speed = 3
  465. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  466. local Speed = 22
  467. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  468. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  469. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  470. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  471. local DAMAGEMULTIPLIER = 1
  472. local ANIM = "Idle"
  473. local ATTACK = false
  474. local EQUIPPED = false
  475. local HOLD = false
  476. local COMBO = 1
  477. local Rooted = false
  478. local SINE = 0
  479. local KEYHOLD = false
  480. local CHANGE = 2 / Animation_Speed
  481. local WALKINGANIM = false
  482. local VALUE1 = false
  483. local VALUE2 = false
  484. local ROBLOXIDLEANIMATION = IT("Animation")
  485. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  486. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  487. --ROBLOXIDLEANIMATION.Parent = Humanoid
  488. local WEAPONGUI = IT("ScreenGui", PlayerGui)
  489. WEAPONGUI.Name = "Weapon GUI"
  490. local Effects = IT("Folder", Character)
  491. Effects.Name = "Effects"
  492. local ANIMATOR = Humanoid.Animator
  493. local ANIMATE = Character.Animate
  494. local UNANCHOR = true
  495.  
  496. --//=================================\\
  497. --\\=================================//
  498.  
  499.  
  500. --//=================================\\
  501. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  502. --\\=================================//
  503.  
  504. ArtificialHB = Instance.new("BindableEvent", script)
  505. ArtificialHB.Name = "ArtificialHB"
  506.  
  507. script:WaitForChild("ArtificialHB")
  508.  
  509. frame = Frame_Speed
  510. tf = 0
  511. allowframeloss = false
  512. tossremainder = false
  513. lastframe = tick()
  514. script.ArtificialHB:Fire()
  515.  
  516. game:GetService("RunService").Heartbeat:connect(function(s, p)
  517. tf = tf + s
  518. if tf >= frame then
  519. if allowframeloss then
  520. script.ArtificialHB:Fire()
  521. lastframe = tick()
  522. else
  523. for i = 1, math.floor(tf / frame) do
  524. script.ArtificialHB:Fire()
  525. end
  526. lastframe = tick()
  527. end
  528. if tossremainder then
  529. tf = 0
  530. else
  531. tf = tf - frame * math.floor(tf / frame)
  532. end
  533. end
  534. end)
  535.  
  536. --//=================================\\
  537. --\\=================================//
  538.  
  539. --//=================================\\
  540. --|| SOME FUNCTIONS
  541. --\\=================================//
  542.  
  543. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  544. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  545. end
  546.  
  547. function PositiveAngle(NUMBER)
  548. if NUMBER >= 0 then
  549. NUMBER = 0
  550. end
  551. return NUMBER
  552. end
  553.  
  554. function NegativeAngle(NUMBER)
  555. if NUMBER <= 0 then
  556. NUMBER = 0
  557. end
  558. return NUMBER
  559. end
  560.  
  561. function Swait(NUMBER)
  562. if NUMBER == 0 or NUMBER == nil then
  563. ArtificialHB.Event:wait()
  564. else
  565. for i = 1, NUMBER do
  566. ArtificialHB.Event:wait()
  567. end
  568. end
  569. end
  570.  
  571. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  572. local NEWMESH = IT(MESH)
  573. if MESH == "SpecialMesh" then
  574. NEWMESH.MeshType = MESHTYPE
  575. if MESHID ~= "nil" and MESHID ~= "" then
  576. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  577. end
  578. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  579. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  580. end
  581. end
  582. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  583. NEWMESH.Scale = SCALE
  584. NEWMESH.Parent = PARENT
  585. return NEWMESH
  586. end
  587.  
  588. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  589. local NEWPART = IT("Part")
  590. NEWPART.formFactor = FORMFACTOR
  591. NEWPART.Reflectance = REFLECTANCE
  592. NEWPART.Transparency = TRANSPARENCY
  593. NEWPART.CanCollide = false
  594. NEWPART.Locked = true
  595. NEWPART.Anchored = true
  596. if ANCHOR == false then
  597. NEWPART.Anchored = false
  598. end
  599. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  600. NEWPART.Name = NAME
  601. NEWPART.Size = SIZE
  602. NEWPART.Position = Torso.Position
  603. NEWPART.Material = MATERIAL
  604. NEWPART:BreakJoints()
  605. NEWPART.Parent = PARENT
  606. return NEWPART
  607. end
  608.  
  609. local function weldBetween(a, b)
  610. local weldd = Instance.new("ManualWeld")
  611. weldd.Part0 = a
  612. weldd.Part1 = b
  613. weldd.C0 = CFrame.new()
  614. weldd.C1 = b.CFrame:inverse() * a.CFrame
  615. weldd.Parent = a
  616. return weldd
  617. end
  618.  
  619.  
  620. function QuaternionFromCFrame(cf)
  621. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  622. local trace = m00 + m11 + m22
  623. if trace > 0 then
  624. local s = math.sqrt(1 + trace)
  625. local recip = 0.5 / s
  626. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  627. else
  628. local i = 0
  629. if m11 > m00 then
  630. i = 1
  631. end
  632. if m22 > (i == 0 and m00 or m11) then
  633. i = 2
  634. end
  635. if i == 0 then
  636. local s = math.sqrt(m00 - m11 - m22 + 1)
  637. local recip = 0.5 / s
  638. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  639. elseif i == 1 then
  640. local s = math.sqrt(m11 - m22 - m00 + 1)
  641. local recip = 0.5 / s
  642. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  643. elseif i == 2 then
  644. local s = math.sqrt(m22 - m00 - m11 + 1)
  645. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  646. end
  647. end
  648. end
  649.  
  650. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  651. local xs, ys, zs = x + x, y + y, z + z
  652. local wx, wy, wz = w * xs, w * ys, w * zs
  653. local xx = x * xs
  654. local xy = x * ys
  655. local xz = x * zs
  656. local yy = y * ys
  657. local yz = y * zs
  658. local zz = z * zs
  659. 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))
  660. end
  661.  
  662. function QuaternionSlerp(a, b, t)
  663. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  664. local startInterp, finishInterp;
  665. if cosTheta >= 0.0001 then
  666. if (1 - cosTheta) > 0.0001 then
  667. local theta = ACOS(cosTheta)
  668. local invSinTheta = 1 / SIN(theta)
  669. startInterp = SIN((1 - t) * theta) * invSinTheta
  670. finishInterp = SIN(t * theta) * invSinTheta
  671. else
  672. startInterp = 1 - t
  673. finishInterp = t
  674. end
  675. else
  676. if (1 + cosTheta) > 0.0001 then
  677. local theta = ACOS(-cosTheta)
  678. local invSinTheta = 1 / SIN(theta)
  679. startInterp = SIN((t - 1) * theta) * invSinTheta
  680. finishInterp = SIN(t * theta) * invSinTheta
  681. else
  682. startInterp = t - 1
  683. finishInterp = t
  684. end
  685. end
  686. 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
  687. end
  688.  
  689. function Clerp(a, b, t)
  690. local qa = {QuaternionFromCFrame(a)}
  691. local qb = {QuaternionFromCFrame(b)}
  692. local ax, ay, az = a.x, a.y, a.z
  693. local bx, by, bz = b.x, b.y, b.z
  694. local _t = 1 - t
  695. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  696. end
  697.  
  698. function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
  699. local frame = IT("Frame")
  700. frame.BackgroundTransparency = TRANSPARENCY
  701. frame.BorderSizePixel = BORDERSIZEPIXEL
  702. frame.Position = POSITION
  703. frame.Size = SIZE
  704. frame.BackgroundColor3 = COLOR
  705. frame.BorderColor3 = BORDERCOLOR
  706. frame.Name = NAME
  707. frame.Parent = PARENT
  708. return frame
  709. end
  710.  
  711. function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
  712. local label = IT("TextLabel")
  713. label.BackgroundTransparency = 1
  714. label.Size = UD2(1, 0, 1, 0)
  715. label.Position = UD2(0, 0, 0, 0)
  716. label.TextColor3 = TEXTCOLOR
  717. label.TextStrokeTransparency = STROKETRANSPARENCY
  718. label.TextTransparency = TRANSPARENCY
  719. label.FontSize = TEXTFONTSIZE
  720. label.Font = TEXTFONT
  721. label.BorderSizePixel = BORDERSIZEPIXEL
  722. label.TextScaled = false
  723. label.Text = TEXT
  724. label.Name = NAME
  725. label.Parent = PARENT
  726. return label
  727. end
  728.  
  729. function NoOutlines(PART)
  730. PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
  731. end
  732.  
  733. function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
  734. local NEWWELD = IT(TYPE)
  735. NEWWELD.Part0 = PART0
  736. NEWWELD.Part1 = PART1
  737. NEWWELD.C0 = C0
  738. NEWWELD.C1 = C1
  739. NEWWELD.Parent = PARENT
  740. return NEWWELD
  741. end
  742.  
  743. local S = IT("Sound")
  744. function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
  745. local NEWSOUND = nil
  746. coroutine.resume(coroutine.create(function()
  747. NEWSOUND = S:Clone()
  748. NEWSOUND.Parent = PARENT
  749. NEWSOUND.Volume = VOLUME
  750. NEWSOUND.Pitch = PITCH
  751. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  752. NEWSOUND:play()
  753. if DOESLOOP == true then
  754. NEWSOUND.Looped = true
  755. else
  756. repeat wait(1) until NEWSOUND.Playing == false
  757. NEWSOUND:remove()
  758. end
  759. end))
  760. return NEWSOUND
  761. end
  762.  
  763. function CFrameFromTopBack(at, top, back)
  764. local right = top:Cross(back)
  765. return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  766. end
  767.  
  768. --WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
  769. function WACKYEFFECT(Table)
  770. local TYPE = (Table.EffectType or "Sphere")
  771. local SIZE = (Table.Size or VT(1,1,1))
  772. local ENDSIZE = (Table.Size2 or VT(0,0,0))
  773. local TRANSPARENCY = (Table.Transparency or 0)
  774. local ENDTRANSPARENCY = (Table.Transparency2 or 1)
  775. local CFRAME = (Table.CFrame or Torso.CFrame)
  776. local MOVEDIRECTION = (Table.MoveToPos or nil)
  777. local ROTATION1 = (Table.RotationX or 0)
  778. local ROTATION2 = (Table.RotationY or 0)
  779. local ROTATION3 = (Table.RotationZ or 0)
  780. local MATERIAL = (Table.Material or "Neon")
  781. local COLOR = (Table.Color or C3(1,1,1))
  782. local TIME = (Table.Time or 45)
  783. local SOUNDID = (Table.SoundID or nil)
  784. local SOUNDPITCH = (Table.SoundPitch or nil)
  785. local SOUNDVOLUME = (Table.SoundVolume or nil)
  786. coroutine.resume(coroutine.create(function()
  787. local PLAYSSOUND = false
  788. local SOUND = nil
  789. local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
  790. if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
  791. PLAYSSOUND = true
  792. SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
  793. end
  794. EFFECT.Color = COLOR
  795. local MSH = nil
  796. if TYPE == "Sphere" then
  797. MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
  798. elseif TYPE == "Block" then
  799. MSH = IT("BlockMesh",EFFECT)
  800. MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
  801. elseif TYPE == "Wave" then
  802. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
  803. elseif TYPE == "Ring" then
  804. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
  805. elseif TYPE == "Slash" then
  806. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  807. elseif TYPE == "Round Slash" then
  808. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  809. elseif TYPE == "Swirl" then
  810. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
  811. elseif TYPE == "Skull" then
  812. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
  813. elseif TYPE == "Crystal" then
  814. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
  815. end
  816. if MSH ~= nil then
  817. local MOVESPEED = nil
  818. if MOVEDIRECTION ~= nil then
  819. MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
  820. end
  821. local GROWTH = SIZE - ENDSIZE
  822. local TRANS = TRANSPARENCY - ENDTRANSPARENCY
  823. if TYPE == "Block" then
  824. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  825. else
  826. EFFECT.CFrame = CFRAME
  827. end
  828. for LOOP = 1, TIME+1 do
  829. Swait()
  830. MSH.Scale = MSH.Scale - GROWTH/TIME
  831. if TYPE == "Wave" then
  832. MSH.Offset = VT(0,0,-MSH.Scale.X/8)
  833. end
  834. EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
  835. if TYPE == "Block" then
  836. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  837. else
  838. EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
  839. end
  840. if MOVEDIRECTION ~= nil then
  841. local ORI = EFFECT.Orientation
  842. EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
  843. EFFECT.Orientation = ORI
  844. end
  845. end
  846. if PLAYSSOUND == false then
  847. EFFECT:remove()
  848. else
  849. repeat Swait() until SOUND.Playing == false
  850. EFFECT:remove()
  851. end
  852. else
  853. if PLAYSSOUND == false then
  854. EFFECT:remove()
  855. else
  856. repeat Swait() until SOUND.Playing == false
  857. EFFECT:remove()
  858. end
  859. end
  860. end))
  861. end
  862.  
  863. function PuddleOfBlood(Position,MaxDrop,Model,MaxSize)
  864. local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model)
  865. if HITFLOOR ~= nil then
  866. if HITFLOOR.Parent ~= Character then
  867. if HITFLOOR.Name == "BloodPuddle" then
  868. local DIST = (Position - HITFLOOR.Position).Magnitude
  869. if (HITFLOOR.Size.Z <= 5 and HITFLOOR.Size.Z < MaxSize) or (HITFLOOR.Size.Z > 5 and HITFLOOR.Size.Z < MaxSize and DIST < HITFLOOR.Size.Z/3) then
  870. HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1)
  871. end
  872. else
  873. if HITFLOOR.Anchored == true then
  874. local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2))
  875. BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0))
  876. MakeForm(BLOOD,"Cyl")
  877. coroutine.resume(coroutine.create(function()
  878. Swait(75)
  879. while true do
  880. Swait()
  881. BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02)
  882. if BLOOD.Size.Z < 0.051 then
  883. BLOOD:remove()
  884. break
  885. end
  886. end
  887. end))
  888. end
  889. end
  890. end
  891. end
  892. end
  893.  
  894. function SprayBlood(POSITION,DIRECTION,BloodSize)
  895. local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.3,0.3,0.3),false)
  896. BLOOD.CFrame = CF(POSITION)
  897. MakeForm(BLOOD,"Ball")
  898. local bv = Instance.new("BodyVelocity",BLOOD)
  899. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  900. bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*15
  901. bv.Name = "MOVE"
  902. Debris:AddItem(bv,0.05)
  903. coroutine.resume(coroutine.create(function()
  904. local HASTOUCHEDGROUND = false
  905. local HIT = BLOOD.Touched:Connect(function(hit)
  906. if hit.Anchored == true then
  907. HASTOUCHEDGROUND = true
  908. PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize)
  909. end
  910. end)
  911. wait(5)
  912. if HASTOUCHEDGROUND == false then
  913. BLOOD:remove()
  914. end
  915. end))
  916. end
  917.  
  918. function MakeForm(PART,TYPE)
  919. if TYPE == "Cyl" then
  920. local MSH = IT("CylinderMesh",PART)
  921. elseif TYPE == "Ball" then
  922. local MSH = IT("SpecialMesh",PART)
  923. MSH.MeshType = "Sphere"
  924. elseif TYPE == "Wedge" then
  925. local MSH = IT("SpecialMesh",PART)
  926. MSH.MeshType = "Wedge"
  927. end
  928. end
  929.  
  930. Debris = game:GetService("Debris")
  931.  
  932. function CastProperRay(StartPos, EndPos, Distance, Ignore)
  933. local DIRECTION = CF(StartPos,EndPos).lookVector
  934. return Raycast(StartPos, DIRECTION, Distance, Ignore)
  935. end
  936.  
  937. --//=================================\\
  938. --|| WEAPON CREATION
  939. --\\=================================//
  940.  
  941. local SCYTHE = script.Scythe
  942. SCYTHE.Parent = Character
  943. SCYTHE:SetPrimaryPartCFrame(RightArm.CFrame*CF(0,-1,0))
  944. local WELD = CreateWeldOrSnapOrMotor("Weld", RightArm, RightArm, SCYTHE.Grip, CF(0, -1, 0), CF(0, 0, 0))
  945. local HAND = script.Hand
  946. HAND.Parent = Character
  947. HAND:SetPrimaryPartCFrame(RightArm.CFrame)
  948. CreateWeldOrSnapOrMotor("Weld", RightArm, RightArm, HAND.Base, CF(0, 0, 0), CF(0, 0, 0))
  949. local HAND = script.LeftArm
  950. HAND.Parent = Character
  951. HAND:SetPrimaryPartCFrame(LeftArm.CFrame)
  952. CreateWeldOrSnapOrMotor("Weld", LeftArm, LeftArm, HAND.Base, CF(0, 0, 0), CF(0, 0, 0))
  953. local CHEST = script.Chest
  954. CHEST.Parent = Character
  955. CHEST:SetPrimaryPartCFrame(Torso.CFrame)
  956. CreateWeldOrSnapOrMotor("Weld", Torso, Torso, CHEST.Base, CF(0, 0, 0), CF(0, 0, 0))
  957. local MASK = script.Mask
  958. MASK.Parent = Character
  959. MASK:SetPrimaryPartCFrame(Head.CFrame)
  960. CreateWeldOrSnapOrMotor("Weld", Head, Head, MASK.Base, CF(0, 0, 0), CF(0, 0, 0))
  961.  
  962. Humanoid.Died:connect(function()
  963. ATTACK = true
  964. end)
  965.  
  966. --//=================================\\
  967. --|| DAMAGING
  968. --\\=================================//
  969.  
  970. function ApplyDamage(Humanoid,Damage)
  971. Damage = Damage * DAMAGEMULTIPLIER
  972. if Humanoid.Health ~= 0 and Humanoid.MaxHealth ~= math.huge then
  973. local MULTIPLIER = Humanoid.MaxHealth/100
  974. Humanoid.Health = Humanoid.Health - (Damage*MULTIPLIER)
  975. else
  976. Humanoid.Parent:BreakJoints()
  977. end
  978. end
  979.  
  980. function Illness(Victim,IsAlwaysFatal)
  981. coroutine.resume(coroutine.create(function()
  982. if Victim:FindFirstChild("Disease") == nil then
  983. local Disease = IT("Folder",Victim)
  984. Disease.Name = "Disease"
  985. if IsAlwaysFatal == false then
  986. Debris:AddItem(Disease,MRANDOM(20,30))
  987. end
  988. local HEAD = Victim:FindFirstChild("Head")
  989. local HUMAN = Victim:FindFirstChildOfClass("Humanoid")
  990. if HEAD and HUMAN then
  991. local SPEED = HUMAN.WalkSpeed
  992. if HUMAN.Health > 0 then
  993. local ITEM = IT("Attachment",HEAD)
  994. local S = script.Smoke:Clone()
  995. S.Parent = ITEM
  996. S.Enabled = true
  997. local COUGHS = CreateSound(178522287, HEAD, 6, 1, true)
  998. repeat
  999. Swait()
  1000. HUMAN.WalkSpeed = 6
  1001. COUGHS.Parent = HEAD
  1002. if MRANDOM(1,160) == 1 or IsAlwaysFatal == true then
  1003. COUGHS.Playing = false
  1004. HUMAN.WalkSpeed = 0
  1005. CreateSound(356551938, HEAD, 4, MRANDOM(8,13)/10, false)
  1006. if IsAlwaysFatal == false then
  1007. for i = 1, MRANDOM(3,5) do
  1008. Swait()
  1009. ApplyDamage(HUMAN,MRANDOM(1,2))
  1010. SprayBlood(HEAD.CFrame*CF(0,-HEAD.Size.Y/3,-HEAD.Size.Z/2).p,HEAD.CFrame*CF(MRANDOM(-3,3)/15,HEAD.Size.Y+MRANDOM(-4,2)/35,-HEAD.Size.Z*MRANDOM(8,25)/10).p,MRANDOM(15,35)/10)
  1011. end
  1012. else
  1013. for i = 1, MRANDOM(13,25) do
  1014. Swait()
  1015. ApplyDamage(HUMAN,MRANDOM(1,3))
  1016. SprayBlood(HEAD.CFrame*CF(0,-HEAD.Size.Y/3,-HEAD.Size.Z/2).p,HEAD.CFrame*CF(MRANDOM(-3,3)/15,HEAD.Size.Y+MRANDOM(-4,2)/35,-HEAD.Size.Z*MRANDOM(8,25)/10).p,MRANDOM(15,35)/10)
  1017. end
  1018. end
  1019. wait(1)
  1020. COUGHS:Play()
  1021. end
  1022. until Victim:FindFirstChild("Disease") == nil or HUMAN.Health == 0
  1023. ITEM:remove()
  1024. HUMAN.WalkSpeed = SPEED
  1025. for i = 1, 35 do
  1026. Swait()
  1027. COUGHS.Volume = COUGHS.Volume - 6/35
  1028. end
  1029. COUGHS:remove()
  1030. end
  1031. end
  1032. end
  1033. end))
  1034. end
  1035.  
  1036. function ApplyAoE(POSITION,RANGE,MINDMG,MAXDMG,FLING,ILLNESSCHANCE)
  1037. local CHILDREN = workspace:GetDescendants()
  1038. for index, CHILD in pairs(CHILDREN) do
  1039. if CHILD.ClassName == "Model" and CHILD ~= Character then
  1040. local HUM = CHILD:FindFirstChildOfClass("Humanoid")
  1041. if HUM then
  1042. local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
  1043. if TORSO then
  1044. if (TORSO.Position - POSITION).Magnitude <= RANGE then
  1045. local DMG = MRANDOM(MINDMG,MAXDMG)
  1046. ApplyDamage(HUM,DMG)
  1047. if MRANDOM(1,100) <= ILLNESSCHANCE then
  1048. if ILLNESSCHANCE <= 100 then
  1049. Illness(CHILD,false)
  1050. else
  1051. Illness(CHILD,true)
  1052. end
  1053. end
  1054. if FLING > 0 then
  1055. for _, c in pairs(CHILD:GetChildren()) do
  1056. if c:IsA("BasePart") then
  1057. local bv = Instance.new("BodyVelocity")
  1058. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  1059. bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING
  1060. bv.Parent = c
  1061. Debris:AddItem(bv,0.05)
  1062. end
  1063. end
  1064. end
  1065. end
  1066. end
  1067. end
  1068. end
  1069. end
  1070. end
  1071.  
  1072. --//=================================\\
  1073. --|| ATTACK FUNCTIONS AND STUFF
  1074. --\\=================================//
  1075.  
  1076. function AttackTemplate()
  1077. ATTACK = true
  1078. Rooted = false
  1079. for i=0, 1, 0.1 / Animation_Speed do
  1080. Swait()
  1081. WELD.C0 = Clerp(WELD.C0,CF(-0.1, -1.1, -0.25) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-30), RAD(145), RAD(-15)), 1 / Animation_Speed)
  1082. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(3.5), RAD(0), RAD(-35)), 1 / Animation_Speed)
  1083. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25), RAD(0), RAD(35)), 1 / Animation_Speed)
  1084. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, -0.25, 0.2) * ANGLES(RAD(170), RAD(15), RAD(5)) * RIGHTSHOULDERC0, 2 / Animation_Speed)
  1085. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-5 * SIN(SINE / 12)), RAD(15), RAD(-15)) * LEFTSHOULDERC0, 2 / Animation_Speed)
  1086. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(0), RAD(100), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 1 / Animation_Speed)
  1087. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.01) * ANGLES(RAD(3.5), RAD(-55), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 1 / Animation_Speed)
  1088. end
  1089. ATTACK = false
  1090. Rooted = false
  1091. end
  1092.  
  1093. --//=================================\\
  1094. --|| ASSIGN THINGS TO KEYS
  1095. --\\=================================//
  1096.  
  1097. function MouseDown(Mouse)
  1098. if ATTACK == false then
  1099. end
  1100. end
  1101.  
  1102. function MouseUp(Mouse)
  1103. HOLD = false
  1104. end
  1105.  
  1106. function KeyDown(Key)
  1107. KEYHOLD = true
  1108. if Key == "z" and ATTACK == false then
  1109. ApplyAoE(Torso.Position,6,5,7,15,100)
  1110. end
  1111.  
  1112. if Key == "b" and ATTACK == false then
  1113. ApplyAoE(Torso.Position,6,5,7,15,101)
  1114. end
  1115.  
  1116. if Key == "c" and ATTACK == false then
  1117. end
  1118.  
  1119. if Key == "v" and ATTACK == false then
  1120. end
  1121.  
  1122. if Key == "x" and ATTACK == false then
  1123. end
  1124. end
  1125.  
  1126. function KeyUp(Key)
  1127. KEYHOLD = false
  1128. end
  1129.  
  1130. Mouse.Button1Down:connect(function(NEWKEY)
  1131. MouseDown(NEWKEY)
  1132. end)
  1133. Mouse.Button1Up:connect(function(NEWKEY)
  1134. MouseUp(NEWKEY)
  1135. end)
  1136. Mouse.KeyDown:connect(function(NEWKEY)
  1137. KeyDown(NEWKEY)
  1138. end)
  1139. Mouse.KeyUp:connect(function(NEWKEY)
  1140. KeyUp(NEWKEY)
  1141. end)
  1142.  
  1143. --//=================================\\
  1144. --\\=================================//
  1145.  
  1146.  
  1147. function unanchor()
  1148. if UNANCHOR == true then
  1149. g = Character:GetChildren()
  1150. for i = 1, #g do
  1151. if g[i].ClassName == "Part" then
  1152. g[i].Anchored = false
  1153. end
  1154. end
  1155. end
  1156. end
  1157.  
  1158.  
  1159. --//=================================\\
  1160. --|| WRAP THE WHOLE SCRIPT UP
  1161. --\\=================================//
  1162.  
  1163. Humanoid.Changed:connect(function(Jump)
  1164. if Jump == "Jump" and (Disable_Jump == true) then
  1165. Humanoid.Jump = false
  1166. end
  1167. end)
  1168.  
  1169. local GLITCH = 0
  1170.  
  1171. while true do
  1172. Swait()
  1173. script.Parent = WEAPONGUI
  1174. ANIMATE.Parent = nil
  1175. for _,v in next, Humanoid:GetPlayingAnimationTracks() do
  1176. v:Stop();
  1177. end
  1178. SINE = SINE + CHANGE
  1179. local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
  1180. local TORSOVERTICALVELOCITY = RootPart.Velocity.y
  1181. local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
  1182. local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16)
  1183. if TORSOVERTICALVELOCITY > 20 then
  1184. TORSOVERTICALVELOCITY = 20
  1185. elseif TORSOVERTICALVELOCITY < -20 then
  1186. TORSOVERTICALVELOCITY = -20
  1187. end
  1188. if ANIM == "Walk" and TORSOVELOCITY > 1 then
  1189. RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1190. Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1191. RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1192. LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1193. elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
  1194. RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1195. Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1196. RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1197. LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1198. end
  1199. if HITFLOOR == nil then
  1200. ANIM = "Midair"
  1201. if ATTACK == false then
  1202. WELD.C0 = Clerp(WELD.C0,CF(0, -1.1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-40), RAD(130), RAD(0)), 1 / Animation_Speed)
  1203. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(-TORSOVERTICALVELOCITY), RAD(0), RAD(0)), 1 / Animation_Speed)
  1204. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(10), RAD(0), RAD(0)), 1 / Animation_Speed)
  1205. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, -0.25, 0.2) * ANGLES(RAD(170), RAD(35), RAD(15)) * RIGHTSHOULDERC0, 2 / Animation_Speed)
  1206. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
  1207. RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.5, -0.6) * ANGLES(RAD(-15), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 1 / Animation_Speed)
  1208. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 1 / Animation_Speed)
  1209. end
  1210. elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
  1211. ANIM = "Idle"
  1212. if ATTACK == false then
  1213. WELD.C0 = Clerp(WELD.C0,CF(-0.1, -1.1, -0.25) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-30), RAD(145), RAD(-15)), 1 / Animation_Speed)
  1214. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0 - 0.15 * COS(SINE / 12), 0 + 0.1 * COS(SINE / 6)) * ANGLES(RAD(3.5 * COS(SINE / 12)), RAD(0), RAD(-35)), 1 / Animation_Speed)
  1215. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(2.5 * SIN(SINE / 12)), RAD(-25 + 4 * COS(SINE / 6)), RAD(35)), 1 / Animation_Speed)
  1216. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, -0.25, 0.2) * ANGLES(RAD(170), RAD(15), RAD(5)) * RIGHTSHOULDERC0, 2 / Animation_Speed)
  1217. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 - 0.15 * COS(SINE / 6), 0 + 0.1 * COS(SINE / 12)) * ANGLES(RAD(-5 * SIN(SINE / 12)), RAD(15 * SIN(SINE / 12)), RAD(-15 - 7.5 * SIN(SINE / 12) - 1.5 * COS(SINE / 6))) * LEFTSHOULDERC0, 2 / Animation_Speed)
  1218. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.1 * COS(SINE / 6), -0.01) * ANGLES(RAD(0), RAD(100), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 1 / Animation_Speed)
  1219. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.1 * COS(SINE / 6), -0.01) * ANGLES(RAD(3.5 + 3.5 * COS(SINE / 12)), RAD(-55), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 1 / Animation_Speed)
  1220. end
  1221. elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
  1222. ANIM = "Walk"
  1223. if ATTACK == false then
  1224. WELD.C0 = Clerp(WELD.C0,CF(-0.1, -1.1, -0.25) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-30), RAD(145), RAD(-15)), 1 / Animation_Speed)
  1225. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(5 + 2.5 * COS(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(-15)), 1 / Animation_Speed)
  1226. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5 - 2 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(-15 + 3 * COS(SINE / (WALKSPEEDVALUE / 2))), RAD(15)), 1 / Animation_Speed)
  1227. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, -0.25, 0.2) * ANGLES(RAD(170), RAD(15), RAD(5)) * RIGHTSHOULDERC0, 2 / Animation_Speed)
  1228. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 - 0.15 * COS(SINE / (WALKSPEEDVALUE / 2)), 0 + 0.1 * COS(SINE / (WALKSPEEDVALUE))) * ANGLES(RAD(-5 * SIN(SINE / 12)), RAD(15 * SIN(SINE / (WALKSPEEDVALUE))), RAD(-25 - 5.5 * SIN(SINE / (WALKSPEEDVALUE)))) * LEFTSHOULDERC0, 2 / Animation_Speed)
  1229. RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(95), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed)
  1230. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-74), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed)
  1231. end
  1232. end
  1233. unanchor()
  1234. Humanoid.MaxHealth = "inf"
  1235. Humanoid.Health = "inf"
  1236. if Rooted == false then
  1237. Disable_Jump = false
  1238. Humanoid.WalkSpeed = Speed
  1239. elseif Rooted == true then
  1240. Disable_Jump = true
  1241. Humanoid.WalkSpeed = 0
  1242. end
  1243. sick.SoundId = "rbxassetid://232916521"
  1244. sick.Looped = true
  1245. sick.Pitch = 0.9
  1246. sick.Volume = 5
  1247. sick.Playing = true
  1248. sick.Parent = Character
  1249. if MRANDOM(1,85) == 1 then
  1250. GLITCH = GLITCH + MRANDOM(6,12)
  1251. end
  1252. if GLITCH > 0 then
  1253. GLITCH = GLITCH - 1
  1254. sick.Pitch = MRANDOM(4,10)/10
  1255. sick.Volume = 10
  1256. else
  1257. GLITCH = 0
  1258. end
  1259. for _, c in pairs(Character:GetDescendants()) do
  1260. if c.ClassName == "Accessory" then
  1261. if c.Handle:FindFirstChild("HairAttachment") == nil then
  1262. c:remove()
  1263. end
  1264. end
  1265. end
  1266. end
  1267.  
  1268. --//=================================\\
  1269. --\\=================================//
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275. --//====================================================\\--
  1276. --|| END OF SCRIPT
  1277. --\\====================================================//--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement