local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

local Window = Rayfield:CreateWindow({
   Name = "Random Scripts ⭐",
   Icon = 0, 
   LoadingTitle = "kawaii hub [part 2]⭐",
   LoadingSubtitle = "loading in..",
   ShowText = "kawaii 2", 
   Theme = "Serenity", 

   ToggleUIKeybind = "V", 

   DisableRayfieldPrompts = false,
   DisableBuildWarnings = false, 

   ConfigurationSaving = {
      Enabled = true,
      FolderName = "Kawaii2HubConfig", 
      FileName = "Big Hub"
   },

   Discord = {
      Enabled = false, 
      Invite = "noinvitelink", 
      RememberJoins = true 
   },

   KeySystem = true, 
   KeySettings = {
      Title = "kawaii hub [pt. 2] ⭐",
      Subtitle = "Key System",
      Note = "The key is bread", 
      FileName = "Key", 
      SaveKey = true, 
      GrabKeyFromSite = true, 
      Key = {"bread"} 
   }
})

local Tab = Window:CreateTab("Universal", 4483362458) -- Title, Image

local Section = Tab:CreateSection("scripts </3")

local musicPlayer = nil -- Variable to keep track of the loaded player

local Toggle = Tab:CreateToggle({
   Name = "Youtube Music Player",
   CurrentValue = false,
   Flag = "YoutubeMusicToggle",
   Callback = function(Value)
        if Value then
            -- Execute the script when toggled ON
            local success, err = pcall(function()
                musicPlayer = loadstring(game:HttpGet('https://[Log in to view URL]', true))()
            end)
            
            if not success then
                Rayfield:Notify({Title = "Error", Content = "Failed to load: " .. tostring(err), Duration = 5})
            end
        else
            -- Logic for toggling OFF
            -- Most GUIs don't have a built-in 'destroy' method, 
            -- but if the script creates a ScreenGui, we can find and remove it.
            local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
            
            -- IMPORTANT: You must check the name of the GUI the script creates!
            -- Replace "YoutubeMusicGUI" with the actual Name property of the GUI created by that script
            local gui = playerGui:FindFirstChild("YoutubeMusicGUI") 
            if gui then
                gui:Destroy()
            end
            
            Rayfield:Notify({Title = "Music Player", Content = "Player disabled.", Duration = 3})
        end
   end,
})

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: