1e_0

Untitled

Feb 25th, 2021 (edited)
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. -- FNF Script 😱
  2.  
  3. -- the accurancy depends on fps
  4. -- change 0.3 to some number until it works perfectly for you (mine works at 0.3) (local del = 0.3)
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. local syn = {}
  23. syn.get_thread_identity = getthreadcontext
  24. syn.set_thread_identity = setthreadcontext
  25.  
  26. local vim = game:GetService("VirtualInputManager")
  27. local plr = game:GetService("Players").LocalPlayer
  28. local root = plr.Character.HumanoidRootPart
  29. local del = 0.3 -- the accurancy depends on fps
  30. -- change 0.3 to some number until it works perfectly for you (mine works at 0.3)
  31.  
  32. local function getpos()
  33. local parts = workspace.Stages:GetDescendants()
  34. local nearest = nil;
  35. local closest = 0;
  36.  
  37. for i,v in pairs(parts) do
  38. if v.Name:sub(1, 1) == "P" and v:IsA("BasePart") then
  39. if closest < (root.Position - v.Position).Magnitude then
  40. nearest = v
  41. closest = (root.Position - v.Position).Magnitude
  42. end
  43. end
  44. end
  45.  
  46. return nearest.Name:gsub("%D+", "")
  47. end
  48.  
  49. local keymap = {
  50. ["U"] = Enum.KeyCode.W,
  51. ["D"] = Enum.KeyCode.S,
  52. ["L"] = Enum.KeyCode.A,
  53. ["R"] = Enum.KeyCode.D
  54. }
  55.  
  56. local player = game:GetService("Players").LocalPlayer
  57. local gui = player.PlayerGui
  58.  
  59. local function hit(key, await)
  60. wait(2 / await - del)
  61. vim:SendKeyEvent(true, keymap[key], false, game)
  62. end
  63.  
  64. gui.ChildAdded:Connect(function(ui)
  65. if ui.Name == "FNFMode" then
  66. local scr = ui:WaitForChild("FNFMain")
  67. local succ, env = pcall(getsenv, scr)
  68.  
  69. if not succ then
  70. wait(2)
  71. succ, env = pcall(getsenv, scr)
  72. end
  73.  
  74. local orig = env.Note
  75. local our = getpos();
  76.  
  77. env.Note = function(key, opp, await)
  78.  
  79. local old = syn.get_thread_identity()
  80. syn.set_thread_identity(7)
  81.  
  82. local turn = opp:gsub("%D+", "")
  83. print(tonumber(our), tonumber(turn))
  84.  
  85. if tonumber(our) ~= tonumber(turn) then
  86. coroutine.wrap(hit)(key, await)
  87. end
  88.  
  89. syn.set_thread_identity(old)
  90.  
  91. return orig(key, opp, await)
  92. end
  93. end
  94. end)
  95.  
  96. game.StarterGui:SetCore("SendNotification", {
  97. Title = "Script loaded.";
  98. Text = "enjoy being pro!!";
  99. Duration = 16;
  100. Callback = bindableFunction;
  101. })
  102.  
  103.  
  104.  
Add Comment
Please, Sign In to add comment