Advertisement
screeching-wombat

converted Sakuya

Apr 20th, 2021 (edited)
992
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 46.42 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5.     print("FE Compatibility code by Mokiros")
  6.     local rp = RealPlayer
  7.     script.Parent = rp.Character
  8.    
  9.     --RemoteEvent for communicating
  10.     local Event = Instance.new("RemoteEvent")
  11.     Event.Name = "UserInput_Event"
  12.  
  13.     --Fake event to make stuff like Mouse.KeyDown work
  14.     local function fakeEvent()
  15.         local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16.         t.connect = t.Connect
  17.         return t
  18.     end
  19.  
  20.     --Creating fake input objects with fake variables
  21.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25.     end}
  26.     --Merged 2 functions into one by checking amount of arguments
  27.     CAS.UnbindAction = CAS.BindAction
  28.  
  29.     --This function will trigger the events that have been :Connect()'ed
  30.     local function te(self,ev,...)
  31.         local t = m[ev]
  32.         if t and t._fakeEvent then
  33.             for _,f in pairs(t.Functions) do
  34.                 f(...)
  35.             end
  36.         end
  37.     end
  38.     m.TrigEvent = te
  39.     UIS.TrigEvent = te
  40.  
  41.     Event.OnServerEvent:Connect(function(plr,io)
  42.         if plr~=rp then return end
  43.         m.Target = io.Target
  44.         m.Hit = io.Hit
  45.         if not io.isMouse then
  46.             local b = io.UserInputState == Enum.UserInputState.Begin
  47.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49.             end
  50.             for _,t in pairs(CAS.Actions) do
  51.                 for _,k in pairs(t.Keys) do
  52.                     if k==io.KeyCode then
  53.                         t.Function(t.Name,io.UserInputState,io)
  54.                     end
  55.                 end
  56.             end
  57.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59.         end
  60.     end)
  61.     Event.Parent = NLS([==[
  62.     local Player = game:GetService("Players").LocalPlayer
  63.     local Event = script:WaitForChild("UserInput_Event")
  64.  
  65.     local Mouse = Player:GetMouse()
  66.     local UIS = game:GetService("UserInputService")
  67.     local input = function(io,a)
  68.         if a then return end
  69.         --Since InputObject is a client-side instance, we create and pass table instead
  70.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71.     end
  72.     UIS.InputBegan:Connect(input)
  73.     UIS.InputEnded:Connect(input)
  74.  
  75.     local h,t
  76.     --Give the server mouse data 30 times every second, but only if the values changed
  77.     --If player is not moving their mouse, client won't fire events
  78.     while wait(1/30) do
  79.         if h~=Mouse.Hit or t~=Mouse.Target then
  80.             h,t=Mouse.Hit,Mouse.Target
  81.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  82.         end
  83.     end]==],Player.Character)
  84.  
  85.     ----Sandboxed game object that allows the usage of client-side methods and services
  86.     --Real game object
  87.     local _rg = game
  88.  
  89.     --Metatable for fake service
  90.     local fsmt = {
  91.         __index = function(self,k)
  92.             local s = rawget(self,"_RealService")
  93.             if s then return s[k] end
  94.         end,
  95.         __newindex = function(self,k,v)
  96.             local s = rawget(self,"_RealService")
  97.             if s then s[k]=v end
  98.         end,
  99.         __call = function(self,...)
  100.             local s = rawget(self,"_RealService")
  101.             if s then return s(...) end
  102.         end
  103.     }
  104.     local function FakeService(t,RealService)
  105.         t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106.         return setmetatable(t,fsmt)
  107.     end
  108.  
  109.     --Fake game object
  110.     local g = {
  111.         GetService = function(self,s)
  112.             return self[s]
  113.         end,
  114.         Players = FakeService({
  115.             LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116.         },"Players"),
  117.         UserInputService = FakeService(UIS,"UserInputService"),
  118.         ContextActionService = FakeService(CAS,"ContextActionService"),
  119.     }
  120.     rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121.     g.service = g.GetService
  122.    
  123.     g.RunService = FakeService({
  124.         RenderStepped = _rg:GetService("RunService").Heartbeat,
  125.         BindToRenderStep = function(self,name,_,fun)
  126.             self._btrs[name] = self.Heartbeat:Connect(fun)
  127.         end,
  128.         UnbindFromRenderStep = function(self,name)
  129.             self._btrs[name]:Disconnect()
  130.         end,
  131.     },"RunService")
  132.  
  133.     setmetatable(g,{
  134.         __index=function(self,s)
  135.             return _rg:GetService(s) or typeof(_rg[s])=="function"
  136.             and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137.         end,
  138.         __newindex = fsmt.__newindex,
  139.         __call = fsmt.__call
  140.     })
  141.     --Changing owner to fake player object to support owner:GetMouse()
  142.     game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145. wait(0.016666666666667)
  146. Anim = nil
  147. cf = CFrame.new
  148. function c3(cz, cx, cc)
  149.   return Color3.new(cz / 255, cx / 255, cc / 255)
  150. end
  151. angles = CFrame.Angles
  152. Player = game.Players.LocalPlayer
  153. Character = Player.Character
  154. Humanoid = Character.Humanoid
  155. mouse = Player:GetMouse()
  156. local LeftArm = Character["Left Arm"]
  157. RightArm = Character["Right Arm"]
  158. LeftLeg = Character["Left Leg"]
  159. RightLeg = Character["Right Leg"]
  160. Head = Character.Head
  161. Torso = Character.Torso
  162. RootPart = Character.HumanoidRootPart
  163. RootJoint = RootPart.RootJoint
  164. Humanoid.Animator:Destroy()
  165. Character.Animate:Destroy()
  166. NeckCF = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  167. RootCF = angles(-1.57, 0, 3.14)
  168. LHC0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  169. LHC1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  170. RHC0 = cf(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  171. RHC1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  172. RW = Instance.new("Weld")
  173. LW = Instance.new("Weld")
  174. RH = Torso["Right Hip"]
  175. LH = Torso["Left Hip"]
  176. Neck = Torso.Neck
  177. RSH = Torso["Right Shoulder"]
  178. LSH = Torso["Left Shoulder"]
  179. RSH.Parent = nil
  180. LSH.Parent = nil
  181. RW.Name = "Right Shoulder"
  182. RW.Part0 = Torso
  183. RW.C0 = cf(1.5, 0.5, 0)
  184. RW.C1 = cf(0, 0.5, 0)
  185. RW.Part1 = RightArm
  186. RW.Parent = Torso
  187. LW.Name = "Left Shoulder"
  188. LW.Part0 = Torso
  189. LW.C0 = cf(-1.5, 0.5, 0)
  190. LW.C1 = cf(0, 0.5, 0)
  191. LW.Part1 = LeftArm
  192. LW.Parent = Torso
  193. Effects = Instance.new("Model", Character)
  194. Effects.Name = "Effects"
  195. Humanoid.WalkSpeed = 16
  196. partEffects, AttackHas, AttackNeeded, AttackCan = {}, {}, {}, {}
  197. AttackHas[1], AttackHas[2], AttackHas[3], AttackHas[4] = 1, 1, 1, 1
  198. AttackNeeded[1], AttackNeeded[2], AttackNeeded[3], AttackNeeded[4] = 1, 1, 1, 1
  199. AttackCan[1], AttackCan[2], AttackCan[3], AttackCan[4] = true, true, true, true
  200. sine = 0
  201. attackcounter = 1
  202. torvel = nil
  203. attacking = false
  204. hitfloor, posfloor = nil, nil
  205. tool = nil
  206. if script.Parent.ClassName == "HopperBin" then
  207.   tool = script.Parent
  208.   tool.Parent = Player.Backpack
  209. else
  210.   tool = Instance.new("HopperBin", Player.Backpack)
  211.   tool.Name = ""
  212. end
  213. meshes = {
  214.   3270017,
  215.   20329976,
  216.   448386996,
  217.   1095708,
  218.   1033714,
  219.   9756362
  220. }
  221. sounds = {
  222.   {
  223.     320557413,
  224.     320557453,
  225.     320557487,
  226.     320557518,
  227.     320557537,
  228.     320557563,
  229.     233856146,
  230.     233856140
  231.   },
  232.   {
  233.     234365549,
  234.     234365573,
  235.     231917961,
  236.     231917950,
  237.     231917856,
  238.     231917863,
  239.     231917871
  240.   },
  241.   {
  242.     262562442,
  243.     231917806,
  244.     231917784
  245.   },
  246.   {
  247.     262562442,
  248.     233856048,
  249.     306247739
  250.   }
  251. }
  252. ArtificialHB = Instance.new("BindableEvent", script)
  253. ArtificialHB.Name = "Heartbeat"
  254. script:WaitForChild("Heartbeat")
  255. frame = 0.025
  256. tf = 0
  257. allowframeloss = true
  258. tossremainder = false
  259. lastframe = tick()
  260. script.Heartbeat:Fire()
  261. game:GetService("RunService").Heartbeat:connect(function(s, p)
  262.   tf = tf + s
  263.   if tf >= frame then
  264.     if allowframeloss then
  265.       script.Heartbeat:Fire()
  266.       lastframe = tick()
  267.     else
  268.       for i = 1, math.floor(tf / frame) do
  269.         script.Heartbeat:Fire()
  270.       end
  271.       lastframe = tick()
  272.     end
  273.     if tossremainder then
  274.       tf = 0
  275.     else
  276.       tf = tf - frame * math.floor(tf / frame)
  277.     end
  278.   end
  279. end)
  280. function swait(num)
  281.   if num == 0 or num == nil then
  282.     ArtificialHB.Event:wait()
  283.   else
  284.     for i = 0, num do
  285.       ArtificialHB.Event:wait()
  286.     end
  287.   end
  288. end
  289. function thread(f)
  290.   coroutine.resume(coroutine.create(f))
  291. end
  292. function clerp(a, b, t)
  293.   local qa = {
  294.     QuaternionFromCFrame(a)
  295.   }
  296.   local qb = {
  297.     QuaternionFromCFrame(b)
  298.   }
  299.   local ax, ay, az = a.x, a.y, a.z
  300.   local bx, by, bz = b.x, b.y, b.z
  301.   local _t = 1 - t
  302.   return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  303. end
  304. function QuaternionFromCFrame(cf)
  305.   local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  306.   local trace = m00 + m11 + m22
  307.   if trace > 0 then
  308.     local s = math.sqrt(1 + trace)
  309.     local recip = 0.5 / s
  310.     return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  311.   else
  312.     local i = 0
  313.     if m00 < m11 then
  314.       i = 1
  315.     end
  316.     if m22 > (i == 0 and m00 or m11) then
  317.       i = 2
  318.     end
  319.     if i == 0 then
  320.       local s = math.sqrt(m00 - m11 - m22 + 1)
  321.       local recip = 0.5 / s
  322.       return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  323.     elseif i == 1 then
  324.       local s = math.sqrt(m11 - m22 - m00 + 1)
  325.       local recip = 0.5 / s
  326.       return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  327.     elseif i == 2 then
  328.       local s = math.sqrt(m22 - m00 - m11 + 1)
  329.       local recip = 0.5 / s
  330.       return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  331.     end
  332.   end
  333. end
  334. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  335.   local xs, ys, zs = x + x, y + y, z + z
  336.   local wx, wy, wz = w * xs, w * ys, w * zs
  337.   local xx = x * xs
  338.   local xy = x * ys
  339.   local xz = x * zs
  340.   local yy = y * ys
  341.   local yz = y * zs
  342.   local zz = z * zs
  343.   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))
  344. end
  345. function QuaternionSlerp(a, b, t)
  346.   local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  347.   local startInterp, finishInterp
  348.   if cosTheta >= 1.0E-4 then
  349.     if 1 - cosTheta > 1.0E-4 then
  350.       local theta = math.acos(cosTheta)
  351.       local invSinTheta = 1 / math.sin(theta)
  352.       startInterp = math.sin((1 - t) * theta) * invSinTheta
  353.       finishInterp = math.sin(t * theta) * invSinTheta
  354.     else
  355.       startInterp = 1 - t
  356.       finishInterp = t
  357.     end
  358.   elseif 1 + cosTheta > 1.0E-4 then
  359.     local theta = math.acos(-cosTheta)
  360.     local invSinTheta = 1 / math.sin(theta)
  361.     startInterp = math.sin((t - 1) * theta) * invSinTheta
  362.     finishInterp = math.sin(t * theta) * invSinTheta
  363.   else
  364.     startInterp = t - 1
  365.     finishInterp = t
  366.   end
  367.   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
  368. end
  369. function rayCast(Pos, Dir, Max, Ignore)
  370.   return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  371. end
  372. function newPart(par, brick, transp, anch, canc, size, name, mat, cfra)
  373.   local p = Instance.new("Part")
  374.   p.BrickColor = brick
  375.   p.Transparency = transp
  376.   p.Material = mat and mat or "SmoothPlastic"
  377.   p.Anchored = anch
  378.   p.CanCollide = canc
  379.   p.Size = size
  380.   p.TopSurface, p.BottomSurface, p.LeftSurface, p.RightSurface, p.FrontSurface, p.BackSurface = 10, 10, 10, 10, 10, 10
  381.   p.Name = name
  382.   p.CFrame = cfra or RootPart.CFrame
  383.   p.Parent = par
  384.   return p
  385. end
  386. function mesh(Mesh, part, meshtype, meshid, offset, scale)
  387.   local mesh = Instance.new(Mesh)
  388.   mesh.Parent = part
  389.   if Mesh == "SpecialMesh" then
  390.     mesh.MeshType = meshtype
  391.     if meshid then
  392.       mesh.MeshId = "http://www.roblox.com/asset/?id=" .. meshid
  393.     end
  394.   end
  395.   if offset then
  396.     mesh.Offset = offset
  397.   end
  398.   mesh.Scale = scale
  399.   return mesh
  400. end
  401. function weld(parent, part0, part1, c0, c1)
  402.   local weld = Instance.new("Weld")
  403.   weld.Parent = parent
  404.   weld.Part0 = part0
  405.   weld.Part1 = part1
  406.   weld.C0 = c0
  407.   if c1 then
  408.     weld.C1 = c1
  409.   end
  410.   return weld
  411. end
  412. function sound(id, par, vol, dur, pit)
  413.   coroutine.resume(coroutine.create(function()
  414.     local sou = Instance.new("Sound", par or workspace)
  415.     sou.Volume = vol
  416.     sou.Pitch = pit or 1
  417.     sou.SoundId = "http://www.roblox.com/asset/?id=" .. id
  418.     swait()
  419.     sou:play()
  420.     wait(dur)
  421.     sou:Destroy()
  422.   end))
  423. end
  424. function round(num)
  425.   local a, b = math.modf(num)
  426.   if num % 1 ~= 0 then
  427.     return math.floor(num) + math.floor(b * 10 + 0.5) / 10
  428.   else
  429.     return math.floor(num)
  430.   end
  431. end
  432. function findCloseHumanoid(centre, distance)
  433.   local tab = {}
  434.   for _, child in pairs(game.Workspace:GetChildren()) do
  435.     if child:findFirstChild("Humanoid") and child:findFirstChild("Humanoid") ~= Humanoid and child:findFirstChild("Torso") then
  436.       local vtors = child.Torso
  437.       local mag = math.abs((vtors.Position - centre).magnitude)
  438.       if distance >= mag then
  439.         table.insert(tab, child.Humanoid)
  440.       end
  441.     end
  442.   end
  443.   return tab
  444. end
  445. function basicDamage(vhum, damage, colour)
  446.   if not vhum or not vhum.Parent:findFirstChild("Humanoid") or vhum.Health <= 0 then
  447.     return
  448.   end
  449.   vhum.Health = vhum.Health - damage
  450.   local damagepart = Instance.new("Part", Effects)
  451.   damagepart.Transparency = 1
  452.   damagepart.Anchored = true
  453.   damagepart.CanCollide = false
  454.   damagepart.Size = Vector3.new(1, 1, 1)
  455.   damagepart.Name = "DamagePart"
  456.   damagepart.CFrame = vhum.Parent.Head.CFrame * CFrame.new(0, 1, 0)
  457.   local g = Instance.new("BillboardGui", damagepart)
  458.   g.Enabled = true
  459.   g.Adornee = damagepart
  460.   g.Size = UDim2.new(5, 0, 5, 0)
  461.   g.ExtentsOffset = Vector3.new(0, 0, 0)
  462.   g.StudsOffset = Vector3.new(0, 0, 0)
  463.   local t = Instance.new("TextLabel", g)
  464.   t.BackgroundTransparency = 1
  465.   t.Font = "ArialBold"
  466.   t.TextSize = 24
  467.   t.Text = "-" .. round(damage)
  468.   if round(damage) % 1 == 0 then
  469.     t.Text = "-" .. round(damage) .. ".0"
  470.   end
  471.   t.Size = UDim2.new(1, 0, 1, 0)
  472.   t.TextStrokeTransparency = 0
  473.   t.TextTransparency = 0
  474.   t.TextScaled = true
  475.   t.TextWrapped = true
  476.   t.TextXAlignment = "Center"
  477.   t.TextYAlignment = "Center"
  478.   t.TextColor3 = colour
  479.   coroutine.resume(coroutine.create(function()
  480.     for i = 1, 50 do
  481.       game:GetService("RunService").Heartbeat:wait()
  482.       local sinewave = math.sin(i / 500) * 4
  483.       damagepart.CFrame = damagepart.CFrame * CFrame.new(Vector3.new(0, 0.3 - sinewave, 0))
  484.       t.TextTransparency = t.TextTransparency + 0.02
  485.       t.TextStrokeTransparency = t.TextTransparency + 0.02
  486.     end
  487.     damagepart:Destroy()
  488.   end), t)
  489. end
  490. function createBodyTrail()
  491.   local nPart = function(parent, brickcolor, transparency, anchored, cancollide, size, name)
  492.     local fp = Instance.new("Part")
  493.     fp.Parent = parent
  494.     fp.Transparency = transparency
  495.     fp.Anchored = anchored
  496.     fp.CanCollide = cancollide
  497.     fp.Locked = true
  498.     fp.BrickColor = BrickColor.new(brickcolor)
  499.     fp.Name = name
  500.     fp.Size = size
  501.     fp.Position = RootPart.Position
  502.     fp.TopSurface, fp.BottomSurface, fp.LeftSurface, fp.RightSurface, fp.FrontSurface, fp.BackSurface = 10, 10, 10, 10, 10, 10
  503.     fp.Material = "SmoothPlastic"
  504.     fp:BreakJoints()
  505.     return fp
  506.   end
  507.   local faketab = {}
  508.   local fakel = nPart(Effects, Character["Right Arm"].BrickColor.Color, 0, true, false, Character["Right Arm"].Size, "")
  509.   local faker = nPart(Effects, Character["Left Arm"].BrickColor.Color, 0, true, false, Character["Left Arm"].Size, "")
  510.   local fakell = nPart(Effects, Character["Left Leg"].BrickColor.Color, 0, true, false, Character["Left Leg"].Size, "")
  511.   local fakerl = nPart(Effects, Character["Right Leg"].BrickColor.Color, 0, true, false, Character["Right Leg"].Size, "")
  512.   local faketors = nPart(Effects, Character.Torso.BrickColor.Color, 0, true, false, Character.Torso.Size, "")
  513.   local fakehead = nPart(Effects, Character.Head.BrickColor.Color, 0, true, false, Character.Head.Size, "")
  514.   fakel.BrickColor = BrickColor.new("Fog")
  515.   faker.BrickColor = BrickColor.new("Fog")
  516.   fakell.BrickColor = BrickColor.new("Fog")
  517.   fakerl.BrickColor = BrickColor.new("Fog")
  518.   faketors.BrickColor = BrickColor.new("Fog")
  519.   fakehead.BrickColor = BrickColor.new("Fog")
  520.   if Character.Head:findFirstChild("Mesh") then
  521.     Character.Head.Mesh:Clone().Parent = fakehead
  522.   end
  523.   fakel.Name = "FakeLeft"
  524.   faker.Name = "FakeRight"
  525.   fakell.Name = "FakeLeftL"
  526.   fakerl.Name = "FakeRightL"
  527.   faketors.Name = "FakeTorso"
  528.   fakehead.Name = "FakeHead"
  529.   table.insert(faketab, fakel)
  530.   table.insert(faketab, faker)
  531.   table.insert(faketab, fakell)
  532.   table.insert(faketab, fakerl)
  533.   table.insert(faketab, faketors)
  534.   table.insert(faketab, fakehead)
  535.   for _, v in pairs(faketab) do
  536.     v.Archivable = true
  537.     v.CanCollide = false
  538.     v.Anchored = true
  539.     v.Material = "SmoothPlastic"
  540.     v.Transparency = 0.2
  541.     v.Locked = true
  542.     game.Debris:AddItem(v, 3)
  543.   end
  544.   fakel.CFrame = Character["Left Arm"].CFrame
  545.   faker.CFrame = Character["Right Arm"].CFrame
  546.   fakell.CFrame = Character["Left Leg"].CFrame
  547.   fakerl.CFrame = Character["Right Leg"].CFrame
  548.   faketors.CFrame = Character.Torso.CFrame
  549.   fakehead.CFrame = Character.Head.CFrame
  550.   local hats = {}
  551.   for _, v in pairs(hats) do
  552.     if v:findFirstChild("Handle") then
  553.       do
  554.         local vc = v.Handle:Clone()
  555.         vc.Parent = Effects
  556.         vc.CFrame = v.Handle.CFrame
  557.         vc.Anchored = true
  558.         vc.CanCollide = false
  559.         thread(function()
  560.           for i = 1, 15 do
  561.             swait()
  562.             vc.Transparency = vc.Transparency + 0.06666666666666667
  563.           end
  564.           vc:Destroy()
  565.         end)
  566.       end
  567.     end
  568.   end
  569.   return faketors, fakehead, faker, fakel, fakerl, fakell
  570. end
  571. function magic(type, thing)
  572.   local magicBlock = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay, t)
  573.     local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
  574.     prt.CFrame = cframe
  575.     local msh = mesh("BlockMesh", prt, nil, nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  576.     game:GetService("Debris"):AddItem(prt, 8)
  577.     if t == 1 or t == nil then
  578.       table.insert(partEffects, {
  579.         prt,
  580.         "Block1",
  581.         delay,
  582.         x3,
  583.         y3,
  584.         z3,
  585.         msh
  586.       })
  587.     elseif t == 2 then
  588.       table.insert(partEffects, {
  589.         prt,
  590.         "Block2",
  591.         delay,
  592.         x3,
  593.         y3,
  594.         z3,
  595.         msh
  596.       })
  597.     end
  598.   end
  599.   local magicCylinder = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
  600.     local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
  601.     local msh = mesh("CylinderMesh", prt, nil, nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  602.     game:GetService("Debris"):AddItem(prt, 8)
  603.     table.insert(partEffects, {
  604.       prt,
  605.       "Cylinder",
  606.       delay,
  607.       x3,
  608.       y3,
  609.       z3,
  610.       msh
  611.     })
  612.   end
  613.   local magicSphere = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
  614.     local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
  615.     local msh = mesh("SpecialMesh", prt, "Sphere", nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  616.     game:GetService("Debris"):AddItem(prt, 8)
  617.     table.insert(partEffects, {
  618.       prt,
  619.       "Cylinder",
  620.       delay,
  621.       x3,
  622.       y3,
  623.       z3,
  624.       msh
  625.     })
  626.   end
  627.   local magicRing = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
  628.     local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
  629.     prt.Anchored = true
  630.     prt.CFrame = cframe
  631.     local msh = mesh("SpecialMesh", prt, "FileMesh", 3270017, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  632.     game:GetService("Debris"):AddItem(prt, 2)
  633.     coroutine.resume(coroutine.create(function(Part, Mesh, num)
  634.       for i = 0, 1, delay do
  635.         swait()
  636.         Part.Transparency = i
  637.         Mesh.Scale = Mesh.Scale + Vector3.new(x3, y3, z3)
  638.       end
  639.       Part:Destroy()
  640.     end), prt, msh, (math.random(0, 1) + math.random()) / 5)
  641.   end
  642.   local magicSlash = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
  643.     local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", cframe)
  644.     prt.Anchored = true
  645.     prt.CFrame = cframe
  646.     local msh = mesh("SpecialMesh", prt, "FileMesh", 20329976, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  647.     game:GetService("Debris"):AddItem(prt, 2)
  648.     coroutine.resume(coroutine.create(function(Part, Mesh, num)
  649.       for i = 0, 1, delay do
  650.         swait()
  651.         Part.Transparency = i
  652.         Mesh.Scale = Mesh.Scale + Vector3.new(x3, y3, z3)
  653.       end
  654.       Part:Destroy()
  655.     end), prt, msh, (math.random(0, 1) + math.random()) / 5)
  656.   end
  657.   local par = thing[1]
  658.   local brick = thing[2]
  659.   local cframe = thing[3]
  660.   local x1 = thing[4]
  661.   local y1 = thing[5]
  662.   local z1 = thing[6]
  663.   local x3 = thing[7]
  664.   local y3 = thing[8]
  665.   local z3 = thing[9]
  666.   local delay = thing[10]
  667.   local t = thing[11]
  668.   if type == "Block" or type == 1 then
  669.     magicBlock(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
  670.   elseif type == "Cylinder" or type == 2 then
  671.     magicCylinder(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
  672.   elseif type == "Sphere" or type == 3 then
  673.     magicSphere(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
  674.   elseif type == "Ring" or type == 4 then
  675.     magicRing(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
  676.   elseif type == "Slash" or type == 5 then
  677.     magicSlash(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
  678.   end
  679. end
  680. function newFrame(par, bg, transp, size, pos, name)
  681.   local f = Instance.new("Frame", nil)
  682.   f.BackgroundColor3 = bg
  683.   f.BackgroundTransparency = transp
  684.   f.BorderSizePixel = 0
  685.   f.Position = pos
  686.   f.Size = size
  687.   f.Name = name
  688.   f.Parent = par
  689.   return f
  690. end
  691. function newLabel(par, size, pos, text, textsize, text3, textstroke3, scaled, name)
  692.   local l = Instance.new("TextLabel", nil)
  693.   l.BackgroundTransparency = 1
  694.   l.Size = size
  695.   l.Position = pos
  696.   l.Text = text
  697.   l.TextSize = textsize
  698.   l.TextColor3 = text3
  699.   l.TextStrokeColor3 = textstroke3
  700.   if scaled then
  701.     l.TextScaled = scaled
  702.   else
  703.     l.TextScaled = true
  704.   end
  705.   l.TextStrokeTransparency = 0
  706.   l.Name = name
  707.   l.Parent = par
  708.   return l
  709. end
  710. a1t = "Misdirection"
  711. a2t = "Marionette"
  712. a3t = "Luna Clock"
  713. a4t = "Clock Corpse"
  714. backc3 = c3(210, 210, 255)
  715. reloc3 = c3(107, 107, 210)
  716. g = Instance.new("ScreenGui")
  717. f1 = newFrame(g, backc3, 0.5, UDim2.new(0.18, 0, 0.08, 0), UDim2.new(0.8, 0, 0.85, 0), "")
  718. f2 = newFrame(g, backc3, 0.5, UDim2.new(0.18, 0, 0.08, 0), UDim2.new(0.8, 0, 0.76, 0), "")
  719. f3 = newFrame(g, backc3, 0.5, UDim2.new(0.18, 0, 0.08, 0), UDim2.new(0.8, 0, 0.67, 0), "")
  720. f4 = newFrame(g, backc3, 0.5, UDim2.new(0.18, 0, 0.08, 0), UDim2.new(0.8, 0, 0.58, 0), "")
  721. newFrame(f1, reloc3, 0, UDim2.new(1.002, 0, 1.002, 0), UDim2.new(0, 0, 0, 0), "Reload")
  722. newFrame(f2, reloc3, 0, UDim2.new(1.002, 0, 1.002, 0), UDim2.new(0, 0, 0, 0), "Reload")
  723. newFrame(f3, reloc3, 0, UDim2.new(1.002, 0, 1.002, 0), UDim2.new(0, 0, 0, 0), "Reload")
  724. newFrame(f4, reloc3, 0, UDim2.new(1.002, 0, 1.002, 0), UDim2.new(0, 0, 0, 0), "Reload")
  725. newLabel(f1, UDim2.new(1, 0, 0.4, 0), UDim2.new(0, 0, 0, 0), "(Z)", 18, c3(243, 242, 242), c3(0, 0, 0), true, "Key")
  726. newLabel(f2, UDim2.new(1, 0, 0.4, 0), UDim2.new(0, 0, 0, 0), "(X)", 18, c3(243, 242, 242), c3(0, 0, 0), true, "Key")
  727. newLabel(f3, UDim2.new(1, 0, 0.4, 0), UDim2.new(0, 0, 0, 0), "(C)", 18, c3(243, 242, 242), c3(0, 0, 0), true, "Key")
  728. newLabel(f4, UDim2.new(1, 0, 0.4, 0), UDim2.new(0, 0, 0, 0), "(V)", 18, c3(243, 242, 242), c3(0, 0, 0), true, "Key")
  729. newLabel(f1, UDim2.new(1, 0, 0.6, 0), UDim2.new(0, 0, 0.4, 0), a1t, 18, c3(243, 242, 242), c3(0, 0, 0), true, "Label")
  730. newLabel(f2, UDim2.new(1, 0, 0.6, 0), UDim2.new(0, 0, 0.4, 0), a2t, 18, c3(243, 242, 242), c3(0, 0, 0), true, "Label")
  731. newLabel(f3, UDim2.new(1, 0, 0.6, 0), UDim2.new(0, 0, 0.4, 0), a3t, 18, c3(243, 242, 242), c3(0, 0, 0), true, "Label")
  732. newLabel(f4, UDim2.new(1, 0, 0.6, 0), UDim2.new(0, 0, 0.4, 0), a4t, 18, c3(243, 242, 242), c3(0, 0, 0), true, "Label")
  733. g.Parent = Player.PlayerGui
  734. Reload = {}
  735. Reload[1] = f1.Reload
  736. Reload[2] = f2.Reload
  737. Reload[3] = f3.Reload
  738. Reload[4] = f4.Reload
  739. function newKnife()
  740.   local weapon = Instance.new("Model", Character)
  741.   weapon.Name = "Izayoi"
  742.   local p0 = newPart(weapon, BrickColor.new("Black"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Wedge")
  743.   mesh("SpecialMesh", p0, Enum.MeshType.Wedge, nil, Vector3.new(0, 0, 0), Vector3.new(0.400000036, 0.550000012, 1.29999995))
  744.   local p1 = newPart(weapon, BrickColor.new("Black"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Block")
  745.   mesh("BlockMesh", p1, nil, nil, Vector3.new(0, 0, 0), Vector3.new(0.400000095, 0.749999881, 0.699999988))
  746.   local p2 = newPart(weapon, BrickColor.new("Black"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Block")
  747.   mesh("BlockMesh", p2, nil, nil, Vector3.new(0, 0, 0), Vector3.new(0.400000095, 0.749999881, 0.699999869))
  748.   local p3 = newPart(weapon, BrickColor.new("Lily white"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Blade")
  749.   mesh("BlockMesh", p3, nil, nil, Vector3.new(0, 0, 0), Vector3.new(0.349999994, 5.45000029, 0.999999881))
  750.   local p4 = newPart(weapon, BrickColor.new("Lily white"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Wedge")
  751.   mesh("SpecialMesh", p4, Enum.MeshType.Wedge, nil, Vector3.new(0, 0, 0), Vector3.new(0.350000024, 3.9000001, 1.05000007))
  752.   local p5 = newPart(weapon, BrickColor.new("Black"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Wedge")
  753.   mesh("SpecialMesh", p5, Enum.MeshType.Wedge, nil, Vector3.new(0, 0, 0), Vector3.new(0.400000066, 0.550000012, 1.29999995))
  754.   local p6 = newPart(weapon, BrickColor.new("Black"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Handle")
  755.   mesh("BlockMesh", p6, nil, nil, Vector3.new(0, 0, 0), Vector3.new(0.400000036, 3.5999999, 0.699999928))
  756.   local p7 = newPart(weapon, BrickColor.new("Black"), 0, false, false, Vector3.new(0.200000003, 0.200000003, 0.200000003), "Block")
  757.   mesh("BlockMesh", p7, nil, nil, Vector3.new(0, 0, 0), Vector3.new(0.449999988, 0.349999994, 2.29999971))
  758.   weld(p0, p0, p1, CFrame.new(-30.2999763, 2.48997641, 28.180027, 1, 0, 0, 0, 1, -4.37113883E-8, 0, 4.37113883E-8, 1), CFrame.new(30.2999763, 16.1993866, -23.0049038, -1, 0, 0, 0, 0.866025388, 0.49999997, 0, 0.49999997, -0.866025388))
  759.   weld(p1, p1, p2, CFrame.new(30.2999763, 16.1993866, -23.0049038, -1, 0, 0, 0, 0.866025388, 0.49999997, 0, 0.49999997, -0.866025388), CFrame.new(30.2999763, 11.7913561, 25.5498791, -1, 0, 0, 0, -0.866025269, 0.49999997, 0, 0.49999997, 0.866025269))
  760.   weld(p2, p2, p3, CFrame.new(30.2999763, 11.7913561, 25.5498791, -1, 0, 0, 0, -0.866025269, 0.49999997, 0, 0.49999997, 0.866025269), CFrame.new(30.2999763, 26.6550255, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0))
  761.   weld(p3, p3, p4, CFrame.new(30.2999763, 26.6550255, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0), CFrame.new(30.2999763, 25.7200241, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0))
  762.   weld(p4, p4, p5, CFrame.new(30.2999763, 25.7200241, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0), CFrame.new(30.2999763, -2.59997678, 28.180027, -1, 8.74227766E-8, 0, -8.74227766E-8, -1, -4.37113883E-8, -3.82137093E-15, -4.37113883E-8, 1))
  763.   weld(p5, p5, p6, CFrame.new(30.2999763, -2.59997678, 28.180027, -1, 8.74227766E-8, 0, -8.74227766E-8, -1, -4.37113883E-8, -3.82137093E-15, -4.37113883E-8, 1), CFrame.new(30.2999763, 27.6200256, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0))
  764.   weld(p6, p6, p7, CFrame.new(30.2999763, 27.6200256, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0), CFrame.new(30.2999763, 27.2300262, 2.5449779, -1, 0, 0, 0, 0, 1, 0, 1, 0))
  765.   return weapon, p6, p3
  766. end
  767. knife1, blade1, handle1 = newKnife()
  768. handleweld1 = Instance.new("Weld", RightArm)
  769. handleweld1.Part1 = RightArm
  770. handleweld1.Part0 = handle1
  771. handle1c0 = CFrame.new(0.2, 0.95, 0) * CFrame.Angles(math.rad(85), math.rad(180), 0)
  772. handle1c1 = CFrame.new(0, -0.95, 0)
  773. handleweld1.C0 = handle1c0
  774. handleweld1.C1 = handle1c1
  775. knife2, blade2, handle2 = newKnife()
  776. handleweld2 = Instance.new("Weld", RightArm)
  777. handleweld2.Part1 = RightArm
  778. handleweld2.Part0 = handle2
  779. handle2c0 = CFrame.new(0, 0.9, 0.15) * CFrame.Angles(math.rad(55), math.rad(180), 0)
  780. handle2c1 = CFrame.new(0, -0.9, 0)
  781. handleweld2.C0 = handle2c0
  782. handleweld2.C1 = handle2c1
  783. knife3, blade3, handle3 = newKnife()
  784. handleweld3 = Instance.new("Weld", RightArm)
  785. handleweld3.Part1 = RightArm
  786. handleweld3.Part0 = handle3
  787. handle3c0 = CFrame.new(-0.2, 0.9, 0.3) * CFrame.Angles(math.rad(25), math.rad(180), 0)
  788. handle3c1 = CFrame.new(0, -0.9, 0)
  789. handleweld3.C0 = handle3c0
  790. handleweld3.C1 = handle3c1
  791. function teleport(k)
  792.   local a, b, c, d, e, f = createBodyTrail()
  793.   table.insert(partEffects, {
  794.     a,
  795.     "Disappear",
  796.     0.05
  797.   })
  798.   table.insert(partEffects, {
  799.     b,
  800.     "Disappear",
  801.     0.05
  802.   })
  803.   table.insert(partEffects, {
  804.     c,
  805.     "Disappear",
  806.     0.05
  807.   })
  808.   table.insert(partEffects, {
  809.     d,
  810.     "Disappear",
  811.     0.05
  812.   })
  813.   table.insert(partEffects, {
  814.     e,
  815.     "Disappear",
  816.     0.05
  817.   })
  818.   table.insert(partEffects, {
  819.     f,
  820.     "Disappear",
  821.     0.05
  822.   })
  823.   local unit = (RootPart.Velocity * Vector3.new(1, 0, 1)).unit
  824.   if k == "e" then
  825.   elseif k == "q" then
  826.     unit = -unit
  827.   end
  828.   local velocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  829.   local hit, pos = rayCast(RootPart.Position, unit, 15, Character)
  830.   if velocity <= 2 then
  831.     unit = RootPart.CFrame.lookVector
  832.     if k == "q" then
  833.       unit = RootPart.CFrame.lookVector * -1
  834.     end
  835.   end
  836.   if pos then
  837.     if hit then
  838.       if hit.Parent:findFirstChild("Humanoid") then
  839.         RootPart.CFrame = CFrame.new(RootPart.CFrame.p + unit * 20)
  840.       else
  841.         if hit.Parent:IsA("Model") and hit.Parent.Parent:findFirstChild("Humanoid") then
  842.           RootPart.CFrame = CFrame.new(RootPart.CFrame.p + unit * 20)
  843.         end
  844.         RootPart.CFrame = CFrame.new(pos)
  845.       end
  846.     else
  847.       RootPart.CFrame = CFrame.new(RootPart.CFrame.p + unit * 20)
  848.     end
  849.   end
  850. end
  851. function attackone()
  852.   attacking = true
  853.   cloak("Uncloak")
  854.   for i = 0, 1, 0.1 do
  855.     swait()
  856.     Neck.C0 = clerp(Neck.C0, NeckCF * CFrame.Angles(math.rad(8), 0, math.rad(-70)), 0.3)
  857.     RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.new(0, 0, 0.1 * math.cos(sine / 25)) * CFrame.Angles(0, 0, math.rad(70)), 0.3)
  858.     RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.3 - 0.1 * math.cos(sine / 15), -0.6) * CFrame.Angles(math.rad(80), 0, math.rad(-50)), 0.3)
  859.     LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5 - 0.1 * math.cos(sine / 15), 0.2) * CFrame.Angles(math.rad(15), math.rad(10), math.rad(-10)), 0.3)
  860.     RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
  861.     LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
  862.     RH.C0 = clerp(RH.C0, CFrame.new(1, -1 - 0.1 * math.cos(sine / 25), 0) * CFrame.Angles(math.rad(0), math.rad(90) - math.rad(10), math.rad(5)), 0.3)
  863.     LH.C0 = clerp(LH.C0, CFrame.new(-1, -1 - 0.1 * math.cos(sine / 25), 0) * CFrame.Angles(math.rad(0), -math.rad(90) - math.rad(10), math.rad(5)), 0.3)
  864.     handleweld1.C0 = clerp(handleweld1.C0, handle1c0, 0.3)
  865.     handleweld2.C0 = clerp(handleweld2.C0, handle2c0, 0.3)
  866.     handleweld3.C0 = clerp(handleweld3.C0, handle3c0, 0.3)
  867.   end
  868.   local dir1 = (RootPart.CFrame.lookVector + Vector3.new(math.cos(math.rad(45)), 0, math.sin(math.rad(45)))).unit
  869.   local dir2 = RootPart.CFrame.lookVector
  870.   local dir3 = (RootPart.CFrame.lookVector + Vector3.new(math.cos(math.rad(-45)), 0, math.sin(math.rad(-45)))).unit
  871.   local throwknife1 = newKnife()
  872.   throwknife1.Handle.CFrame = CFrame.new(RootPart.CFrame.p, RootPart.CFrame.p + dir1) * CFrame.Angles(math.rad(-90), 0, 0)
  873.   local bv1 = Instance.new("BodyVelocity", throwknife1.Handle)
  874.   bv1.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  875.   bv1.Velocity = dir1 * 30
  876.   local throwknife2 = newKnife()
  877.   throwknife2.Handle.CFrame = CFrame.new(RootPart.CFrame.p, RootPart.CFrame.p + dir2) * CFrame.Angles(math.rad(-90), 0, 0)
  878.   local bv2 = Instance.new("BodyVelocity", throwknife2.Handle)
  879.   bv2.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  880.   bv2.Velocity = dir2 * 30
  881.   local throwknife3 = newKnife()
  882.   throwknife3.Handle.CFrame = CFrame.new(RootPart.CFrame.p, RootPart.CFrame.p + dir3) * CFrame.Angles(math.rad(-90), 0, 0)
  883.   local bv3 = Instance.new("BodyVelocity", throwknife3.Handle)
  884.   bv3.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  885.   bv3.Velocity = dir3 * 30
  886.   thread(function()
  887.     while throwknife1.Parent ~= Effects do
  888.       swait()
  889.       local hit1, pos1
  890.       if throwknife1:findFirstChild("Blade") then
  891.         hit1, pos1 = rayCast(throwknife1.Blade.Position, dir1, 1, Character)
  892.       end
  893.       if hit1 and pos1 then
  894.         local w = weld(hit1, throwknife1.Blade, hit1, throwknife1.Blade.CFrame:toObjectSpace(hit1.CFrame))
  895.         bv1:Destroy()
  896.         if hit1.Parent:findFirstChild("Humanoid") then
  897.           basicDamage(hit1.Parent.Humanoid, 5, BrickColor.new("Fog").Color)
  898.         end
  899.         break
  900.       end
  901.     end
  902.   end)
  903.   thread(function()
  904.     while throwknife2.Parent ~= Effects do
  905.       swait()
  906.       local hit1, pos1
  907.       if throwknife2:findFirstChild("Blade") then
  908.         hit1, pos1 = rayCast(throwknife2.Blade.Position, dir2, 1, Character)
  909.       end
  910.       if hit1 and pos1 then
  911.         local w = weld(hit1, throwknife2.Blade, hit1, throwknife2.Blade.CFrame:toObjectSpace(hit1.CFrame))
  912.         bv2:Destroy()
  913.         if hit1.Parent:findFirstChild("Humanoid") then
  914.           basicDamage(hit1.Parent.Humanoid, 5, BrickColor.new("Fog").Color)
  915.         end
  916.         break
  917.       end
  918.     end
  919.   end)
  920.   thread(function()
  921.     while throwknife3.Parent ~= Effects do
  922.       swait()
  923.       local hit1, pos1
  924.       if throwknife3:findFirstChild("Blade") then
  925.         hit1, pos1 = rayCast(throwknife3.Blade.Position, dir3, 1, Character)
  926.       end
  927.       if hit1 and pos1 then
  928.         local w = weld(hit1, throwknife3.Blade, hit1, throwknife3.Blade.CFrame:toObjectSpace(hit1.CFrame))
  929.         bv3:Destroy()
  930.         if hit1.Parent:findFirstChild("Humanoid") then
  931.           basicDamage(hit1.Parent.Humanoid, 5, BrickColor.new("Fog").Color)
  932.         end
  933.         break
  934.       end
  935.     end
  936.   end)
  937.   delay(10, function()
  938.     if throwknife1 then
  939.       throwknife1:Destroy()
  940.     end
  941.     if throwknife2 then
  942.       throwknife2:Destroy()
  943.     end
  944.     if throwknife3 then
  945.       throwknife3:Destroy()
  946.     end
  947.   end)
  948.   cloak("Cloak")
  949.   for i = 0, 1, 0.1 do
  950.     swait()
  951.     Neck.C0 = clerp(Neck.C0, NeckCF * angles(math.rad(8), math.rad(0), math.rad(0)), 0.3)
  952.     RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(0.2, math.rad(0), math.rad(0)), 0.3)
  953.     RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.5, 0) * angles(math.rad(0), math.rad(-40), math.rad(90)), 0.3)
  954.     LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(45), 0, math.rad(-25)), 0.3)
  955.     RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.3)
  956.     LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.3)
  957.     RH.C0 = clerp(RH.C0, cf(1, -1, 0) * angles(math.rad(0), math.rad(90), math.rad(0)), 0.3)
  958.     LH.C0 = clerp(LH.C0, cf(-1, -1, 0) * angles(math.rad(0), math.rad(-90), math.rad(0)), 0.3)
  959.   end
  960.   attacking = false
  961. end
  962. function attacktwo()
  963.   attackone()
  964. end
  965. function attackthree()
  966.   attackone()
  967. end
  968. function mouse1d()
  969.   if tool.Active == false then
  970.     return
  971.   end
  972.   if attacking == false and attackcounter == 1 then
  973.     attackcounter = 2
  974.     attackone()
  975.   elseif attacking == false and attackcounter == 2 then
  976.     attackcounter = 3
  977.     attacktwo()
  978.   elseif attacking == false and attackcounter == 3 then
  979.     attackcounter = 1
  980.     attackthree()
  981.   end
  982. end
  983. function key(k)
  984.   if tool.Active == false then
  985.     return
  986.   end
  987.   k = k:lower()
  988.   if attacking == false and k == "z" and AttackHas[1] >= AttackNeeded[1] then
  989.   elseif attacking == false and k == "x" and AttackHas[2] >= AttackNeeded[2] then
  990.   elseif attacking == false and k == "c" and AttackHas[3] >= AttackNeeded[3] then
  991.   elseif attacking == false and k == "v" and AttackHas[4] >= AttackNeeded[4] then
  992.   elseif k == "e" then
  993.     teleport("e")
  994.   elseif k == "q" then
  995.     teleport("q")
  996.   end
  997. end
  998. mouse.Button1Down:connect(mouse1d)
  999. mouse.KeyDown:connect(key)
  1000. cloaked = false
  1001. function cloak(t)
  1002.   if t == "Cloak" then
  1003.     if cloaked == true then
  1004.       return
  1005.     end
  1006.     cloaked = true
  1007.     magic("Sphere", {
  1008.       Effects,
  1009.       BrickColor.new("Fog"),
  1010.       handle1.CFrame,
  1011.       0.5,
  1012.       0.5,
  1013.       0.5,
  1014.       1,
  1015.       2,
  1016.       1,
  1017.       0.1
  1018.     })
  1019.     magic("Sphere", {
  1020.       Effects,
  1021.       BrickColor.new("Fog"),
  1022.       handle2.CFrame,
  1023.       0.5,
  1024.       0.5,
  1025.       0.5,
  1026.       1,
  1027.       2,
  1028.       1,
  1029.       0.1
  1030.     })
  1031.     magic("Sphere", {
  1032.       Effects,
  1033.       BrickColor.new("Fog"),
  1034.       handle3.CFrame,
  1035.       0.5,
  1036.       0.5,
  1037.       0.5,
  1038.       1,
  1039.       2,
  1040.       1,
  1041.       0.1
  1042.     })
  1043.     for i, v in pairs(knife1:GetChildren()) do
  1044.       v.Transparency = 1
  1045.     end
  1046.     for i, v in pairs(knife2:GetChildren()) do
  1047.       v.Transparency = 1
  1048.     end
  1049.     for i, v in pairs(knife3:GetChildren()) do
  1050.       v.Transparency = 1
  1051.     end
  1052.     handleweld1.C0 = CFrame.new(0, -0.9, 0)
  1053.     handleweld2.C0 = CFrame.new(0, -0.9, 0)
  1054.     handleweld3.C0 = CFrame.new(0, -0.9, 0)
  1055.   elseif t == "Uncloak" then
  1056.     if cloaked == false then
  1057.       return
  1058.     end
  1059.     cloaked = false
  1060.     for i, v in pairs(knife1:GetChildren()) do
  1061.       v.Transparency = 0
  1062.     end
  1063.     for i, v in pairs(knife2:GetChildren()) do
  1064.       v.Transparency = 0
  1065.     end
  1066.     for i, v in pairs(knife3:GetChildren()) do
  1067.       v.Transparency = 0
  1068.     end
  1069.   end
  1070. end
  1071. thread(function()
  1072.   while true do
  1073.     swait()
  1074.     torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  1075.     hitfloor, posfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character)
  1076.     sine = sine + 1
  1077.     if AttackHas[1] < AttackNeeded[1] and AttackCan[1] == true then
  1078.       AttackHas[1] = AttackHas[1] + 0.03
  1079.     end
  1080.     if AttackHas[2] < AttackNeeded[2] and AttackCan[2] == true then
  1081.       AttackHas[2] = AttackHas[2] + 0.03
  1082.     end
  1083.     if AttackHas[3] < AttackNeeded[3] and AttackCan[3] == true then
  1084.       AttackHas[3] = AttackHas[3] + 0.03
  1085.     end
  1086.     if AttackHas[4] < AttackNeeded[4] and AttackCan[4] == true then
  1087.       AttackHas[4] = AttackHas[4] + 0.03
  1088.     end
  1089.     Reload[1]:TweenSize(UDim2.new(AttackHas[1] / AttackNeeded[1], 0, 1, 0), nil, 1, 0.4)
  1090.     Reload[2]:TweenSize(UDim2.new(AttackHas[2] / AttackNeeded[2], 0, 1, 0), nil, 1, 0.4)
  1091.     Reload[3]:TweenSize(UDim2.new(AttackHas[3] / AttackNeeded[3], 0, 1, 0), nil, 1, 0.4)
  1092.     Reload[4]:TweenSize(UDim2.new(AttackHas[4] / AttackNeeded[4], 0, 1, 0), nil, 1, 0.4)
  1093.     if 1 < RootPart.Velocity.y and hitfloor == nil then
  1094.       if attacking == false then
  1095.         Anim = "Jump"
  1096.         Neck.C0 = clerp(Neck.C0, NeckCF * CFrame.Angles(math.rad(-15), 0, math.rad(0)), 0.1)
  1097.         LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, math.rad(12)), 0.2)
  1098.         LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
  1099.         RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, -math.rad(12)), 0.2)
  1100.         RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
  1101.         RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(0, 0, 0), 0.2)
  1102.         RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(-12), math.rad(90), 0), 0.2)
  1103.         LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(12), -math.rad(90), 0), 0.2)
  1104.         cloak("Cloak")
  1105.       end
  1106.     elseif RootPart.Velocity.y < -1 and hitfloor == nil then
  1107.       if attacking == false then
  1108.         Anim = "Fall"
  1109.         Neck.C0 = clerp(Neck.C0, NeckCF * CFrame.Angles(math.rad(23), 0, 0), 0.2)
  1110.         RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(0, 0, 0), 0.2)
  1111.         RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, math.rad(12)), 0.2)
  1112.         RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
  1113.         LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, -math.rad(12)), 0.2)
  1114.         LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
  1115.         RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(24), math.rad(90), 0), 0.2)
  1116.         LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(-12), -math.rad(90), 0), 0.2)
  1117.       end
  1118.     elseif torvel < 1 and hitfloor ~= nil then
  1119.       if attacking == false then
  1120.         Anim = "Idle"
  1121.         Neck.C0 = clerp(Neck.C0, NeckCF * CFrame.Angles(math.rad(8), 0, math.rad(-25)), 0.1)
  1122.         RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.new(0, 0, 0.1 * math.cos(sine / 25)) * CFrame.Angles(0, 0, math.rad(25)), 0.1)
  1123.         RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.3 - 0.1 * math.cos(sine / 15), -0.6) * CFrame.Angles(math.rad(70), 0, math.rad(-45)), 0.2)
  1124.         LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5 - 0.1 * math.cos(sine / 15), 0.2) * CFrame.Angles(math.rad(15), math.rad(10), math.rad(-10)), 0.2)
  1125.         RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
  1126.         LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
  1127.         RH.C0 = clerp(RH.C0, CFrame.new(1, -1 - 0.1 * math.cos(sine / 25), 0) * CFrame.Angles(math.rad(0), math.rad(90) - math.rad(10), math.rad(5)), 0.2)
  1128.         LH.C0 = clerp(LH.C0, CFrame.new(-1, -1 - 0.1 * math.cos(sine / 25), 0) * CFrame.Angles(math.rad(0), -math.rad(90) - math.rad(10), math.rad(5)), 0.2)
  1129.         cloak("Uncloak")
  1130.         handleweld1.C0 = clerp(handleweld1.C0, handle1c0, 0.2)
  1131.         handleweld2.C0 = clerp(handleweld2.C0, handle2c0, 0.2)
  1132.         handleweld3.C0 = clerp(handleweld3.C0, handle3c0, 0.2)
  1133.       end
  1134.     elseif torvel > 2 and hitfloor ~= nil and attacking == false then
  1135.       Anim = "Walk"
  1136.       Neck.C0 = clerp(Neck.C0, NeckCF * CFrame.Angles(math.rad(8), 0, math.rad(-25)), 0.1)
  1137.       RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.new(0, 0, 0.1 * math.cos(sine / 25)) * CFrame.Angles(0.1, 0, math.rad(25)), 0.1)
  1138.       RW.C0 = clerp(RW.C0, CFrame.new(1.1, 0.3 - 0.1 * math.cos(sine / 15), -0.6) * CFrame.Angles(math.rad(90), 0, math.rad(-50)), 0.2)
  1139.       LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5 - 0.1 * math.cos(sine / 15), 0.2) * CFrame.Angles(math.rad(15), math.rad(10), math.rad(-10)), 0.2)
  1140.       RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
  1141.       LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
  1142.       RH.C0 = clerp(RH.C0, CFrame.new(1, -1 - 0.1 * math.cos(sine / 25), 0) * CFrame.Angles(math.cos(sine * 1.2 / 8), math.rad(90) - math.rad(10), math.rad(5)), 0.2)
  1143.       LH.C0 = clerp(LH.C0, CFrame.new(-1, -1 - 0.1 * math.cos(sine / 25), 0) * CFrame.Angles(-math.cos(sine * 1.2 / 8), -math.rad(90) - math.rad(10), math.rad(5)), 0.2)
  1144.       cloak("Uncloak")
  1145.       handleweld1.C0 = clerp(handleweld1.C0, CFrame.new(0.2, 0.95, 0) * CFrame.Angles(math.rad(80), math.rad(180), 0), 0.2)
  1146.       handleweld2.C0 = clerp(handleweld2.C0, CFrame.new(0, 0.95, 0.15) * CFrame.Angles(math.rad(50), math.rad(180), 0), 0.2)
  1147.       handleweld3.C0 = clerp(handleweld3.C0, CFrame.new(-0.2, 0.9, 0.3) * CFrame.Angles(math.rad(20), math.rad(180), 0), 0.2)
  1148.     end
  1149.     if 0 < #partEffects then
  1150.       for e = 1, #partEffects do
  1151.         if partEffects[e] ~= nil then
  1152.           local Thing = partEffects[e]
  1153.           if Thing ~= nil then
  1154.             local Part = Thing[1]
  1155.             local Mode = Thing[2]
  1156.             local Delay = Thing[3]
  1157.             local IncX = Thing[4]
  1158.             local IncY = Thing[5]
  1159.             local IncZ = Thing[6]
  1160.             if 1 >= Thing[1].Transparency then
  1161.               if Thing[2] == "Block1" then
  1162.                 Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  1163.                 local Mesh = Thing[1].Mesh
  1164.                 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1165.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1166.               elseif Thing[2] == "Block2" then
  1167.                 Thing[1].CFrame = Thing[1].CFrame
  1168.                 local Mesh = Thing[7]
  1169.                 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1170.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1171.               elseif Thing[2] == "Cylinder" then
  1172.                 local Mesh = Thing[1].Mesh
  1173.                 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1174.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1175.               elseif Thing[2] == "Blood" then
  1176.                 local Mesh = Thing[7]
  1177.                 Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, 0.5, 0)
  1178.                 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1179.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1180.               elseif Thing[2] == "Elec" then
  1181.                 local Mesh = Thing[1].Mesh
  1182.                 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
  1183.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1184.               elseif Thing[2] == "Disappear" then
  1185.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1186.               elseif Thing[2] == "Shatter" then
  1187.                 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1188.                 Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
  1189.                 Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  1190.                 Thing[6] = Thing[6] + Thing[5]
  1191.               end
  1192.             else
  1193.               Part:Destroy()
  1194.               table.remove(partEffects, e)
  1195.             end
  1196.           end
  1197.         end
  1198.       end
  1199.     end
  1200.   end
  1201. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement