Advertisement
1e_0

Untitled

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