Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Nadir Hub - Modified by Gemini v3
- - PENDEKATAN BARU: Mencari framework melalui PlayerScripts, bukan getgc. Lebih kompatibel.
- - Tetap menggunakan sistem antrian (queue) untuk fix long note.
- - Tetap tanpa run_on_actor untuk kompatibilitas.
- ]]
- -- Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local MarketplaceService = game:GetService("MarketplaceService")
- -- LocalPlayer
- local player = Players.LocalPlayer
- -- ========================================================================
- -- AUTOPLAYER LOGIC
- -- ========================================================================
- getgenv().autoplayer_enabled = false -- Biar mati secara default
- local GameFramework = nil
- local Keybinds = {}
- local ReleaseQueue = {}
- -- [[ PENDEKATAN BARU: MENCARI FRAMEWORK VIA SKRIP LOKAL ]]
- task.spawn(function()
- print("NADIR HUB: Memulai pencarian framework...")
- local playerScripts = player:WaitForChild("PlayerScripts")
- local mainHandler, VSRG_Modules
- -- Mencoba menemukan script utama game
- for i = 1, 20 do
- if mainHandler then break end
- pcall(function()
- mainHandler = playerScripts:FindFirstChild("Handler", true) or playerScripts:FindFirstChild("Main", true) or playerScripts:FindFirstChild("Game", true)
- end)
- if not mainHandler then task.wait(0.5) end
- end
- if mainHandler then
- print("NADIR HUB: Script utama ditemukan! ("..mainHandler.Name.."). Mencari VSRG...")
- pcall(function()
- -- Mencoba require module utama untuk mendapatkan framework
- VSRG_Modules = require(mainHandler)
- if type(VSRG_Modules) == "table" and VSRG_Modules.VSRG then
- GameFramework = VSRG_Modules
- else
- -- Jika gagal, coba cari module VSRG secara manual di dalam handler
- local vsrgModule = mainHandler:FindFirstChild("VSRG", true)
- if vsrgModule then
- GameFramework = require(vsrgModule)
- end
- end
- end)
- end
- if GameFramework then
- print("NADIR HUB: FRAMEWORK BERHASIL DITEMUKAN! Autoplayer siap digunakan.")
- else
- warn("NADIR HUB: GAGAL TOTAL. Framework tidak ditemukan. Kemungkinan besar masalah ada pada Executor atau game ini tidak didukung.")
- end
- end)
- -- Fungsi untuk update keybinds sesuai mode (4k, 6k, dll.)
- local function UpdateKeybinds(keyMode)
- local keyMap = {}
- for _, enum in next, Enum.KeyCode:GetEnumItems() do
- keyMap[enum.Value] = enum
- end
- Keybinds = {} -- Reset keybinds
- if GameFramework and GameFramework.VSRG.Arrows[keyMode] then
- local arrowData = GameFramework.VSRG.Arrows[keyMode].Arrows
- for i, data in pairs(arrowData) do
- local direction = tonumber(i) + 1
- if data and data.Keybinds and data.Keybinds.Keyboard[1] then
- Keybinds[direction] = keyMap[data.Keybinds.Keyboard[1]]
- end
- end
- end
- end
- -- Fungsi untuk mengirim input (tekan/lepas)
- local function SendInput(lane, isDown)
- if Keybinds[lane] then
- VirtualInputManager:SendKeyEvent(isDown, Keybinds[lane], false, nil)
- end
- end
- -- Ini adalah loop utama yang berjalan setiap frame
- RunService.RenderStepped:Connect(function()
- if not getgenv().autoplayer_enabled or not GameFramework or not pcall(function() return GameFramework.VSRG.GameHandler.Field.Game end) then return end
- local Game = GameFramework.VSRG.GameHandler.Field.Game
- local currentTime = Game.TimePosition
- if not currentTime then return end
- pcall(function()
- local currentKeyMode = GameFramework.VSRG.GameHandler.Field.Keys .. "Key"
- if #Keybinds ~= GameFramework.VSRG.GameHandler.Field.Keys then
- UpdateKeybinds(currentKeyMode)
- end
- end)
- if Game.Notes then
- for _, arrow in pairs(Game.Notes) do
- if arrow and not arrow.Marked and arrow.Field == GameFramework.VSRG.GameHandler.Field.Side and type(arrow.Time) == "number" then
- if math.abs(arrow.Time - currentTime) <= 0.045 then
- arrow.Marked = true
- SendInput(arrow.Direction, true)
- local length = arrow.Length or 0
- if length > 0.01 then
- local adjustedPlaybackSpeed = Game.AdjustedPlayback or 1
- local releaseTime = currentTime + (length / adjustedPlaybackSpeed)
- table.insert(ReleaseQueue, { Lane = arrow.Direction, Time = releaseTime })
- else
- table.insert(ReleaseQueue, { Lane = arrow.Direction, Time = currentTime + 0.03 })
- end
- end
- end
- end
- end
- if #ReleaseQueue > 0 then
- for i = #ReleaseQueue, 1, -1 do
- local noteToRelease = ReleaseQueue[i]
- if currentTime >= noteToRelease.Time then
- SendInput(noteToRelease.Lane, false)
- table.remove(ReleaseQueue, i)
- end
- end
- end
- end)
- -- ========================================================================
- -- UI SETUP (Kode UI Kamu)
- -- ========================================================================
- local GameName = MarketplaceService:GetProductInfo(game.PlaceId).Name
- local PlayerName = player.DisplayName
- local WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"))()
- local Window = WindUI:CreateWindow({
- Title = "Nadir Hub │ " .. GameName,
- Icon = "circle-user-round",
- Author = PlayerName,
- Size = UDim2.fromOffset(100, 100),
- Transparent = false,
- Theme = "Dark",
- SideBarWidth = 150,
- })
- local MainTab = Window:Tab({ Title = "Main", Icon = "house" })
- Window:SelectTab(1)
- local CreditsTab = Window:Tab({ Title = "Credits", Icon = "user-pen" })
- CreditsTab:Button({
- Title = "Discord Server",
- Desc = "Link invite Nadir Hub",
- Callback = function()
- loadstring(game:HttpGet("https://raw.githubusercontent.com/Nadir3709/Credits/main/Discord"))()
- end,
- })
- CreditsTab:Paragraph({
- Title = "Author",
- Desc = "Nadir & Nioxsantana",
- })
- MainTab:Toggle({
- Title = "Auto Player",
- Desc = "Versi perbaikan untuk mobile & long note.",
- Default = false,
- Callback = function(state)
- getgenv().autoplayer_enabled = state
- if not state then
- ReleaseQueue = {}
- end
- end
- })
- local Paragraph = MainTab:Paragraph({
- Title = "Auto Player Update.",
- Desc = "Maybe there are still some bugs for auto player in other songs / long notes arrow, I will improve it later.",
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement