Advertisement
SCRIPT_ROBLOX2324

Copy this script FNF

Aug 24th, 2021
1,571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.45 KB | None | 0 0
  1. Script By: HappyMan Subscribe
  2.  
  3.  
  4. -- 8/2/21
  5. -- + Added 'Manual' mode which allows you to force the notes to hit a specific type by holding down a keybind.
  6. -- * Switched fastWait and fastSpawn to Roblox's task libraries
  7. -- * Attempted to fix 'invalid key to next' errors
  8.  
  9. -- 5/12/21
  10. -- Attempted to fix the autoplayer missing as much.
  11.  
  12. -- 5/16/21
  13. -- Attempt to fix invisible notes.
  14. -- Added hit chances & an autoplayer toggle
  15. -- ! Hit chances are a bit rough but should work.
  16.  
  17. -- I have only tested on Synapse X
  18. -- Script-Ware v2 should work fine
  19. -- KRNL should work fine
  20.  
  21. -- Needed functions: setthreadcontext, getconnections, getgc, getloaodedmodules
  22. -- That should be it!
  23.  
  24. -- You may find some contact information on the GitHub repo.
  25.  
  26. local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/wally-rblx/uwuware-ui/main/main.lua"))()
  27.  
  28. local framework, scrollHandler
  29. while true do
  30. for _, obj in next, getgc(true) do
  31. if type(obj) == 'table' and rawget(obj, 'GameUI') then
  32. framework = obj;
  33. break
  34. end
  35. end
  36.  
  37. for _, module in next, getloadedmodules() do
  38. if module.Name == 'ScrollHandler' then
  39. scrollHandler = module;
  40. break;
  41. end
  42. end
  43.  
  44. if (type(framework) == 'table') and (typeof(scrollHandler) == 'Instance') then
  45. break
  46. end
  47.  
  48. wait(1)
  49. end
  50.  
  51. local runService = game:GetService('RunService')
  52. local userInputService = game:GetService('UserInputService')
  53. local client = game:GetService('Players').LocalPlayer;
  54. local random = Random.new()
  55.  
  56. local task = task or getrenv().task;
  57. local fastWait, fastSpawn = task.wait, task.spawn;
  58.  
  59. local fireSignal, rollChance do
  60. -- updated for script-ware or whatever
  61. -- attempted to update for krnl
  62. local set_identity = (type(syn) == 'table' and syn.set_thread_identity) or setidentity or setthreadcontext
  63. function fireSignal(target, signal, ...)
  64. -- getconnections with InputBegan / InputEnded does not work without setting Synapse to the game's context level
  65. set_identity(2)
  66. for _, signal in next, getconnections(signal) do
  67. if type(signal.Function) == 'function' and islclosure(signal.Function) then
  68. local scr = rawget(getfenv(signal.Function), 'script')
  69. if scr == target then
  70. pcall(signal.Function, ...)
  71. end
  72. end
  73. end
  74. set_identity(7)
  75. end
  76.  
  77. -- uses a weighted random system
  78. -- its a bit scuffed rn but it works good enough
  79.  
  80. function rollChance()
  81. if (library.flags.autoPlayerMode == 'Manual') then
  82. if (library.flags.sickHeld) then return 'Sick' end
  83. if (library.flags.goodHeld) then return 'Good' end
  84. if (library.flags.okayHeld) then return 'Ok' end
  85. if (library.flags.missHeld) then return 'Bad' end
  86.  
  87. return 'Bad' -- incase if it cant find one
  88. end
  89.  
  90. local chances = {
  91. { type = 'Sick', value = library.flags.sickChance },
  92. { type = 'Good', value = library.flags.goodChance },
  93. { type = 'Ok', value = library.flags.okChance },
  94. { type = 'Bad', value = library.flags.badChance },
  95. }
  96.  
  97. table.sort(chances, function(a, b)
  98. return a.value > b.value
  99. end)
  100.  
  101. local sum = 0;
  102. for i = 1, #chances do
  103. sum += chances[i].value
  104. end
  105.  
  106. if sum == 0 then
  107. -- forgot to change this before?
  108. -- fixed 6/5/21
  109. return chances[random:NextInteger(1, 4)].type
  110. end
  111.  
  112. local initialWeight = random:NextInteger(0, sum)
  113. local weight = 0;
  114.  
  115. for i = 1, #chances do
  116. weight = weight + chances[i].value
  117.  
  118. if weight > initialWeight then
  119. return chances[i].type
  120. end
  121. end
  122.  
  123. return 'Sick' -- just incase it fails?
  124. end
  125. end
  126.  
  127. local map = { [0] = 'Left', [1] = 'Down', [2] = 'Up', [3] = 'Right', }
  128. local keys = { Up = Enum.KeyCode.Up; Down = Enum.KeyCode.Down; Left = Enum.KeyCode.Left; Right = Enum.KeyCode.Right; }
  129.  
  130. -- they are "weird" because they are in the middle of their Upper & Lower ranges
  131. -- should hopefully make them more precise!
  132. local chanceValues = {
  133. Sick = 96,
  134. Good = 92,
  135. Ok = 87,
  136. Bad = 75
  137. }
  138.  
  139. local hitChances = {}
  140.  
  141. if shared._id then
  142. pcall(runService.UnbindFromRenderStep, runService, shared._id)
  143. end
  144.  
  145. shared._id = game:GetService('HttpService'):GenerateGUID(false)
  146. runService:BindToRenderStep(shared._id, 1, function()
  147. if (not library.flags.autoPlayer) then return end
  148.  
  149. local arrows = {}
  150. for _, obj in next, framework.UI.ActiveSections do
  151. arrows[#arrows + 1] = obj;
  152. end
  153.  
  154. for idx = 1, #arrows do
  155. local arrow = arrows[idx]
  156. if type(arrow) ~= 'table' then
  157. continue
  158. end
  159.  
  160. if (arrow.Side == framework.UI.CurrentSide) and (not arrow.Marked) then
  161. local indice = (arrow.Data.Position % 4)
  162. local position = map[indice]
  163.  
  164. if (position) then
  165. local currentTime = framework.SongPlayer.CurrentlyPlaying.TimePosition
  166. local distance = (1 - math.abs(arrow.Data.Time - currentTime)) * 100
  167.  
  168. if (arrow.Data.Time == 0) then
  169. continue
  170. end
  171.  
  172. local result = rollChance()
  173. arrow._hitChance = arrow._hitChance or result;
  174.  
  175. local hitChance = (library.flags.autoPlayerMode == 'Manual' and result or arrow._hitChance)
  176. if distance >= chanceValues[hitChance] then
  177. fastSpawn(function()
  178. arrow.Marked = true;
  179. fireSignal(scrollHandler, userInputService.InputBegan, { KeyCode = keys[position], UserInputType = Enum.UserInputType.Keyboard }, false)
  180.  
  181. if arrow.Data.Length > 0 then
  182. -- wait depending on the arrows length so the animation can play
  183. fastWait(arrow.Data.Length)
  184. else
  185. -- 0.1 seems to make it miss more, this should be fine enough?
  186. fastWait(0.05)
  187. end
  188.  
  189. fireSignal(scrollHandler, userInputService.InputEnded, { KeyCode = keys[position], UserInputType = Enum.UserInputType.Keyboard }, false)
  190. arrow.Marked = nil;
  191. end)
  192. end
  193. end
  194. end
  195. end
  196. end)
  197.  
  198. local window = library:CreateWindow('Funky Friday') do
  199. local folder = window:AddFolder('Main') do
  200. folder:AddToggle({ text = 'Autoplayer', flag = 'autoPlayer' })
  201. folder:AddList({ text = 'Autoplayer mode', flag = 'autoPlayerMode', values = { 'Chances', 'Manual' } })
  202.  
  203. folder:AddSlider({ text = 'Sick %', flag = 'sickChance', min = 0, max = 100, value = 100 })
  204. folder:AddSlider({ text = 'Good %', flag = 'goodChance', min = 0, max = 100, value = 0 })
  205. folder:AddSlider({ text = 'Ok %', flag = 'okChance', min = 0, max = 100, value = 0 })
  206. folder:AddSlider({ text = 'Bad %', flag = 'badChance', min = 0, max = 100, value = 0 })
  207. end
  208.  
  209. local folder = window:AddFolder('Keybinds') do
  210. folder:AddBind({ text = 'Sick', flag = 'sickBind', key = Enum.KeyCode.One, hold = true, callback = function(val) library.flags.sickHeld = (not val) end, })
  211. folder:AddBind({ text = 'Good', flag = 'goodBind', key = Enum.KeyCode.Two, hold = true, callback = function(val) library.flags.goodHeld = (not val) end, })
  212. folder:AddBind({ text = 'Ok', flag = 'okBind', key = Enum.KeyCode.Three, hold = true, callback = function(val) library.flags.okayHeld = (not val) end, })
  213. folder:AddBind({ text = 'Bad', flag = 'badBind', key = Enum.KeyCode.Four, hold = true, callback = function(val) library.flags.missHeld = (not val) end, })
  214. end
  215.  
  216. local folder = window:AddFolder('Credits') do
  217. folder:AddLabel({ text = 'Credits' })
  218. folder:AddLabel({ text = 'Jan - UI library' })
  219. folder:AddLabel({ text = 'wally - Script' })
  220. end
  221.  
  222. window:AddLabel({ text = 'Version 1.3' })
  223. window:AddLabel({ text = 'Updated 8/2/21' })
  224. window:AddBind({ text = 'Menu toggle', key = Enum.KeyCode.Delete, callback = function() library:Close() end })
  225. end
  226.  
  227. library:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement