local player = game.Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") _G.MusicianAutoPlay = _G.MusicianAutoPlay or false local screenGui = playerGui:FindFirstChild("MusicianAutoPlayGUI") or Instance.new("ScreenGui") screenGui.Name = "MusicianAutoPlayGUI" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui local frame = screenGui:FindFirstChild("MainFrame") or Instance.new("Frame") frame.Name = "MainFrame" frame.Size = UDim2.new(0, 200, 0, 80) frame.Position = UDim2.new(0.5, -100, 0, 100) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 35) frame.BorderSizePixel = 2 frame.Active = true frame.Draggable = true frame.Parent = screenGui local title = frame:FindFirstChild("Title") or Instance.new("TextLabel") title.Name = "Title" title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundTransparency = 1 title.TextColor3 = Color3.new(1, 0.9, 0.7) title.Font = Enum.Font.SourceSansBold title.TextSize = 20 title.Text = "Musician Assistant" title.Parent = frame local button = frame:FindFirstChild("Toggle") or Instance.new("TextButton") button.Name = "Toggle" button.Size = UDim2.new(1, -20, 0, 40) button.Position = UDim2.new(0, 10, 0, 30) button.BackgroundColor3 = Color3.fromRGB(60, 60, 60) button.TextColor3 = Color3.new(1, 1, 1) button.Font = Enum.Font.SourceSans button.TextSize = 18 button.Text = "Auto Play: OFF" button.Parent = frame local function updateButton() if _G.MusicianAutoPlay then button.Text = "Auto Play: ON" button.BackgroundColor3 = Color3.fromRGB(0, 120, 0) else button.Text = "Auto Play: OFF" button.BackgroundColor3 = Color3.fromRGB(120, 0, 0) end end button.Activated:Connect(function() _G.MusicianAutoPlay = not _G.MusicianAutoPlay updateButton() end) updateButton() local function HookBeatTracker() local BeatTracker = require(game.ReplicatedStorage.Modules.Gameplay.BeatTracker) if _G.BeatTrackerHooked then return end _G.BeatTrackerHooked = true local oldUpdate = BeatTracker.update BeatTracker.update = function(self, dt) local v1 = tick() local beatHappened = false if self.nextBeat < v1 then beatHappened = true end oldUpdate(self, dt) if beatHappened and _G.MusicianAutoPlay then task.defer(function() if _G.MusicianAutoPlay and self.songSource and self.songSource.IsPlaying then self:hit() end end) end end end pcall(HookBeatTracker)