Advertisement
Nadir3709

test

Jun 9th, 2025 (edited)
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.87 KB | None | 0 0
  1. --[[
  2.     Nadir Hub - Modified by Gemini v3
  3.     - PENDEKATAN BARU: Mencari framework melalui PlayerScripts, bukan getgc. Lebih kompatibel.
  4.     - Tetap menggunakan sistem antrian (queue) untuk fix long note.
  5.     - Tetap tanpa run_on_actor untuk kompatibilitas.
  6. ]]
  7.  
  8. -- Services
  9. local Players = game:GetService("Players")
  10. local RunService = game:GetService("RunService")
  11. local VirtualInputManager = game:GetService("VirtualInputManager")
  12. local MarketplaceService = game:GetService("MarketplaceService")
  13.  
  14. -- LocalPlayer
  15. local player = Players.LocalPlayer
  16.  
  17. -- ========================================================================
  18. -- AUTOPLAYER LOGIC
  19. -- ========================================================================
  20.  
  21. getgenv().autoplayer_enabled = false -- Biar mati secara default
  22. local GameFramework = nil
  23. local Keybinds = {}
  24. local ReleaseQueue = {}
  25.  
  26. -- [[ PENDEKATAN BARU: MENCARI FRAMEWORK VIA SKRIP LOKAL ]]
  27. task.spawn(function()
  28.     print("NADIR HUB: Memulai pencarian framework...")
  29.     local playerScripts = player:WaitForChild("PlayerScripts")
  30.     local mainHandler, VSRG_Modules
  31.    
  32.     -- Mencoba menemukan script utama game
  33.     for i = 1, 20 do
  34.         if mainHandler then break end
  35.         pcall(function()
  36.             mainHandler = playerScripts:FindFirstChild("Handler", true) or playerScripts:FindFirstChild("Main", true) or playerScripts:FindFirstChild("Game", true)
  37.         end)
  38.         if not mainHandler then task.wait(0.5) end
  39.     end
  40.  
  41.     if mainHandler then
  42.         print("NADIR HUB: Script utama ditemukan! ("..mainHandler.Name.."). Mencari VSRG...")
  43.         pcall(function()
  44.             -- Mencoba require module utama untuk mendapatkan framework
  45.             VSRG_Modules = require(mainHandler)
  46.             if type(VSRG_Modules) == "table" and VSRG_Modules.VSRG then
  47.                 GameFramework = VSRG_Modules
  48.             else
  49.                 -- Jika gagal, coba cari module VSRG secara manual di dalam handler
  50.                 local vsrgModule = mainHandler:FindFirstChild("VSRG", true)
  51.                 if vsrgModule then
  52.                     GameFramework = require(vsrgModule)
  53.                 end
  54.             end
  55.         end)
  56.     end
  57.    
  58.     if GameFramework then
  59.         print("NADIR HUB: FRAMEWORK BERHASIL DITEMUKAN! Autoplayer siap digunakan.")
  60.     else
  61.         warn("NADIR HUB: GAGAL TOTAL. Framework tidak ditemukan. Kemungkinan besar masalah ada pada Executor atau game ini tidak didukung.")
  62.     end
  63. end)
  64.  
  65.  
  66. -- Fungsi untuk update keybinds sesuai mode (4k, 6k, dll.)
  67. local function UpdateKeybinds(keyMode)
  68.     local keyMap = {}
  69.     for _, enum in next, Enum.KeyCode:GetEnumItems() do
  70.         keyMap[enum.Value] = enum
  71.     end
  72.  
  73.     Keybinds = {} -- Reset keybinds
  74.     if GameFramework and GameFramework.VSRG.Arrows[keyMode] then
  75.         local arrowData = GameFramework.VSRG.Arrows[keyMode].Arrows
  76.         for i, data in pairs(arrowData) do
  77.             local direction = tonumber(i) + 1
  78.             if data and data.Keybinds and data.Keybinds.Keyboard[1] then
  79.                 Keybinds[direction] = keyMap[data.Keybinds.Keyboard[1]]
  80.             end
  81.         end
  82.     end
  83. end
  84.  
  85. -- Fungsi untuk mengirim input (tekan/lepas)
  86. local function SendInput(lane, isDown)
  87.     if Keybinds[lane] then
  88.         VirtualInputManager:SendKeyEvent(isDown, Keybinds[lane], false, nil)
  89.     end
  90. end
  91.  
  92. -- Ini adalah loop utama yang berjalan setiap frame
  93. RunService.RenderStepped:Connect(function()
  94.     if not getgenv().autoplayer_enabled or not GameFramework or not pcall(function() return GameFramework.VSRG.GameHandler.Field.Game end) then return end
  95.    
  96.     local Game = GameFramework.VSRG.GameHandler.Field.Game
  97.     local currentTime = Game.TimePosition
  98.     if not currentTime then return end
  99.  
  100.     pcall(function()
  101.         local currentKeyMode = GameFramework.VSRG.GameHandler.Field.Keys .. "Key"
  102.         if #Keybinds ~= GameFramework.VSRG.GameHandler.Field.Keys then
  103.             UpdateKeybinds(currentKeyMode)
  104.         end
  105.     end)
  106.    
  107.     if Game.Notes then
  108.         for _, arrow in pairs(Game.Notes) do
  109.             if arrow and not arrow.Marked and arrow.Field == GameFramework.VSRG.GameHandler.Field.Side and type(arrow.Time) == "number" then
  110.                 if math.abs(arrow.Time - currentTime) <= 0.045 then
  111.                     arrow.Marked = true
  112.                     SendInput(arrow.Direction, true)
  113.                    
  114.                     local length = arrow.Length or 0
  115.                     if length > 0.01 then
  116.                         local adjustedPlaybackSpeed = Game.AdjustedPlayback or 1
  117.                         local releaseTime = currentTime + (length / adjustedPlaybackSpeed)
  118.                         table.insert(ReleaseQueue, { Lane = arrow.Direction, Time = releaseTime })
  119.                     else
  120.                         table.insert(ReleaseQueue, { Lane = arrow.Direction, Time = currentTime + 0.03 })
  121.                     end
  122.                 end
  123.             end
  124.         end
  125.     end
  126.    
  127.     if #ReleaseQueue > 0 then
  128.         for i = #ReleaseQueue, 1, -1 do
  129.             local noteToRelease = ReleaseQueue[i]
  130.             if currentTime >= noteToRelease.Time then
  131.                 SendInput(noteToRelease.Lane, false)
  132.                 table.remove(ReleaseQueue, i)
  133.             end
  134.         end
  135.     end
  136. end)
  137.  
  138.  
  139. -- ========================================================================
  140. -- UI SETUP (Kode UI Kamu)
  141. -- ========================================================================
  142.  
  143. local GameName = MarketplaceService:GetProductInfo(game.PlaceId).Name
  144. local PlayerName = player.DisplayName
  145.  
  146. local WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"))()
  147.  
  148. local Window = WindUI:CreateWindow({
  149.     Title = "Nadir Hub │ " .. GameName,
  150.     Icon = "circle-user-round",
  151.     Author = PlayerName,
  152.     Size = UDim2.fromOffset(100, 100),
  153.     Transparent = false,
  154.     Theme = "Dark",
  155.     SideBarWidth = 150,
  156. })
  157.  
  158. local MainTab = Window:Tab({ Title = "Main", Icon = "house" })
  159. Window:SelectTab(1)
  160. local CreditsTab = Window:Tab({ Title = "Credits", Icon = "user-pen" })
  161.  
  162. CreditsTab:Button({
  163.     Title = "Discord Server",
  164.     Desc = "Link invite Nadir Hub",
  165.     Callback = function()
  166.         loadstring(game:HttpGet("https://raw.githubusercontent.com/Nadir3709/Credits/main/Discord"))()
  167.     end,
  168. })
  169.  
  170. CreditsTab:Paragraph({
  171.     Title = "Author",
  172.     Desc = "Nadir & Nioxsantana",
  173. })
  174.  
  175. MainTab:Toggle({
  176.     Title = "Auto Player",
  177.     Desc = "Versi perbaikan untuk mobile & long note.",
  178.     Default = false,
  179.     Callback = function(state)
  180.         getgenv().autoplayer_enabled = state
  181.        
  182.         if not state then
  183.             ReleaseQueue = {}
  184.         end
  185.     end
  186. })
  187.  
  188. local Paragraph = MainTab:Paragraph({
  189.     Title = "Auto Player Update.",
  190.     Desc = "Maybe there are still some bugs for auto player in other songs / long notes arrow, I will improve it later.",
  191. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement