SHARE
TWEET

animtest

MurderFries May 24th, 2019 (edited) 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. wait()
  8. local Player = game.Players.localPlayer
  9. local Character = Player.Character
  10. local plr = game:service'Players'.LocalPlayer
  11. local Humanoid = Character.Humanoid
  12. local char = plr.Character
  13. local hum = char.Humanoid
  14. local ra = char["Right Arm"]
  15. local la= char["Left Arm"]
  16. local rl= char["Right Leg"]
  17. local ll = char["Left Leg"]
  18. local hed = char.Head
  19. local root = char.HumanoidRootPart
  20. local rootj = root.RootJoint
  21. local tors = char.Torso
  22. local mouse = plr:GetMouse()
  23. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  24. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  25. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  26. local cam = game.Workspace.CurrentCamera
  27. trazx = Instance.new("ParticleEmitter")
  28. c = game.Players.LocalPlayer.Character
  29. CF = CFrame.new
  30. angles = CFrame.Angles
  31. attack = false
  32. timetofly = true
  33. Euler = CFrame.fromEulerAnglesXYZ
  34. Rad = math.rad
  35. IT = Instance.new
  36. BrickC = BrickColor.new
  37. Cos = math.cos
  38. Acos = math.acos
  39. Sin = math.sin
  40. Asin = math.asin
  41. Abs = math.abs
  42. Mrandom = math.random
  43. Floor = math.floor
  44. random = math.random
  45. radian = math.rad
  46. Vec3 = Vector3.new
  47. cFrame = CFrame.new
  48. Euler = CFrame.fromEulerAnglesXYZ
  49. function swait(num)
  50. necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  51. RSH, LSH = nil, nil
  52. RW = Instance.new("Weld")
  53. LW = Instance.new("Weld")
  54. RH = tors["Right Hip"]
  55. LH = tors["Left Hip"]
  56. RSH = tors["Right Shoulder"]
  57. LSH = tors["Left Shoulder"]
  58. RSH.Parent = nil
  59. LSH.Parent = nil
  60. RW.Name = "RW"
  61. RW.Part0 = tors
  62. RW.C0 = CF(1.5, 0.5, 0)
  63. RW.C1 = CF(0, 0.5, 0)
  64. RW.Part1 = ra
  65. RW.Parent = tors
  66. LW.Name = "LW"
  67. LW.Part0 = tors
  68. LW.C0 = CF(-1.5, 0.5, 0)
  69. LW.C1 = CF(0, 0.5, 0)
  70. LW.Part1 = la
  71. LW.Parent = tors
  72. Effects = {}
  73.     if num == 0 or num == nil then
  74.         game:service("RunService").Stepped:wait(0)
  75.     else
  76.         for i = 0, num do
  77.             game:service("RunService").Stepped:wait(0)
  78.         end
  79.     end
  80. end
  81. function thread(f)
  82.     coroutine.resume(coroutine.create(f))
  83. end
  84. function clerp(a, b, t)
  85.     local qa = {
  86.         QuaternionFromCFrame(a)
  87.     }
  88.     local qb = {
  89.         QuaternionFromCFrame(b)
  90.     }
  91.     local ax, ay, az = a.x, a.y, a.z
  92.     local bx, by, bz = b.x, b.y, b.z
  93.     local _t = 1 - t
  94.     return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  95. end
  96. function QuaternionFromCFrame(cf)
  97.     local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  98.     local trace = m00 + m11 + m22
  99.     if trace > 0 then
  100.         local s = math.sqrt(1 + trace)
  101.         local recip = 0.5 / s
  102.         return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  103.     else
  104.         local i = 0
  105.         if m00 < m11 then
  106.             i = 1
  107.         end
  108.         if m22 > (i == 0 and m00 or m11) then
  109.             i = 2
  110.         end
  111.         if i == 0 then
  112.             local s = math.sqrt(m00 - m11 - m22 + 1)
  113.             local recip = 0.5 / s
  114.             return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  115.         elseif i == 1 then
  116.             local s = math.sqrt(m11 - m22 - m00 + 1)
  117.             local recip = 0.5 / s
  118.             return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  119.         elseif i == 2 then
  120.             local s = math.sqrt(m22 - m00 - m11 + 1)
  121.             local recip = 0.5 / s
  122.             return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  123.         end
  124.     end
  125. end
  126. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  127.     local xs, ys, zs = x + x, y + y, z + z
  128.     local wx, wy, wz = w * xs, w * ys, w * zs
  129.     local xx = x * xs
  130.     local xy = x * ys
  131.     local xz = x * zs
  132.     local yy = y * ys
  133.     local yz = y * zs
  134.     local zz = z * zs
  135.     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))
  136. end
  137. function QuaternionSlerp(a, b, t)
  138.     local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  139.     local startInterp, finishInterp
  140.     if cosTheta >= 1.0E-4 then
  141.         if 1 - cosTheta > 1.0E-4 then
  142.             local theta = math.acos(cosTheta)
  143.             local invSinTheta = 1 / Sin(theta)
  144.             startInterp = Sin((1 - t) * theta) * invSinTheta
  145.             finishInterp = Sin(t * theta) * invSinTheta
  146.         else
  147.             startInterp = 1 - t
  148.             finishInterp = t
  149.         end
  150.     elseif 1 + cosTheta > 1.0E-4 then
  151.         local theta = math.acos(-cosTheta)
  152.         local invSinTheta = 1 / Sin(theta)
  153.         startInterp = Sin((t - 1) * theta) * invSinTheta
  154.         finishInterp = Sin(t * theta) * invSinTheta
  155.     else
  156.         startInterp = t - 1
  157.         finishInterp = t
  158.     end
  159.     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
  160. end
  161. function rayCast(Position, Direction, Range, Ignore)
  162.     return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  163. end
  164. for i = 0,4,0.1 do
  165.     swait()
  166.     rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  167.     tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(30), Rad(0), Rad(0)), 0.3)
  168.     RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 , 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  169.     LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 , 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  170.     RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(140), Rad(60)), 0.1)
  171.     LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(-140), Rad(-60)), 0.1)
  172. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top