-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] local CONFIG = { Enabled = true, ToggleKey = Enum.KeyCode.RightShift, ReFireAfterMiss = true, RemoteErrorJitter = true, SpinnerBoost = true, SpinnerExtra = 0, NetworkLeadMs = 100, LatencyMs = 0, } local sharedEnv = nil if typeof(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" then sharedEnv = env end end if not sharedEnv then sharedEnv = _G end local RUN_GEN = (tonumber(sharedEnv.AutoRhythmGen) or 0) + 1 sharedEnv.AutoRhythmGen = RUN_GEN local function isCurrentRun() return sharedEnv.AutoRhythmGen == RUN_GEN end if typeof(sharedEnv.AutoRhythmCleanup) == "function" then pcall(sharedEnv.AutoRhythmCleanup) end local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local HttpService = game:GetService("HttpService") local player = Players.LocalPlayer local Data = require(ReplicatedStorage:WaitForChild("NgamenOsuData")) local Ngamen = nil pcall(function() Ngamen = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Ngamen") end) local hook = { tried = false, ok = false, reason = "not attempted", loopFn = nil, nilaiNotFn = nil, t35Index = nil, t35Owner = nil, nilaiNotUps = nil, v135Index = nil, lastTry = 0, } local function getupvalues(fn) local vals = {} if typeof(debug) ~= "table" or typeof(debug.getupvalue) ~= "function" then return vals end local i = 1 while i <= 64 do local ok, name, val = pcall(debug.getupvalue, fn, i) if not ok or name == nil then break end vals[i] = { name = name, value = val } i += 1 end return vals end local function fnParams(fn) if typeof(debug) ~= "table" or typeof(debug.getinfo) ~= "function" then return nil end local ok, info = pcall(debug.getinfo, fn) if ok and type(info) == "table" then return info.nparams end return nil end local function isSessionTable(v) return type(v) == "table" and type(v.daftar) == "table" and type(v.nilai) == "table" and type(v.aktif) == "table" end local function scanFnForSession(fn, ups) ups = ups or getupvalues(fn) for idx, u in ipairs(ups) do if isSessionTable(u.value) then if hook.t35Index == nil then hook.t35Index = idx hook.t35Owner = fn end return u.value end end return nil end local function hookGame() if hook.ok or os.clock() - hook.lastTry < 1 then return hook.ok end hook.lastTry = os.clock() hook.tried = true if typeof(getconnections) ~= "function" then hook.reason = "getconnections missing (executor has no UNC)" return false end if typeof(debug) ~= "table" or typeof(debug.getupvalue) ~= "function" then hook.reason = "debug.getupvalue missing (executor has no UNC)" return false end local ok, conns = pcall(getconnections, RunService.RenderStepped) if not ok or type(conns) ~= "table" then hook.reason = "getconnections(RenderStepped) failed" return false end local nFn, maxUps, nWithInstance = 0, 0, 0 local connType = nil for _, c in ipairs(conns) do if connType == nil then connType = type(c) end local fn = nil if typeof(c) == "function" then fn = c else local okf, f = pcall(function() return c.Function end) if okf and typeof(f) == "function" then fn = f end end if typeof(fn) == "function" then nFn += 1 local ups = getupvalues(fn) if #ups > maxUps then maxUps = #ups end local hasGui, hasInstance = false, false for _, u in ipairs(ups) do local v = u.value if typeof(v) == "Instance" then hasInstance = true if v.Name == "NgamenOsuGui" then hasGui = true break end end end if hasInstance then nWithInstance += 1 end local foundNilaiNot = nil if not hasGui then for _, u in ipairs(ups) do local f = u.value if typeof(f) == "function" then local fups = getupvalues(f) local hasNgamen = false for _, fu in ipairs(fups) do if fu.value == Ngamen then hasNgamen = true break end end if hasNgamen and fnParams(f) == 3 then foundNilaiNot = f hook.nilaiNotUps = fups break end end end end if hasGui or foundNilaiNot then hook.loopFn = fn local best, bestCount = nil, -1 if foundNilaiNot then best = foundNilaiNot else for _, u in ipairs(ups) do local f = u.value if typeof(f) == "function" then local fups = getupvalues(f) local hasNgamen = false for _, fu in ipairs(fups) do if fu.value == Ngamen then hasNgamen = true break end end if hasNgamen then local np = fnParams(f) if np == 3 then best = f hook.nilaiNotUps = fups break elseif np == nil and #fups > bestCount then best, bestCount = f, #fups hook.nilaiNotUps = fups end end end end end hook.nilaiNotFn = best if hook.nilaiNotFn == nil then hook.reason = "loop found, but nilaiNot not identified" continue end for idx, u in ipairs(ups) do if type(u.value) == "string" and (u.value == "main" or u.value == "pilih" or u.value == "hasil") then hook.v135Index = idx break end end if hook.v135Index == nil then local strings = {} for idx, u in ipairs(ups) do if type(u.value) == "string" then table.insert(strings, idx) end end if #strings == 1 then hook.v135Index = strings[1] end end hook.ok = true hook.reason = "hooked" if hook.nilaiNotFn then scanFnForSession(hook.nilaiNotFn, hook.nilaiNotUps) end return true end end end if Ngamen then local ok2, conns2 = pcall(getconnections, Ngamen.OnClientEvent) if ok2 and type(conns2) == "table" then for _, c in ipairs(conns2) do local fn = nil if typeof(c) == "function" then fn = c else local okf, f = pcall(function() return c.Function end) if okf and typeof(f) == "function" then fn = f end end if typeof(fn) == "function" then local ups = getupvalues(fn) if scanFnForSession(fn, ups) then hook.loopFn = fn hook.ok = true hook.reason = "hooked via OnClientEvent (session only, no ketuk)" return true end end end end end local diag = string.format("conns=%d withFn=%d maxUps=%d withInstance=%d connType=%s", #conns, nFn, maxUps, nWithInstance, tostring(connType)) hook.reason = "no RenderStepped connection with NgamenOsuGui found (" .. diag .. ")" return false end local function readHookSession() if not hook.ok then return nil end local owner = hook.t35Owner or hook.nilaiNotFn if not owner then return nil end if hook.t35Index ~= nil then local ok, _, val = pcall(debug.getupvalue, owner, hook.t35Index) if ok and isSessionTable(val) then return val end if ok and val == nil then return nil end hook.t35Index = nil hook.t35Owner = nil end return scanFnForSession(owner) end local function readHookMode() if not hook.ok or not hook.loopFn or hook.v135Index == nil then return nil end local ok, _, val = pcall(debug.getupvalue, hook.loopFn, hook.v135Index) if ok and type(val) == "string" then return val end return nil end local playerGui = player:WaitForChild("PlayerGui") local CoreGui = game:GetService("CoreGui") do for _, parent in ipairs({ CoreGui, playerGui }) do for _, old in ipairs(parent:GetChildren()) do if old.Name == "AutoRhythmGui" then old:Destroy() end end end end local function el(class, props, parent) local i = Instance.new(class) for k, v in pairs(props) do i[k] = v end if parent then i.Parent = parent end return i end local screenGui = el("ScreenGui", { Name = "AutoRhythmGui", ResetOnSpawn = false, DisplayOrder = 999 }) do local ok = pcall(function() screenGui.Parent = CoreGui end) if not ok then screenGui.Parent = playerGui end end local GUI_W = 288 local GUI_H = 176 local HEADER_H = 38 local mainFrame = el("Frame", { Name = "Main", Size = UDim2.fromOffset(GUI_W, GUI_H), Position = UDim2.fromOffset(16, 16), BackgroundColor3 = Color3.fromRGB(14, 14, 14), BackgroundTransparency = 0.06, BorderSizePixel = 0 }, screenGui) el("UIStroke", { Color = Color3.fromRGB(75, 75, 75), Transparency = 0, Thickness = 1 }, mainFrame) local header = el("Frame", { Name = "Header", Size = UDim2.new(1, 0, 0, HEADER_H), BackgroundTransparency = 1, Active = true }, mainFrame) local statusDot = el("Frame", { Name = "Dot", Size = UDim2.fromOffset(9, 9), Position = UDim2.fromOffset(12, 14), BackgroundColor3 = Color3.fromRGB(255, 255, 255), BorderSizePixel = 0 }, header) el("TextLabel", { Name = "Title", Size = UDim2.fromOffset(150, HEADER_H), Position = UDim2.fromOffset(26, 0), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.GothamBold, TextSize = 18, TextXAlignment = Enum.TextXAlignment.Left, Text = "Sakizu" }, header) local minBtn = el("TextButton", { Name = "Minimise", Size = UDim2.fromOffset(28, 28), Position = UDim2.fromOffset(GUI_W - 60, 5), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(190, 190, 190), Font = Enum.Font.GothamBold, TextSize = 18, Text = "–" }, header) local hideBtn = el("TextButton", { Name = "Hide", Size = UDim2.fromOffset(28, 28), Position = UDim2.fromOffset(GUI_W - 30, 5), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(190, 190, 190), Font = Enum.Font.GothamBold, TextSize = 18, Text = "×" }, header) local bodyFrame = el("Frame", { Name = "Body", Size = UDim2.new(1, 0, 1, -HEADER_H), Position = UDim2.fromOffset(0, HEADER_H), BackgroundTransparency = 1 }, mainFrame) local statusLbl = el("TextLabel", { Name = "Status", Size = UDim2.fromOffset(GUI_W - 24, 56), Position = UDim2.fromOffset(12, 10), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(225, 225, 225), Font = Enum.Font.Gotham, TextSize = 14, TextWrapped = false, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, Text = "Starting..." }, bodyFrame) local warnLbl = el("TextLabel", { Name = "HudWarning", Size = UDim2.fromOffset(GUI_W - 24, 15), Position = UDim2.fromOffset(12, 70), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(255, 215, 0), Font = Enum.Font.Gotham, TextSize = 11, TextWrapped = false, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, Text = "", Visible = false }, bodyFrame) local toggleBtn = el("TextButton", { Name = "Toggle", Size = UDim2.fromOffset(GUI_W - 24, 32), Position = UDim2.fromOffset(12, 94), BackgroundColor3 = Color3.fromRGB(255, 255, 255), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(0, 0, 0), Font = Enum.Font.GothamBold, TextSize = 14, Text = "Auto Rhythm: ON" }, bodyFrame) local lastStatus = nil local function setStatus(s) if s == lastStatus then return end lastStatus = s local main, warn = s, nil local hud = s:match("\n(HUD shows misses[^\n]*)$") if hud then main = s:sub(1, #s - #hud - 1) warn = hud end local lines = {} for line in (main .. "\n"):gmatch("(.-)\n") do if #line > 34 then local cut = line:sub(1, 31) local sp = cut:match(".*()%s") if sp and sp > 20 then line = cut:sub(1, sp - 1) .. "..." else line = cut .. "..." end end lines[#lines + 1] = line end statusLbl.Text = table.concat(lines, "\n") warnLbl.Visible = warn ~= nil if warn then warnLbl.Text = warn end end local function makeDraggable(frame, handle) local dragging = false local dragStart, frameStart handle.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position frameStart = frame.Position end end) handle.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart frame.Position = UDim2.new(frameStart.X.Scale, frameStart.X.Offset + delta.X, frameStart.Y.Scale, frameStart.Y.Offset + delta.Y) end end) handle.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) end makeDraggable(mainFrame, header) local showBtn = el("TextButton", { Name = "Show", Size = UDim2.fromOffset(48, 48), Position = UDim2.fromOffset(16, 16), BackgroundColor3 = Color3.fromRGB(255, 255, 255), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(0, 0, 0), Font = Enum.Font.GothamBold, TextSize = 22, Text = "S", Visible = false }, screenGui) makeDraggable(showBtn, showBtn) local minimized = false local function setMinimized(m) minimized = m bodyFrame.Visible = not m mainFrame.Size = m and UDim2.fromOffset(GUI_W, HEADER_H) or UDim2.fromOffset(GUI_W, GUI_H) minBtn.Text = m and "+" or "–" end minBtn.MouseButton1Click:Connect(function() setMinimized(not minimized) end) hideBtn.MouseButton1Click:Connect(function() showBtn.Position = mainFrame.Position mainFrame.Visible = false showBtn.Visible = true end) showBtn.MouseButton1Click:Connect(function() showBtn.Visible = false mainFrame.Visible = true end) local function getGui() return playerGui:FindFirstChild("NgamenOsuGui") end local function hookSessionActive() local sess = readHookSession() if not sess or sess.id == nil or sess.selesai == true then return nil end local mode = readHookMode() if mode ~= nil and mode ~= "main" then return nil end return sess end local function sessionActive(gui) if hookSessionActive() then return true end if not gui then return false end local main = gui:FindFirstChild("Main") if not main or not main.Visible then return false end local char = player.Character if not char then return false end return char:GetAttribute("NgamenLagu") ~= nil and char:GetAttribute("NgamenMulai") ~= nil end local function diagnoseSession(gui) local sess = readHookSession() if hook.ok then if sess then if sess.selesai == true then return "hook: session finished (selesai=true) — wait for the next song" end local mode = readHookMode() if mode ~= nil and mode ~= "main" then return "hook: session exists but mode is \"" .. mode .. "\" (not playing yet)" end return "hook: session looks active but sessionActive() disagreed (report this)" end return "hook: no live session (t35 is nil) — pick a song and press PLAY" end if not gui then return "no NgamenOsuGui (the game's UI is not open — open Ngamen Osu first)" end local main = gui:FindFirstChild("Main") if not main then return "no Main frame inside NgamenOsuGui (game UI changed?)" end if not main.Visible then return "Main hidden (no song playing yet — pick a song and press PLAY)" end local char = player.Character if not char then return "no Character (respawning?)" end if char:GetAttribute("NgamenLagu") == nil then return "no NgamenLagu attribute (server has not started a song — press PLAY)" end if char:GetAttribute("NgamenMulai") == nil then return "no NgamenMulai attribute (server has not started a song — press PLAY)" end return "session looks active but sessionActive() disagreed (report this)" end local function readGeser() local raw = player:GetAttribute("NgamenGeser") if type(raw) ~= "string" then return 0 end local ok, tbl = pcall(function() return HttpService:JSONDecode(raw) end) if not ok or type(tbl) ~= "table" then return 0 end local alat = "pc" if UserInputService:GetLastInputType() == Enum.UserInputType.Touch then alat = "sentuh" end local ms = tonumber(tbl[alat]) if not ms then return 0 end return math.clamp(ms / 1000, -0.25, 0.25) end local lastTP, lastTPClock = 0, 0 local function songTime() local gui = getGui() local sound = gui and gui:FindFirstChild("LaguOsu") local nowClock = os.clock() if sound and sound.IsPlaying and sound.TimePosition > 0 then if sound.TimePosition ~= lastTP then lastTP = sound.TimePosition lastTPClock = nowClock return sound.TimePosition elseif nowClock - lastTPClock <= 0.25 then return sound.TimePosition end end local char = player.Character local mulai = char and char:GetAttribute("NgamenMulai") if mulai then return workspace:GetServerTimeNow() - mulai end return nil end local function serverTimeFrom(sess) if sess then if sess.jam ~= nil then return sess.jam + (os.clock() - (sess.jamOs or 0)) elseif sess.mulai ~= nil then return workspace:GetServerTimeNow() - sess.mulai end end local char = player.Character local mulai = char and char:GetAttribute("NgamenMulai") if mulai then return workspace:GetServerTimeNow() - mulai end return nil end local function remoteClock(sess) return serverTimeFrom(sess) end local function gameClock(sess) local sc = serverTimeFrom(sess) if sc == nil then return songTime() end local g = 0 if sess and sess.geser ~= nil then g = sess.geser else g = readGeser() end return sc - g end local chart, chartKey = nil, nil local songId, tingkat, mel, geser = nil, 1, 0.22, 0 local idx = 1 local refireQueue = {} local lastFrameError = nil local function loadChart() local char = player.Character if not char then return false end local id = char:GetAttribute("NgamenLagu") local mulai = char:GetAttribute("NgamenMulai") local ting = math.clamp(math.floor(tonumber(char:GetAttribute("NgamenTingkat")) or 1), 0, 3) local key = tostring(id) .. ":" .. tostring(ting) .. ":" .. tostring(mulai) if key == chartKey and chart then return true end local ok, daftar = pcall(function() return Data.daftar(id, ting) end) if not ok or type(daftar) ~= "table" or #daftar == 0 then return false end local _, _, c = Data.jendela(ting) chart, chartKey = daftar, key songId, tingkat, mel = id, ting, c geser = readGeser() refireQueue = {} idx = 1 local now = songTime() if now then while idx <= #chart and (chart[idx].t + mel) < now do idx += 1 end end return true end local function setEnabled(on) CONFIG.Enabled = on toggleBtn.Text = on and "Auto Rhythm: ON" or "Auto Rhythm: OFF" toggleBtn.BackgroundColor3 = on and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(45, 45, 45) toggleBtn.TextColor3 = on and Color3.fromRGB(0, 0, 0) or Color3.fromRGB(170, 170, 170) statusDot.BackgroundColor3 = on and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(90, 90, 90) if not on then refireQueue = {} end end toggleBtn.MouseButton1Click:Connect(function() setEnabled(not CONFIG.Enabled) end) local inputConn = UserInputService.InputBegan:Connect(function(input, gpe) if not gpe and input.KeyCode == CONFIG.ToggleKey then setEnabled(not CONFIG.Enabled) end end) local function fmtClock(sec) sec = math.max(0, sec or 0) return string.format("%d:%02d", math.floor(sec / 60), math.floor(sec % 60)) end local function songCountdown(now) if not chart or #chart == 0 or not now then return "0:00" end local last = chart[#chart] local endT = (last.t or 0) + (last.dur or 0) return fmtClock(endT - now) end local function songStatus(now, nextLine) return string.format("Song : %s - %s\nNext : %s", tostring(songId), songCountdown(now), nextLine) end local function fireRemote(note, i) if not Ngamen then return false end local jenis = note.jenis or 0 local ok = pcall(function() if jenis == 0 then local errVal = 0 if CONFIG.RemoteErrorJitter then errVal = (math.random() * 2 - 1) * 0.012 end Ngamen:FireServer("ketukOsu", i, 2, errVal) elseif jenis == 1 then local song = Data.lagu(songId) local parts = Data.bagianSlider(note, song and song.bpm or 120) Ngamen:FireServer("ketukOsu", i, 2, string.rep("1", #parts)) elseif jenis == 2 then local perlu = Data.putaranPerlu(note, tingkat) local spins = perlu if CONFIG.SpinnerBoost then local ok, maks = pcall(Data.putaranMaks, note) if ok and type(maks) == "number" then spins = math.floor(maks) end if CONFIG.SpinnerExtra and CONFIG.SpinnerExtra > 0 then spins = spins + CONFIG.SpinnerExtra end end Ngamen:FireServer("ketukOsu", i, 2, spins) end end) return ok end local function queueReFire(note, i) local jenis = note.jenis or 0 local base = note.t + (jenis == 0 and mel or (note.dur or 0)) local sess = readHookSession() if sess then table.insert(refireQueue, { at = base + 0.1, note = note, i = i, useGameClock = true }) else table.insert(refireQueue, { at = base + geser + 0.25, note = note, i = i, useGameClock = false }) end end local conn = nil local function frameStep() if not isCurrentRun() then if conn then conn:Disconnect() conn = nil end if screenGui and screenGui.Parent then screenGui:Destroy() end return end if not CONFIG.Enabled then setStatus("OFF — RightShift or the button to enable.") return end hookGame() local sess = hookSessionActive() local gui = getGui() if not sess and (not gui or not sessionActive(gui)) then chart, chartKey = nil, nil refireQueue = {} local char = player.Character local noInstrument = char and char:GetAttribute("Ngamen") == nil local hookLine = hook.ok and ("HOOKED" .. (readHookMode() and (" · " .. readHookMode()) or "")) or ("FALLBACK · " .. hook.reason) setStatus("IDLE — " .. diagnoseSession(gui) .. (noInstrument and "\nNo instrument — equip one in Lemari > Musik." or "") .. "\n" .. hookLine .. "\nremote · Ngamen: " .. (Ngamen and "yes" or "no")) return end if not loadChart() then setStatus("Chart failed to load.") return end sess = hookSessionActive() local now = songTime() if not now then return end if not Ngamen then setStatus("No Ngamen remote found.\nRejoin the game.") return end local st = remoteClock(sess) or now local gc = gameClock(sess) for i = #refireQueue, 1, -1 do local r = refireQueue[i] local clock = (r.useGameClock and gc) or st if clock ~= nil and clock >= r.at then fireRemote(r.note, r.i) table.remove(refireQueue, i) end end local function fireDeadline(n) if (n.jenis or 0) == 0 then return n.t + mel end return n.t + (n.dur or 0) + 0.25 end while idx <= #chart and fireDeadline(chart[idx]) < st do idx += 1 end local note = chart[idx] if not note then setStatus(songStatus(st, "waiting for results") .. "\nHUD shows misses - RESULTS is the truth.") return end local jenis = note.jenis or 0 local fireAt = note.t + (jenis == 0 and 0 or (note.dur or 0)) + CONFIG.LatencyMs / 1000 - CONFIG.NetworkLeadMs / 1000 if st >= fireAt then fireRemote(note, idx) if CONFIG.ReFireAfterMiss then queueReFire(note, idx) end idx += 1 return end setStatus(songStatus(st, string.format("#%d %s in %.2fs", idx, ({"circle", "slider", "spinner"})[jenis + 1], math.max(0, fireAt - st))) .. "\nHUD shows misses - RESULTS is the truth.") return end conn = RunService.RenderStepped:Connect(function() local ok, err = pcall(frameStep) if not ok then local msg = tostring(err) if msg ~= lastFrameError then lastFrameError = msg setStatus("ERROR in Auto Rhythm loop:\n" .. msg .. "\nThe script keeps running — report this error text.") end end end) local function cleanup() if conn then conn:Disconnect() conn = nil end if inputConn then inputConn:Disconnect() inputConn = nil end if screenGui and screenGui.Parent then screenGui:Destroy() end end sharedEnv.AutoRhythmCleanup = cleanup setStatus("Ready — remote mode.\nStart a song in Ngamen Osu.")