--==================================================-- -- MXR نسخه الأصوات + تطوير mx_501xm -- -- Programmer: mx_501xm (Saudi Programmer) -- --==================================================-- local Players = game:GetService("Players") local HttpService = game:GetService("HttpService") local SoundService = game:GetService("SoundService") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local FILENAME = "mxr_music_folders_data.json" local foldersList = {} local function loadData() if readfile and isfile and isfile(FILENAME) then local success, result = pcall(function() return HttpService:JSONDecode(readfile(FILENAME)) end) if success and type(result) == "table" then foldersList = result else foldersList = { {name = "العامة", songs = {}} } end else foldersList = { {name = "العامة", songs = {}} } end end local function saveData() if writefile then pcall(function() writefile(FILENAME, HttpService:JSONEncode(foldersList)) end) end end loadData() -- Audio Controller & State Sync local currentSound = nil local currentPlayingCode = nil local activePlayButtons = {} -- تتبع الأزرار لتحديث حالتها فورياً local function stopAudio() if currentSound then currentSound:Stop() currentSound:Destroy() currentSound = nil end currentPlayingCode = nil -- إعادة جميع أزرار التشغيل لحالتها الطبيعية for code, btnInfo in pairs(activePlayButtons) do if btnInfo and btnInfo.Button and btnInfo.Button.Parent then btnInfo.Button.Text = "▶" btnInfo.Button.BackgroundColor3 = Color3.fromRGB(138, 43, 226) end end end local function playAudio(id, btn) local cleanId = id:match("%d+") if not cleanId then return end -- إذا كانت نفس الأغنية شغالة، نوقفها if currentPlayingCode == cleanId then stopAudio() return end stopAudio() currentPlayingCode = cleanId local sound = Instance.new("Sound") sound.SoundId = "rbxassetid://" .. cleanId sound.Volume = 1 sound.Looped = true sound.Parent = SoundService sound:Play() currentSound = sound -- تحديث حالة الزر الحالي if btn then btn.Text = "⏹" btn.BackgroundColor3 = Color3.fromRGB(210, 140, 0) end sound.Ended:Connect(function() if currentPlayingCode == cleanId then stopAudio() end end) end -- UI Construction local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "MXR_MusicSaver" ScreenGui.ResetOnSpawn = false local successParent, _ = pcall(function() ScreenGui.Parent = game:GetService("CoreGui") end) if not successParent then ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") end -- Main Canvas Frame local MainFrame = Instance.new("Frame") MainFrame.Name = "MainFrame" MainFrame.Size = UDim2.new(0, 280, 0, 310) MainFrame.Position = UDim2.new(0.5, -140, 0.5, -155) MainFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 22) MainFrame.BackgroundTransparency = 0.25 MainFrame.BorderSizePixel = 0 MainFrame.Active = true MainFrame.Draggable = false MainFrame.Parent = ScreenGui local MainUICorner = Instance.new("UICorner") MainUICorner.CornerRadius = UDim.new(0, 7) MainUICorner.Parent = MainFrame local MainStroke = Instance.new("UIStroke") MainStroke.Color = Color3.fromRGB(110, 45, 180) MainStroke.Transparency = 0.3 MainStroke.Thickness = 1.5 MainStroke.Parent = MainFrame -- Header local Header = Instance.new("Frame") Header.Size = UDim2.new(1, 0, 0, 28) Header.BackgroundColor3 = Color3.fromRGB(22, 18, 32) Header.BackgroundTransparency = 0.3 Header.BorderSizePixel = 0 Header.Parent = MainFrame local HeaderCorner = Instance.new("UICorner") HeaderCorner.CornerRadius = UDim.new(0, 7) HeaderCorner.Parent = Header local Title = Instance.new("TextLabel") Title.Size = UDim2.new(0.68, 0, 1, 0) Title.Position = UDim2.new(0.03, 0, 0, 0) Title.BackgroundTransparency = 1 Title.Text = "MXR | mx_501xm" Title.TextColor3 = Color3.fromRGB(255, 255, 255) Title.TextSize = 9.5 Title.Font = Enum.Font.GothamBold Title.TextXAlignment = Enum.TextXAlignment.Left Title.Parent = Header -- Control Buttons Container (Top Right) local TopButtonsContainer = Instance.new("Frame") TopButtonsContainer.Size = UDim2.new(0, 42, 0, 18) TopButtonsContainer.Position = UDim2.new(1, -46, 0, 5) TopButtonsContainer.BackgroundTransparency = 1 TopButtonsContainer.Parent = Header local MinimizeBtn = Instance.new("TextButton") MinimizeBtn.Size = UDim2.new(0, 18, 0, 18) MinimizeBtn.Position = UDim2.new(0, 0, 0, 0) MinimizeBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 60) MinimizeBtn.Text = "-" MinimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255) MinimizeBtn.TextSize = 11 MinimizeBtn.Font = Enum.Font.GothamBold MinimizeBtn.Parent = TopButtonsContainer local MinCorner = Instance.new("UICorner") MinCorner.CornerRadius = UDim.new(0, 3) MinCorner.Parent = MinimizeBtn local CloseBtn = Instance.new("TextButton") CloseBtn.Size = UDim2.new(0, 18, 0, 18) CloseBtn.Position = UDim2.new(0, 21, 0, 0) CloseBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 50) CloseBtn.Text = "X" CloseBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CloseBtn.TextSize = 9 CloseBtn.Font = Enum.Font.GothamBold CloseBtn.Parent = TopButtonsContainer local CloseCorner = Instance.new("UICorner") CloseCorner.CornerRadius = UDim.new(0, 3) CloseCorner.Parent = CloseBtn -- Floating Icon (زر صورة احترافي بدلاً من إيموجي نصي) local FloatingBtn = Instance.new("ImageButton") FloatingBtn.Name = "FloatingBtn" FloatingBtn.Size = UDim2.new(0, 38, 0, 38) FloatingBtn.Position = UDim2.new(1, -48, 0.5, -19) FloatingBtn.BackgroundColor3 = Color3.fromRGB(22, 18, 32) FloatingBtn.Image = "rbxassetid://6031075931" FloatingBtn.ImageColor3 = Color3.fromRGB(200, 150, 255) FloatingBtn.Visible = false FloatingBtn.Parent = ScreenGui local FloatCorner = Instance.new("UICorner") FloatCorner.CornerRadius = UDim.new(0, 19) FloatCorner.Parent = FloatingBtn local FloatStroke = Instance.new("UIStroke") FloatStroke.Color = Color3.fromRGB(138, 43, 226) FloatStroke.Thickness = 2 FloatStroke.Parent = FloatingBtn local dragging, dragInput, dragStart, startPos local hasMoved = false FloatingBtn.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = FloatingBtn.Position hasMoved = false input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) FloatingBtn.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if input == dragInput and dragging then local delta = input.Position - dragStart if delta.Magnitude > 5 then hasMoved = true end FloatingBtn.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) FloatingBtn.MouseButton1Click:Connect(function() if not hasMoved then MainFrame.Visible = true FloatingBtn.Visible = false end end) -- Main Search Box local SearchBox = Instance.new("TextBox") SearchBox.Size = UDim2.new(0.92, 0, 0, 22) SearchBox.Position = UDim2.new(0.04, 0, 0, 34) SearchBox.BackgroundColor3 = Color3.fromRGB(25, 22, 35) SearchBox.BackgroundTransparency = 0.4 SearchBox.PlaceholderText = "🔍 بحث عام في كل الأغاني..." SearchBox.PlaceholderColor3 = Color3.fromRGB(140, 130, 160) SearchBox.Text = "" SearchBox.TextColor3 = Color3.fromRGB(255, 255, 255) SearchBox.TextSize = 9.5 SearchBox.Font = Enum.Font.Gotham SearchBox.Parent = MainFrame local SearchCorner = Instance.new("UICorner") SearchCorner.CornerRadius = UDim.new(0, 4) SearchCorner.Parent = SearchBox -- Containers Frame local ContainerFrame = Instance.new("Frame") ContainerFrame.Size = UDim2.new(0.92, 0, 0, 195) ContainerFrame.Position = UDim2.new(0.04, 0, 0, 60) ContainerFrame.BackgroundTransparency = 1 ContainerFrame.Parent = MainFrame -- Scrollable List inside Container local ScrollFrame = Instance.new("ScrollingFrame") ScrollFrame.Size = UDim2.new(1, 0, 1, 0) ScrollFrame.Position = UDim2.new(0, 0, 0, 0) ScrollFrame.BackgroundTransparency = 1 ScrollFrame.BorderSizePixel = 0 ScrollFrame.ScrollBarThickness = 2.5 ScrollFrame.ScrollBarImageColor3 = Color3.fromRGB(138, 43, 226) ScrollFrame.Parent = ContainerFrame local UIListLayout = Instance.new("UIListLayout") UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder UIListLayout.Padding = UDim.new(0, 4) UIListLayout.Parent = ScrollFrame -- User Profile Info (Bottom Left Corner) local UserInfoFrame = Instance.new("Frame") UserInfoFrame.Size = UDim2.new(0.92, 0, 0, 30) UserInfoFrame.Position = UDim2.new(0.04, 0, 1, -34) UserInfoFrame.BackgroundColor3 = Color3.fromRGB(22, 18, 32) UserInfoFrame.BackgroundTransparency = 0.4 UserInfoFrame.BorderSizePixel = 0 UserInfoFrame.Parent = MainFrame local UserInfoCorner = Instance.new("UICorner") UserInfoCorner.CornerRadius = UDim.new(0, 5) UserInfoCorner.Parent = UserInfoFrame local AvatarImg = Instance.new("ImageLabel") AvatarImg.Size = UDim2.new(0, 20, 0, 20) AvatarImg.Position = UDim2.new(0, 4, 0.5, -10) AvatarImg.BackgroundColor3 = Color3.fromRGB(35, 30, 48) AvatarImg.Parent = UserInfoFrame local AvatarCorner = Instance.new("UICorner") AvatarCorner.CornerRadius = UDim.new(0, 10) AvatarCorner.Parent = AvatarImg pcall(function() local content = Players:GetUserThumbnailAsync(LocalPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150) AvatarImg.Image = content end) local DisplayNameLabel = Instance.new("TextLabel") DisplayNameLabel.Size = UDim2.new(0.75, 0, 0.45, 0) DisplayNameLabel.Position = UDim2.new(0, 28, 0, 3) DisplayNameLabel.BackgroundTransparency = 1 DisplayNameLabel.Text = LocalPlayer.DisplayName DisplayNameLabel.TextColor3 = Color3.fromRGB(255, 255, 255) DisplayNameLabel.TextSize = 9 DisplayNameLabel.Font = Enum.Font.GothamBold DisplayNameLabel.TextXAlignment = Enum.TextXAlignment.Left DisplayNameLabel.Parent = UserInfoFrame local UsernameLabel = Instance.new("TextLabel") UsernameLabel.Size = UDim2.new(0.75, 0, 0.45, 0) UsernameLabel.Position = UDim2.new(0, 28, 0, 14) UsernameLabel.BackgroundTransparency = 1 UsernameLabel.Text = "@" .. LocalPlayer.Name UsernameLabel.TextColor3 = Color3.fromRGB(160, 150, 180) UsernameLabel.TextSize = 8 UsernameLabel.Font = Enum.Font.Gotham UsernameLabel.TextXAlignment = Enum.TextXAlignment.Left UsernameLabel.Parent = UserInfoFrame -- Modal Dialog Component local function createModal(titleText, bodyText, onConfirm) local ModalOverlay = Instance.new("Frame") ModalOverlay.Size = UDim2.new(1, 0, 1, 0) ModalOverlay.BackgroundColor3 = Color3.fromRGB(0, 0, 0) ModalOverlay.BackgroundTransparency = 0.5 ModalOverlay.ZIndex = 10 ModalOverlay.Parent = MainFrame local ModalBox = Instance.new("Frame") ModalBox.Size = UDim2.new(0, 200, 0, 100) ModalBox.Position = UDim2.new(0.5, -100, 0.5, -50) ModalBox.BackgroundColor3 = Color3.fromRGB(25, 22, 35) ModalBox.ZIndex = 11 ModalBox.Parent = ModalOverlay local MCorner = Instance.new("UICorner") MCorner.CornerRadius = UDim.new(0, 5) MCorner.Parent = ModalBox local MTitle = Instance.new("TextLabel") MTitle.Size = UDim2.new(1, 0, 0, 22) MTitle.BackgroundTransparency = 1 MTitle.Text = titleText MTitle.TextColor3 = Color3.fromRGB(255, 255, 255) MTitle.TextSize = 11 MTitle.Font = Enum.Font.GothamBold MTitle.ZIndex = 11 MTitle.Parent = ModalBox local MText = Instance.new("TextLabel") MText.Size = UDim2.new(0.9, 0, 0, 30) MText.Position = UDim2.new(0.05, 0, 0, 25) MText.BackgroundTransparency = 1 MText.Text = bodyText MText.TextColor3 = Color3.fromRGB(200, 190, 210) MText.TextSize = 9.5 MText.TextWrapped = true MText.Font = Enum.Font.Gotham MText.ZIndex = 11 MText.Parent = ModalBox local YesBtn = Instance.new("TextButton") YesBtn.Size = UDim2.new(0.4, 0, 0, 22) YesBtn.Position = UDim2.new(0.08, 0, 0, 66) YesBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 50) YesBtn.Text = "نعم" YesBtn.TextColor3 = Color3.fromRGB(255, 255, 255) YesBtn.Font = Enum.Font.GothamBold YesBtn.TextSize = 11 YesBtn.ZIndex = 11 YesBtn.Parent = ModalBox local YCorner = Instance.new("UICorner") YCorner.CornerRadius = UDim.new(0, 4) YCorner.Parent = YesBtn local NoBtn = Instance.new("TextButton") NoBtn.Size = UDim2.new(0.4, 0, 0, 22) NoBtn.Position = UDim2.new(0.52, 0, 0, 66) NoBtn.BackgroundColor3 = Color3.fromRGB(50, 45, 65) NoBtn.Text = "لا" NoBtn.TextColor3 = Color3.fromRGB(255, 255, 255) NoBtn.Font = Enum.Font.GothamBold NoBtn.TextSize = 11 NoBtn.ZIndex = 11 NoBtn.Parent = ModalBox local NCorner = Instance.new("UICorner") NCorner.CornerRadius = UDim.new(0, 4) NCorner.Parent = NoBtn YesBtn.MouseButton1Click:Connect(function() ModalOverlay:Destroy() onConfirm() end) NoBtn.MouseButton1Click:Connect(function() ModalOverlay:Destroy() end) end -- Prompt for Folder creation local function createFolderPrompt() local ModalOverlay = Instance.new("Frame") ModalOverlay.Size = UDim2.new(1, 0, 1, 0) ModalOverlay.BackgroundColor3 = Color3.fromRGB(0, 0, 0) ModalOverlay.BackgroundTransparency = 0.5 ModalOverlay.ZIndex = 10 ModalOverlay.Parent = MainFrame local ModalBox = Instance.new("Frame") ModalBox.Size = UDim2.new(0, 220, 0, 115) ModalBox.Position = UDim2.new(0.5, -110, 0.5, -57) ModalBox.BackgroundColor3 = Color3.fromRGB(25, 22, 35) ModalBox.ZIndex = 11 ModalBox.Parent = ModalOverlay local MCorner = Instance.new("UICorner") MCorner.CornerRadius = UDim.new(0, 6) MCorner.Parent = ModalBox local MTitle = Instance.new("TextLabel") MTitle.Size = UDim2.new(1, 0, 0, 24) MTitle.BackgroundTransparency = 1 MTitle.Text = "📁 إنشاء مجلد جديد" MTitle.TextColor3 = Color3.fromRGB(255, 255, 255) MTitle.TextSize = 11 MTitle.Font = Enum.Font.GothamBold MTitle.ZIndex = 11 MTitle.Parent = ModalBox local FolderInput = Instance.new("TextBox") FolderInput.Size = UDim2.new(0.9, 0, 0, 26) FolderInput.Position = UDim2.new(0.05, 0, 0, 32) FolderInput.BackgroundColor3 = Color3.fromRGB(35, 30, 48) FolderInput.PlaceholderText = "اسم المجلد..." FolderInput.PlaceholderColor3 = Color3.fromRGB(140, 130, 160) FolderInput.Text = "" FolderInput.TextColor3 = Color3.fromRGB(255, 255, 255) FolderInput.TextSize = 10 FolderInput.Font = Enum.Font.Gotham FolderInput.ZIndex = 11 FolderInput.Parent = ModalBox local FICorner = Instance.new("UICorner") FICorner.CornerRadius = UDim.new(0, 4) FICorner.Parent = FolderInput local CreateBtn = Instance.new("TextButton") CreateBtn.Size = UDim2.new(0.4, 0, 0, 24) CreateBtn.Position = UDim2.new(0.08, 0, 0, 75) CreateBtn.BackgroundColor3 = Color3.fromRGB(138, 43, 226) CreateBtn.Text = "إنشاء" CreateBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CreateBtn.Font = Enum.Font.GothamBold CreateBtn.TextSize = 10 CreateBtn.ZIndex = 11 CreateBtn.Parent = ModalBox local CCorner = Instance.new("UICorner") CCorner.CornerRadius = UDim.new(0, 4) CCorner.Parent = CreateBtn local CancelBtn = Instance.new("TextButton") CancelBtn.Size = UDim2.new(0.4, 0, 0, 24) CancelBtn.Position = UDim2.new(0.52, 0, 0, 75) CancelBtn.BackgroundColor3 = Color3.fromRGB(50, 45, 65) CancelBtn.Text = "إلغاء" CancelBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CancelBtn.Font = Enum.Font.GothamBold CancelBtn.TextSize = 10 CancelBtn.ZIndex = 11 CancelBtn.Parent = ModalBox local CancelCorner = Instance.new("UICorner") CancelCorner.CornerRadius = UDim.new(0, 4) CancelCorner.Parent = CancelBtn CreateBtn.MouseButton1Click:Connect(function() if FolderInput.Text ~= "" then table.insert(foldersList, {name = FolderInput.Text, songs = {}}) saveData() ModalOverlay:Destroy() renderView(SearchBox.Text) end end) CancelBtn.MouseButton1Click:Connect(function() ModalOverlay:Destroy() end) end -- Prompt for Adding Song local function createSongPrompt() local ModalOverlay = Instance.new("Frame") ModalOverlay.Size = UDim2.new(1, 0, 1, 0) ModalOverlay.BackgroundColor3 = Color3.fromRGB(0, 0, 0) ModalOverlay.BackgroundTransparency = 0.5 ModalOverlay.ZIndex = 10 ModalOverlay.Parent = MainFrame local ModalBox = Instance.new("Frame") ModalBox.Size = UDim2.new(0, 240, 0, 195) ModalBox.Position = UDim2.new(0.5, -120, 0.5, -97) ModalBox.BackgroundColor3 = Color3.fromRGB(25, 22, 35) ModalBox.ZIndex = 11 ModalBox.Parent = ModalOverlay local MCorner = Instance.new("UICorner") MCorner.CornerRadius = UDim.new(0, 6) MCorner.Parent = ModalBox local MTitle = Instance.new("TextLabel") MTitle.Size = UDim2.new(1, 0, 0, 24) MTitle.BackgroundTransparency = 1 MTitle.Text = "🎵 إضافة أغنية جديدة" MTitle.TextColor3 = Color3.fromRGB(255, 255, 255) MTitle.TextSize = 11 MTitle.Font = Enum.Font.GothamBold MTitle.ZIndex = 11 MTitle.Parent = ModalBox local NameInput = Instance.new("TextBox") NameInput.Size = UDim2.new(0.9, 0, 0, 24) NameInput.Position = UDim2.new(0.05, 0, 0, 30) NameInput.BackgroundColor3 = Color3.fromRGB(35, 30, 48) NameInput.PlaceholderText = "اسم الأغنية..." NameInput.PlaceholderColor3 = Color3.fromRGB(140, 130, 160) NameInput.Text = "" NameInput.TextColor3 = Color3.fromRGB(255, 255, 255) NameInput.TextSize = 10 NameInput.Font = Enum.Font.Gotham NameInput.ZIndex = 11 NameInput.Parent = ModalBox local NCorner = Instance.new("UICorner") NCorner.CornerRadius = UDim.new(0, 4) NCorner.Parent = NameInput local CodeInput = Instance.new("TextBox") CodeInput.Size = UDim2.new(0.9, 0, 0, 24) CodeInput.Position = UDim2.new(0.05, 0, 0, 58) CodeInput.BackgroundColor3 = Color3.fromRGB(35, 30, 48) CodeInput.PlaceholderText = "كود ID الأغنية..." CodeInput.PlaceholderColor3 = Color3.fromRGB(140, 130, 160) CodeInput.Text = "" CodeInput.TextColor3 = Color3.fromRGB(255, 255, 255) CodeInput.TextSize = 10 CodeInput.Font = Enum.Font.Gotham CodeInput.ZIndex = 11 CodeInput.Parent = ModalBox local CCorner = Instance.new("UICorner") CCorner.CornerRadius = UDim.new(0, 4) CCorner.Parent = CodeInput local chosenFolderIdx = 1 local SelectFolderBtn = Instance.new("TextButton") SelectFolderBtn.Size = UDim2.new(0.9, 0, 0, 24) SelectFolderBtn.Position = UDim2.new(0.05, 0, 0, 86) SelectFolderBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 60) SelectFolderBtn.Text = "📁 المجلد: " .. foldersList[1].name SelectFolderBtn.TextColor3 = Color3.fromRGB(255, 255, 255) SelectFolderBtn.Font = Enum.Font.Gotham SelectFolderBtn.TextSize = 10 SelectFolderBtn.ZIndex = 11 SelectFolderBtn.Parent = ModalBox local SFCorner = Instance.new("UICorner") SFCorner.CornerRadius = UDim.new(0, 4) SFCorner.Parent = SelectFolderBtn SelectFolderBtn.MouseButton1Click:Connect(function() chosenFolderIdx = chosenFolderIdx + 1 if chosenFolderIdx > #foldersList then chosenFolderIdx = 1 end SelectFolderBtn.Text = "📁 المجلد: " .. foldersList[chosenFolderIdx].name end) local SaveBtn = Instance.new("TextButton") SaveBtn.Size = UDim2.new(0.4, 0, 0, 24) SaveBtn.Position = UDim2.new(0.08, 0, 0, 122) SaveBtn.BackgroundColor3 = Color3.fromRGB(138, 43, 226) SaveBtn.Text = "حفظ" SaveBtn.TextColor3 = Color3.fromRGB(255, 255, 255) SaveBtn.Font = Enum.Font.GothamBold SaveBtn.TextSize = 10 SaveBtn.ZIndex = 11 SaveBtn.Parent = ModalBox local SCorner = Instance.new("UICorner") SCorner.CornerRadius = UDim.new(0, 4) SCorner.Parent = SaveBtn local CancelBtn = Instance.new("TextButton") CancelBtn.Size = UDim2.new(0.4, 0, 0, 24) CancelBtn.Position = UDim2.new(0.52, 0, 0, 122) CancelBtn.BackgroundColor3 = Color3.fromRGB(50, 45, 65) CancelBtn.Text = "إلغاء" CancelBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CancelBtn.Font = Enum.Font.GothamBold CancelBtn.TextSize = 10 CancelBtn.ZIndex = 11 CancelBtn.Parent = ModalBox local CancelCorner = Instance.new("UICorner") CancelCorner.CornerRadius = UDim.new(0, 4) CancelCorner.Parent = CancelBtn SaveBtn.MouseButton1Click:Connect(function() if NameInput.Text ~= "" and CodeInput.Text ~= "" then table.insert(foldersList[chosenFolderIdx].songs, {name = NameInput.Text, code = CodeInput.Text}) saveData() ModalOverlay:Destroy() renderView(SearchBox.Text) end end) CancelBtn.MouseButton1Click:Connect(function() ModalOverlay:Destroy() end) end -- Navigation States local currentView = "folders" local activeFolderIndex = nil renderView = function(filter) filter = filter and filter:lower() or "" activePlayButtons = {} -- إعادة ضبط خريطة الأزرار النشطة عند كل تحديث للعرض for _, child in ipairs(ScrollFrame:GetChildren()) do if child:IsA("Frame") then child:Destroy() end end if filter ~= "" then for fIdx, folder in ipairs(foldersList) do for sIdx, item in ipairs(folder.songs) do if item.name:lower():find(filter, 1, true) or item.code:find(filter, 1, true) or folder.name:lower():find(filter, 1, true) then local cleanId = item.code:match("%d+") or "" local ItemFrame = Instance.new("Frame") ItemFrame.Size = UDim2.new(1, 0, 0, 32) ItemFrame.BackgroundColor3 = Color3.fromRGB(22, 18, 32) ItemFrame.BackgroundTransparency = 0.4 ItemFrame.Parent = ScrollFrame local ICorner = Instance.new("UICorner") ICorner.CornerRadius = UDim.new(0, 4) ICorner.Parent = ItemFrame local ItemName = Instance.new("TextLabel") ItemName.Size = UDim2.new(0.5, 0, 0.45, 0) ItemName.Position = UDim2.new(0.03, 0, 0.08, 0) ItemName.BackgroundTransparency = 1 ItemName.Text = item.name .. " (" .. folder.name .. ")" ItemName.TextColor3 = Color3.fromRGB(255, 255, 255) ItemName.TextSize = 9 ItemName.Font = Enum.Font.GothamBold ItemName.TextXAlignment = Enum.TextXAlignment.Left ItemName.Parent = ItemFrame local ItemCode = Instance.new("TextLabel") ItemCode.Size = UDim2.new(0.5, 0, 0.45, 0) ItemCode.Position = UDim2.new(0.03, 0, 0.5, 0) ItemCode.BackgroundTransparency = 1 ItemCode.Text = "ID: " .. item.code ItemCode.TextColor3 = Color3.fromRGB(160, 150, 180) ItemCode.TextSize = 8 ItemCode.Font = Enum.Font.Gotham ItemCode.TextXAlignment = Enum.TextXAlignment.Left ItemCode.Parent = ItemFrame local CopyBtn = Instance.new("TextButton") CopyBtn.Size = UDim2.new(0, 20, 0, 20) CopyBtn.Position = UDim2.new(1, -66, 0.5, -10) CopyBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 60) CopyBtn.Text = "📋" CopyBtn.TextSize = 9 CopyBtn.Parent = ItemFrame local CCorner = Instance.new("UICorner") CCorner.CornerRadius = UDim.new(0, 3) CCorner.Parent = CopyBtn local PlayStopBtn = Instance.new("TextButton") PlayStopBtn.Size = UDim2.new(0, 20, 0, 20) PlayStopBtn.Position = UDim2.new(1, -44, 0.5, -10) -- مزامنة حالة الزر بناءً على الصوت الشغال حالياً if currentPlayingCode == cleanId then PlayStopBtn.Text = "⏹" PlayStopBtn.BackgroundColor3 = Color3.fromRGB(210, 140, 0) else PlayStopBtn.Text = "▶" PlayStopBtn.BackgroundColor3 = Color3.fromRGB(138, 43, 226) end PlayStopBtn.TextColor3 = Color3.fromRGB(255, 255, 255) PlayStopBtn.TextSize = 9 PlayStopBtn.Parent = ItemFrame activePlayButtons[cleanId] = {Button = PlayStopBtn, Code = cleanId} local PSCorner = Instance.new("UICorner") PSCorner.CornerRadius = UDim.new(0, 3) PSCorner.Parent = PlayStopBtn local DeleteBtn = Instance.new("TextButton") DeleteBtn.Size = UDim2.new(0, 20, 0, 20) DeleteBtn.Position = UDim2.new(1, -22, 0.5, -10) DeleteBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 50) DeleteBtn.Text = "🗑" DeleteBtn.TextSize = 9 DeleteBtn.Parent = ItemFrame local DCorner = Instance.new("UICorner") DCorner.CornerRadius = UDim.new(0, 3) DCorner.Parent = DeleteBtn CopyBtn.MouseButton1Click:Connect(function() if setclipboard then setclipboard(item.code) end end) PlayStopBtn.MouseButton1Click:Connect(function() playAudio(item.code, PlayStopBtn) end) DeleteBtn.MouseButton1Click:Connect(function() createModal("حذف الأغنية", "هل أنت متأكد من حذف هذه الأغنية؟", function() table.remove(foldersList[fIdx].songs, sIdx) saveData() renderView(SearchBox.Text) end) end) end end end ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y + 10) return end if currentView == "folders" then local TopActions = Instance.new("Frame") TopActions.Size = UDim2.new(1, 0, 0, 24) TopActions.BackgroundTransparency = 1 TopActions.Parent = ScrollFrame local AddFolderBtn = Instance.new("TextButton") AddFolderBtn.Size = UDim2.new(0.48, 0, 1, 0) AddFolderBtn.Position = UDim2.new(0, 0, 0, 0) AddFolderBtn.BackgroundColor3 = Color3.fromRGB(138, 43, 226) AddFolderBtn.Text = "+ مجلد جديد" AddFolderBtn.TextColor3 = Color3.fromRGB(255, 255, 255) AddFolderBtn.TextSize = 9 AddFolderBtn.Font = Enum.Font.GothamBold AddFolderBtn.Parent = TopActions local AFC = Instance.new("UICorner") AFC.CornerRadius = UDim.new(0, 4) AFC.Parent = AddFolderBtn local AddSongGlobalBtn = Instance.new("TextButton") AddSongGlobalBtn.Size = UDim2.new(0.48, 0, 1, 0) AddSongGlobalBtn.Position = UDim2.new(0.52, 0, 0, 0) AddSongGlobalBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 60) AddSongGlobalBtn.Text = "+ إضافة أغنية" AddSongGlobalBtn.TextColor3 = Color3.fromRGB(255, 255, 255) AddSongGlobalBtn.TextSize = 9 AddSongGlobalBtn.Font = Enum.Font.GothamBold AddSongGlobalBtn.Parent = TopActions local ASGC = Instance.new("UICorner") ASGC.CornerRadius = UDim.new(0, 4) ASGC.Parent = AddSongGlobalBtn AddFolderBtn.MouseButton1Click:Connect(function() createFolderPrompt() end) AddSongGlobalBtn.MouseButton1Click:Connect(function() createSongPrompt() end) for index, folder in ipairs(foldersList) do local FolderFrame = Instance.new("Frame") FolderFrame.Size = UDim2.new(1, 0, 0, 32) FolderFrame.BackgroundColor3 = Color3.fromRGB(22, 18, 32) FolderFrame.BackgroundTransparency = 0.4 FolderFrame.Parent = ScrollFrame local FCorner = Instance.new("UICorner") FCorner.CornerRadius = UDim.new(0, 5) FCorner.Parent = FolderFrame local FolderName = Instance.new("TextButton") FolderName.Size = UDim2.new(0.7, 0, 1, 0) FolderName.Position = UDim2.new(0.03, 0, 0, 0) FolderName.BackgroundTransparency = 1 FolderName.Text = "📁 " .. folder.name .. " (" .. #folder.songs .. ")" FolderName.TextColor3 = Color3.fromRGB(255, 255, 255) FolderName.TextSize = 9.5 FolderName.Font = Enum.Font.GothamBold FolderName.TextXAlignment = Enum.TextXAlignment.Left FolderName.Parent = FolderFrame FolderName.MouseButton1Click:Connect(function() currentView = "folder_songs" activeFolderIndex = index renderView(SearchBox.Text) end) if index > 1 then local DelFolderBtn = Instance.new("TextButton") DelFolderBtn.Size = UDim2.new(0, 20, 0, 20) DelFolderBtn.Position = UDim2.new(1, -24, 0.5, -10) DelFolderBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 50) DelFolderBtn.Text = "🗑" DelFolderBtn.TextSize = 8.5 DelFolderBtn.Parent = FolderFrame local DFC = Instance.new("UICorner") DFC.CornerRadius = UDim.new(0, 4) DFC.Parent = DelFolderBtn DelFolderBtn.MouseButton1Click:Connect(function() createModal("حذف المجلد", "هل أنت متأكد من حذف المجلد وجميع أغانيه؟", function() table.remove(foldersList, index) saveData() renderView(SearchBox.Text) end) end) end end elseif currentView == "folder_songs" and activeFolderIndex then local folder = foldersList[activeFolderIndex] local FolderHeader = Instance.new("Frame") FolderHeader.Size = UDim2.new(1, 0, 0, 24) FolderHeader.BackgroundTransparency = 1 FolderHeader.Parent = ScrollFrame local BackBtn = Instance.new("TextButton") BackBtn.Size = UDim2.new(0, 60, 0, 22) BackBtn.Position = UDim2.new(0, 0, 0, 0) BackBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 60) BackBtn.Text = "⬅ رجوع" BackBtn.TextColor3 = Color3.fromRGB(255, 255, 255) BackBtn.TextSize = 9 BackBtn.Font = Enum.Font.GothamBold BackBtn.Parent = FolderHeader local BC = Instance.new("UICorner") BC.CornerRadius = UDim.new(0, 4) BC.Parent = BackBtn local FTitleLbl = Instance.new("TextLabel") FTitleLbl.Size = UDim2.new(0.65, 0, 1, 0) FTitleLbl.Position = UDim2.new(0.35, 0, 0, 0) FTitleLbl.BackgroundTransparency = 1 FTitleLbl.Text = "📁 " .. folder.name FTitleLbl.TextColor3 = Color3.fromRGB(210, 180, 255) FTitleLbl.TextSize = 9.5 FTitleLbl.Font = Enum.Font.GothamBold FTitleLbl.TextXAlignment = Enum.TextXAlignment.Right FTitleLbl.Parent = FolderHeader BackBtn.MouseButton1Click:Connect(function() currentView = "folders" activeFolderIndex = nil renderView(SearchBox.Text) end) for index, item in ipairs(folder.songs) do local cleanId = item.code:match("%d+") or "" local ItemFrame = Instance.new("Frame") ItemFrame.Size = UDim2.new(1, 0, 0, 32) ItemFrame.BackgroundColor3 = Color3.fromRGB(22, 18, 32) ItemFrame.BackgroundTransparency = 0.4 ItemFrame.Parent = ScrollFrame local ICorner = Instance.new("UICorner") ICorner.CornerRadius = UDim.new(0, 4) ICorner.Parent = ItemFrame local ItemName = Instance.new("TextLabel") ItemName.Size = UDim2.new(0.5, 0, 0.45, 0) ItemName.Position = UDim2.new(0.03, 0, 0.08, 0) ItemName.BackgroundTransparency = 1 ItemName.Text = item.name ItemName.TextColor3 = Color3.fromRGB(255, 255, 255) ItemName.TextSize = 9 ItemName.Font = Enum.Font.GothamBold ItemName.TextXAlignment = Enum.TextXAlignment.Left ItemName.Parent = ItemFrame local ItemCode = Instance.new("TextLabel") ItemCode.Size = UDim2.new(0.5, 0, 0.45, 0) ItemCode.Position = UDim2.new(0.03, 0, 0.5, 0) ItemCode.BackgroundTransparency = 1 ItemCode.Text = "ID: " .. item.code ItemCode.TextColor3 = Color3.fromRGB(160, 150, 180) ItemCode.TextSize = 8 ItemCode.Font = Enum.Font.Gotham ItemCode.TextXAlignment = Enum.TextXAlignment.Left ItemCode.Parent = ItemFrame local CopyBtn = Instance.new("TextButton") CopyBtn.Size = UDim2.new(0, 20, 0, 20) CopyBtn.Position = UDim2.new(1, -66, 0.5, -10) CopyBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 60) CopyBtn.Text = "📋" CopyBtn.TextSize = 9 CopyBtn.Parent = ItemFrame local CCorner = Instance.new("UICorner") CCorner.CornerRadius = UDim.new(0, 3) CCorner.Parent = CopyBtn local PlayStopBtn = Instance.new("TextButton") PlayStopBtn.Size = UDim2.new(0, 20, 0, 20) PlayStopBtn.Position = UDim2.new(1, -44, 0.5, -10) -- مزامنة حالة الزر عند فتح المجلد if currentPlayingCode == cleanId then PlayStopBtn.Text = "⏹" PlayStopBtn.BackgroundColor3 = Color3.fromRGB(210, 140, 0) else PlayStopBtn.Text = "▶" PlayStopBtn.BackgroundColor3 = Color3.fromRGB(138, 43, 226) end PlayStopBtn.TextColor3 = Color3.fromRGB(255, 255, 255) PlayStopBtn.TextSize = 9 PlayStopBtn.Parent = ItemFrame activePlayButtons[cleanId] = {Button = PlayStopBtn, Code = cleanId} local PSCorner = Instance.new("UICorner") PSCorner.CornerRadius = UDim.new(0, 3) PSCorner.Parent = PlayStopBtn local DeleteBtn = Instance.new("TextButton") DeleteBtn.Size = UDim2.new(0, 20, 0, 20) DeleteBtn.Position = UDim2.new(1, -22, 0.5, -10) DeleteBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 50) DeleteBtn.Text = "🗑" DeleteBtn.TextSize = 9 DeleteBtn.Parent = ItemFrame local DCorner = Instance.new("UICorner") DCorner.CornerRadius = UDim.new(0, 3) DCorner.Parent = DeleteBtn CopyBtn.MouseButton1Click:Connect(function() if setclipboard then setclipboard(item.code) end end) PlayStopBtn.MouseButton1Click:Connect(function() playAudio(item.code, PlayStopBtn) end) DeleteBtn.MouseButton1Click:Connect(function() createModal("حذف الأغنية", "هل أنت متأكد من حذف هذه الأغنية؟", function() table.remove(folder.songs, index) saveData() renderView(SearchBox.Text) end) end) end end ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y + 10) end SearchBox:GetPropertyChangedSignal("Text"):Connect(function() renderView(SearchBox.Text) end) MinimizeBtn.MouseButton1Click:Connect(function() MainFrame.Visible = false FloatingBtn.Visible = true end) CloseBtn.MouseButton1Click:Connect(function() createModal("إغلاق السكربت", "هل أنت متأكد أنك تريد إغلاق السكربت؟", function() stopAudio() ScreenGui:Destroy() end) end) renderView()