-- CHARONXVGUI V.5 - GIVE ITEMS ADDED local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local Lighting = game:GetService("Lighting") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local oldGui = playerGui:FindFirstChild("CHARONXVGUI") if oldGui then oldGui:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "CHARON-GUI" screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = playerGui local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 300, 0, 340) frame.Position = UDim2.new(0.5, -150, 0.15, 0) frame.BackgroundColor3 = Color3.fromRGB(22, 22, 28) frame.Active = true frame.Parent = screenGui Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12) local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1, 0, 0, 32) titleBar.BackgroundColor3 = Color3.fromRGB(30, 30, 38) titleBar.Parent = frame Instance.new("UICorner", titleBar).CornerRadius = UDim.new(0, 12) local titleFix = Instance.new("Frame") titleFix.Size = UDim2.new(1, 0, 0, 12) titleFix.Position = UDim2.new(0, 0, 1, -12) titleFix.BackgroundColor3 = Color3.fromRGB(30, 30, 38) titleFix.Parent = titleBar local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -70, 1, 0) title.Position = UDim2.new(0, 10, 0, 0) title.BackgroundTransparency = 1 title.Text = "💀 CHARONXVGUI V12.4" title.TextColor3 = Color3.fromRGB(255, 50, 50) title.TextSize = 11 title.Font = Enum.Font.GothamBold title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = titleBar local minBtn = Instance.new("TextButton") minBtn.Size = UDim2.new(0, 26, 0, 26) minBtn.Position = UDim2.new(1, -56, 0.5, -13) minBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 60) minBtn.Text = "-" minBtn.TextColor3 = Color3.new(1, 1, 1) minBtn.TextSize = 14 minBtn.Font = Enum.Font.GothamBold minBtn.Parent = titleBar Instance.new("UICorner", minBtn).CornerRadius = UDim.new(0, 6) local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.new(0, 26, 0, 26) closeBtn.Position = UDim2.new(1, -28, 0.5, -13) closeBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 60) closeBtn.Text = "X" closeBtn.TextColor3 = Color3.new(1, 1, 1) closeBtn.TextSize = 12 closeBtn.Font = Enum.Font.GothamBold closeBtn.Parent = titleBar Instance.new("UICorner", closeBtn).CornerRadius = UDim.new(0, 6) local logo = Instance.new("TextButton") logo.Size = UDim2.new(0, 60, 0, 40) logo.Position = UDim2.new(0.5, -30, 0.2, 0) logo.BackgroundColor3 = Color3.fromRGB(22, 22, 28) logo.Text = "💀" logo.TextColor3 = Color3.fromRGB(255, 50, 50) logo.TextSize = 20 logo.Font = Enum.Font.GothamBold logo.Visible = false logo.Parent = screenGui Instance.new("UICorner", logo).CornerRadius = UDim.new(0, 12) -- TAB BAR -- 7 tabs now fit without overlapping. local tabBar = Instance.new("Frame") tabBar.Size = UDim2.new(1, -16, 0, 28) tabBar.Position = UDim2.new(0, 8, 0, 38) tabBar.BackgroundTransparency = 1 tabBar.Parent = frame local function createTabBtn(name, posX, sizeX) local b = Instance.new("TextButton") b.Size = UDim2.new(sizeX, -2, 1, 0) b.Position = UDim2.new(posX, 0, 0, 0) b.BackgroundColor3 = Color3.fromRGB(35, 35, 45) b.Text = name b.TextColor3 = Color3.new(1, 1, 1) b.TextSize = 6 b.Font = Enum.Font.GothamBold b.TextTruncate = Enum.TextTruncate.AtEnd b.Parent = tabBar Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6) return b end local tabMovesBtn = createTabBtn("MOVES", 0, 0.1428) local tabKillBtn = createTabBtn("AUTO TARGET", 0.1428, 0.1428) local tabBlastBtn = createTabBtn("AUTO ATK", 0.2856, 0.1428) local tabShopBtn = createTabBtn("SHOPS", 0.4284, 0.1428) local tabGiveBtn = createTabBtn("GIVE ITEMS", 0.5712, 0.1428) local tabTrainerBtn = createTabBtn("TRAINER", 0.7140, 0.1428) local tabSettingsBtn = createTabBtn("SETTINGS", 0.8568, 0.1432) -- CONTENT FRAMES local contentMoves = Instance.new("Frame") contentMoves.Size = UDim2.new(1, -16, 1, -76) contentMoves.Position = UDim2.new(0, 8, 0, 70) contentMoves.BackgroundTransparency = 1 contentMoves.Parent = frame local contentKill = Instance.new("Frame") contentKill.Size = UDim2.new(1, -16, 1, -76) contentKill.Position = UDim2.new(0, 8, 0, 70) contentKill.BackgroundTransparency = 1 contentKill.Visible = false contentKill.Parent = frame local contentBlast = Instance.new("Frame") contentBlast.Size = UDim2.new(1, -16, 1, -76) contentBlast.Position = UDim2.new(0, 8, 0, 70) contentBlast.BackgroundTransparency = 1 contentBlast.Visible = false contentBlast.Parent = frame local contentShops = Instance.new("Frame") contentShops.Size = UDim2.new(1, -16, 1, -76) contentShops.Position = UDim2.new(0, 8, 0, 70) contentShops.BackgroundTransparency = 1 contentShops.Visible = false contentShops.Parent = frame local contentGive = Instance.new("Frame") contentGive.Size = UDim2.new(1, -16, 1, -76) contentGive.Position = UDim2.new(0, 8, 0, 70) contentGive.BackgroundTransparency = 1 contentGive.Visible = false contentGive.Parent = frame local contentTrainer = Instance.new("Frame") contentTrainer.Size = UDim2.new(1, -16, 1, -76) contentTrainer.Position = UDim2.new(0, 8, 0, 70) contentTrainer.BackgroundTransparency = 1 contentTrainer.Visible = false contentTrainer.Parent = frame local contentSettings = Instance.new("Frame") contentSettings.Size = UDim2.new(1, -16, 1, -76) contentSettings.Position = UDim2.new(0, 8, 0, 70) contentSettings.BackgroundTransparency = 1 contentSettings.Visible = false contentSettings.Parent = frame local function switchTab(t) contentMoves.Visible = t == "moves" contentKill.Visible = t == "kill" contentBlast.Visible = t == "blast" contentShops.Visible = t == "shops" contentGive.Visible = t == "give" contentTrainer.Visible = t == "trainer" contentSettings.Visible = t == "settings" tabMovesBtn.BackgroundColor3 = t == "moves" and Color3.fromRGB(0, 120, 60) or Color3.fromRGB(35, 35, 45) tabKillBtn.BackgroundColor3 = t == "kill" and Color3.fromRGB(200, 45, 45) or Color3.fromRGB(35, 35, 45) tabBlastBtn.BackgroundColor3 = t == "blast" and Color3.fromRGB(255, 180, 0) or Color3.fromRGB(35, 35, 45) tabShopBtn.BackgroundColor3 = t == "shops" and Color3.fromRGB(0, 120, 200) or Color3.fromRGB(35, 35, 45) tabGiveBtn.BackgroundColor3 = t == "give" and Color3.fromRGB(180, 100, 30) or Color3.fromRGB(35, 35, 45) tabTrainerBtn.BackgroundColor3 = t == "trainer" and Color3.fromRGB(170, 90, 200) or Color3.fromRGB(35, 35, 45) tabSettingsBtn.BackgroundColor3 = t == "settings" and Color3.fromRGB(120, 80, 200) or Color3.fromRGB(35, 35, 45) end tabMovesBtn.MouseButton1Click:Connect(function() switchTab("moves") end) tabKillBtn.MouseButton1Click:Connect(function() switchTab("kill") end) tabBlastBtn.MouseButton1Click:Connect(function() switchTab("blast") end) tabShopBtn.MouseButton1Click:Connect(function() switchTab("shops") end) tabGiveBtn.MouseButton1Click:Connect(function() switchTab("give") end) tabTrainerBtn.MouseButton1Click:Connect(function() switchTab("trainer") end) tabSettingsBtn.MouseButton1Click:Connect(function() switchTab("settings") end) switchTab("moves") -- ============================================================ -- MOVES TAB — INFO MODE + BACK TO MOVES + BACK TO POKEMON -- INFO OFF: click a move to teach it. -- INFO ON: click a move to view information only. -- BACK TO MOVES: return from info to the move list. -- BACK TO POKEMON: return to the Pokémon selection list. -- ============================================================ local selectedLabel = Instance.new("TextLabel") selectedLabel.Size = UDim2.new(1, -100, 0, 18) selectedLabel.BackgroundColor3 = Color3.fromRGB(35, 35, 45) selectedLabel.Text = "Select a Pokémon" selectedLabel.TextColor3 = Color3.fromRGB(0, 255, 120) selectedLabel.TextSize = 8 selectedLabel.Font = Enum.Font.GothamBold selectedLabel.TextTruncate = Enum.TextTruncate.AtEnd selectedLabel.Parent = contentMoves Instance.new("UICorner", selectedLabel).CornerRadius = UDim.new(0, 6) -- INFO MODE BUTTON local infoMode = false local allMovesMode = false local allMovesBtn = Instance.new("TextButton") allMovesBtn.Name = "AllMovesButton" allMovesBtn.Size = UDim2.new(0, 54, 0, 18) allMovesBtn.Position = UDim2.new(1, -102, 0, 0) allMovesBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 80) allMovesBtn.Text = "ALL MOVES" allMovesBtn.TextColor3 = Color3.new(1, 1, 1) allMovesBtn.TextSize = 7 allMovesBtn.Font = Enum.Font.GothamBold allMovesBtn.Parent = contentMoves Instance.new("UICorner", allMovesBtn).CornerRadius = UDim.new(0, 5) local infoBtn = Instance.new("TextButton") infoBtn.Name = "MoveInfoButton" infoBtn.Size = UDim2.new(0, 42, 0, 18) infoBtn.Position = UDim2.new(1, -42, 0, 0) infoBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 80) infoBtn.Text = "INFO" infoBtn.TextColor3 = Color3.new(1, 1, 1) infoBtn.TextSize = 8 infoBtn.Font = Enum.Font.GothamBold infoBtn.Parent = contentMoves Instance.new("UICorner", infoBtn).CornerRadius = UDim.new(0, 5) -- SEARCH local moveSearch = Instance.new("TextBox") moveSearch.Size = UDim2.new(1, -30, 0, 20) moveSearch.Position = UDim2.new(0, 0, 0, 22) moveSearch.BackgroundColor3 = Color3.fromRGB(18, 18, 24) moveSearch.Text = "" moveSearch.PlaceholderText = "Search Pokémon..." moveSearch.TextColor3 = Color3.new(1, 1, 1) moveSearch.TextSize = 8 moveSearch.Font = Enum.Font.Gotham moveSearch.ClearTextOnFocus = false moveSearch.Parent = contentMoves Instance.new("UICorner", moveSearch).CornerRadius = UDim.new(0, 6) -- REFRESH BUTTON local refreshBtn = Instance.new("TextButton") refreshBtn.Size = UDim2.new(0, 24, 0, 18) refreshBtn.Position = UDim2.new(1, -24, 0, 23) refreshBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 80) refreshBtn.Text = "↻" refreshBtn.TextColor3 = Color3.new(1, 1, 1) refreshBtn.TextSize = 12 refreshBtn.Font = Enum.Font.GothamBold refreshBtn.Parent = contentMoves Instance.new("UICorner", refreshBtn).CornerRadius = UDim.new(0, 6) -- BACK TO POKEMON BUTTON local backPokemonBtn = Instance.new("TextButton") backPokemonBtn.Name = "BackToPokemonButton" backPokemonBtn.Size = UDim2.new(0, 92, 0, 18) backPokemonBtn.Position = UDim2.new(0, 0, 0, 48) backPokemonBtn.BackgroundColor3 = Color3.fromRGB(45, 65, 85) backPokemonBtn.Text = "← POKEMON" backPokemonBtn.TextColor3 = Color3.new(1, 1, 1) backPokemonBtn.TextSize = 8 backPokemonBtn.Font = Enum.Font.GothamBold backPokemonBtn.Visible = false backPokemonBtn.Parent = contentMoves Instance.new("UICorner", backPokemonBtn).CornerRadius = UDim.new(0, 5) -- CONTAINERS local movesContainer = Instance.new("Frame") movesContainer.Size = UDim2.new(1, 0, 1, -72) movesContainer.Position = UDim2.new(0, 0, 0, 72) movesContainer.BackgroundTransparency = 1 movesContainer.Visible = false movesContainer.Parent = contentMoves local modelsContainer = Instance.new("Frame") modelsContainer.Size = UDim2.new(1, 0, 1, -48) modelsContainer.Position = UDim2.new(0, 0, 0, 48) modelsContainer.BackgroundTransparency = 1 modelsContainer.Visible = true modelsContainer.Parent = contentMoves -- INFO PANEL local infoContainer = Instance.new("Frame") infoContainer.Name = "MoveInfoContainer" infoContainer.Size = UDim2.new(1, 0, 1, -72) infoContainer.Position = UDim2.new(0, 0, 0, 72) infoContainer.BackgroundColor3 = Color3.fromRGB(18, 18, 24) infoContainer.Visible = false infoContainer.Parent = contentMoves Instance.new("UICorner", infoContainer).CornerRadius = UDim.new(0, 6) -- BACK TO MOVES BUTTON INSIDE INFO PANEL local infoBackBtn = Instance.new("TextButton") infoBackBtn.Name = "InfoBackToMoves" infoBackBtn.Size = UDim2.new(0, 100, 0, 24) infoBackBtn.Position = UDim2.new(0, 5, 0, 4) infoBackBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 80) infoBackBtn.Text = "← BACK TO MOVES" infoBackBtn.TextColor3 = Color3.new(1, 1, 1) infoBackBtn.TextSize = 8 infoBackBtn.Font = Enum.Font.GothamBold infoBackBtn.Parent = infoContainer Instance.new("UICorner", infoBackBtn).CornerRadius = UDim.new(0, 5) local infoTitle = Instance.new("TextLabel") infoTitle.Size = UDim2.new(1, -115, 0, 26) infoTitle.Position = UDim2.new(0, 110, 0, 3) infoTitle.BackgroundTransparency = 1 infoTitle.Text = "MOVE INFORMATION" infoTitle.TextColor3 = Color3.fromRGB(0, 255, 120) infoTitle.TextSize = 10 infoTitle.Font = Enum.Font.GothamBold infoTitle.TextXAlignment = Enum.TextXAlignment.Left infoTitle.TextTruncate = Enum.TextTruncate.AtEnd infoTitle.Parent = infoContainer local infoScroll = Instance.new("ScrollingFrame") infoScroll.Size = UDim2.new(1, -10, 1, -38) infoScroll.Position = UDim2.new(0, 5, 0, 34) infoScroll.BackgroundColor3 = Color3.fromRGB(25, 25, 33) infoScroll.BorderSizePixel = 0 infoScroll.ScrollBarThickness = 3 infoScroll.CanvasSize = UDim2.new(0, 0, 0, 0) infoScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y infoScroll.Parent = infoContainer Instance.new("UICorner", infoScroll).CornerRadius = UDim.new(0, 5) local infoPadding = Instance.new("UIPadding") infoPadding.PaddingTop = UDim.new(0, 5) infoPadding.PaddingBottom = UDim.new(0, 5) infoPadding.PaddingLeft = UDim.new(0, 6) infoPadding.PaddingRight = UDim.new(0, 6) infoPadding.Parent = infoScroll local infoLayout = Instance.new("UIListLayout") infoLayout.Padding = UDim.new(0, 4) infoLayout.SortOrder = Enum.SortOrder.LayoutOrder infoLayout.Parent = infoScroll -- MOVE COLUMNS local function createMoveColumn(posX) local sc = Instance.new("ScrollingFrame") sc.Size = UDim2.new(0.32, 0, 1, 0) sc.Position = UDim2.new(posX, 0, 0, 0) sc.BackgroundColor3 = Color3.fromRGB(18, 18, 24) sc.ScrollBarThickness = 2 sc.CanvasSize = UDim2.new(0, 0, 0, 0) sc.Parent = movesContainer Instance.new("UICorner", sc).CornerRadius = UDim.new(0, 6) local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 2) layout.Parent = sc local padding = Instance.new("UIPadding") padding.PaddingTop = UDim.new(0, 3) padding.PaddingLeft = UDim.new(0, 2) padding.PaddingRight = UDim.new(0, 2) padding.Parent = sc layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() sc.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 10) end) return sc, layout end local moveScroll1, moveLayout1 = createMoveColumn(0) local moveScroll2, moveLayout2 = createMoveColumn(0.34) local moveScroll3, moveLayout3 = createMoveColumn(0.68) -- POKEMON LIST local modelScroll = Instance.new("ScrollingFrame") modelScroll.Size = UDim2.new(1, 0, 1, -28) modelScroll.Position = UDim2.new(0, 0, 0, 28) modelScroll.BackgroundColor3 = Color3.fromRGB(18, 18, 24) modelScroll.ScrollBarThickness = 3 modelScroll.CanvasSize = UDim2.new(0, 0, 0, 0) modelScroll.Parent = modelsContainer Instance.new("UICorner", modelScroll).CornerRadius = UDim.new(0, 6) local modelLayout = Instance.new("UIListLayout") modelLayout.Padding = UDim.new(0, 3) modelLayout.Parent = modelScroll local modelPadding = Instance.new("UIPadding") modelPadding.PaddingTop = UDim.new(0, 3) modelPadding.Parent = modelScroll modelLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() modelScroll.CanvasSize = UDim2.new(0, 0, 0, modelLayout.AbsoluteContentSize.Y + 10) end) local selectedModel = nil local selectedMove = nil local moveButtons = {} local modelButtons = {} local pinnedGuis = {} -- LOAD ReplicatedStorage.Moves local moveData = nil local function loadMoveData() local module = ReplicatedStorage:FindFirstChild("Moves") moveData = nil if module and module:IsA("ModuleScript") then local ok, result = pcall(require, module) if ok and type(result) == "table" then moveData = result end end return moveData end loadMoveData() local function updateInfoButton() if infoMode then infoBtn.BackgroundColor3 = Color3.fromRGB(0, 120, 65) infoBtn.Text = "INFO ON" infoBtn.Size = UDim2.new(0, 48, 0, 18) infoBtn.Position = UDim2.new(1, -48, 0, 0) else infoBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 80) infoBtn.Text = "INFO" infoBtn.Size = UDim2.new(0, 42, 0, 18) infoBtn.Position = UDim2.new(1, -42, 0, 0) end end local function isLearnGui(gui) if not gui then return false end local n = string.lower(gui.Name) return n:find("learn") or n:find("move") or n:find("replace") or n:find("forget") or n:find("tm") end local function pinGui(gui) if not gui or pinnedGuis[gui] then return end pinnedGuis[gui] = true gui.AncestryChanged:Connect(function() if not gui.Parent then pinnedGuis[gui] = nil end end) end playerGui.ChildAdded:Connect(function(child) task.wait(0.2) if child:IsA("ScreenGui") and isLearnGui(child) then pinGui(child) end end) local function getHeldItemName(model) if not model then return nil end -- A model can contain more than one Helditem-like ValueBase; -- display only the first one that actually contains an item name. for _, child in ipairs(model:GetChildren()) do if string.lower(child.Name) == "helditem" and child:IsA("ValueBase") then local value = child.Value if value ~= nil and tostring(value) ~= "" then return tostring(value) end end end return nil end local function getModelOwnerText(model) local owner = model and model:FindFirstChild("Owner") if owner and owner.Value then if owner.Value == player or owner.Value.Name == player.Name then return " [ME]" end return " [" .. owner.Value.Name .. "]" end return " [NO OWNER]" end local function getModelListText(model) local heldItem = getHeldItemName(model) return model.Name .. getModelOwnerText(model) .. " | Held: " .. (heldItem or "NONE") end local function hasOwner(model) if not model or not model:IsA("Model") then return false end if Players:GetPlayerFromCharacter(model) then return false end if not model:IsDescendantOf(workspace) then return false end local owner = model:FindFirstChild("Owner") return owner ~= nil and owner:IsA("ObjectValue") end local function getPokemonMovesFolder(model) if not model then return nil end local jokemonFolder = ReplicatedStorage:FindFirstChild("Jokemon") local pokemonData = jokemonFolder and jokemonFolder:FindFirstChild(model.Name) return pokemonData and pokemonData:FindFirstChild("Moves") end local function getPokemonMoveNames(model) local movesFolder = getPokemonMovesFolder(model) local names = {} local seen = {} if not movesFolder then return names end local function addMoves(folder) if not folder then return end for _, move in ipairs(folder:GetChildren()) do if move.Name ~= "TMs" and not seen[move.Name] then seen[move.Name] = true table.insert(names, move.Name) end end end addMoves(movesFolder) addMoves(movesFolder:FindFirstChild("TMs")) table.sort(names) return names end -- ALL MOVES uses the same move database as the INFO panel. -- The click action still goes through the original LearnMoveViaTM remote. local function getAllMoveNames() if not moveData then loadMoveData() end local names = {} if type(moveData) == "table" then for name, data in pairs(moveData) do if type(name) == "string" and type(data) == "table" then table.insert(names, name) end end end table.sort(names) return names end local function updateCanvas(sc, layout) if sc and layout then sc.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 10) end end local function clearMoveList() for _, sc in ipairs({moveScroll1, moveScroll2, moveScroll3}) do for _, child in ipairs(sc:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end end table.clear(moveButtons) end local function clearModelList() for _, child in ipairs(modelScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end table.clear(modelButtons) end local function clearInfoList() for _, child in ipairs(infoScroll:GetChildren()) do if child:IsA("TextLabel") then child:Destroy() end end end local showPokemonList local showMoveList local showMoveInfo local function returnToPokemonMenu() selectedModel = nil selectedMove = nil movesContainer.Visible = false modelsContainer.Visible = true infoContainer.Visible = false backPokemonBtn.Visible = false moveSearch.Text = "" moveSearch.PlaceholderText = "Search Pokémon..." selectedLabel.Text = infoMode and "INFO MODE | Select a Pokémon" or "Select a Pokémon" showPokemonList() end -- POKEMON LIST showPokemonList = function() selectedModel = nil movesContainer.Visible = false modelsContainer.Visible = true infoContainer.Visible = false backPokemonBtn.Visible = false moveSearch.PlaceholderText = "Search Pokémon..." selectedLabel.Text = infoMode and "INFO MODE | Select a Pokémon" or "Select a Pokémon" clearModelList() local found = {} local seen = {} for _, model in ipairs(workspace:GetDescendants()) do if model:IsA("Model") and not seen[model] and hasOwner(model) and getPokemonMovesFolder(model) then seen[model] = true table.insert(found, model) end end table.sort(found, function(a, b) return a.Name < b.Name end) local search = string.lower(moveSearch.Text or "") for _, model in ipairs(found) do if search == "" or string.find(string.lower(model.Name), search, 1, true) then local owner = model:FindFirstChild("Owner") local ownerName = "" if owner and owner.Value then if owner.Value == player then ownerName = " [ME]" else ownerName = " [" .. owner.Value.Name .. "]" end end local button = Instance.new("TextButton") button.Size = UDim2.new(1, -8, 0, 26) button.BackgroundColor3 = Color3.fromRGB(45, 35, 55) button.Text = getModelListText(model) button.TextColor3 = Color3.new(1, 1, 1) button.TextSize = 9 button.Font = Enum.Font.GothamBold button.TextTruncate = Enum.TextTruncate.AtEnd button.Parent = modelScroll Instance.new("UICorner", button).CornerRadius = UDim.new(0, 6) modelButtons[model] = button local function updateThisModelLabel() if button and button.Parent and model and model:IsDescendantOf(workspace) then button.Text = getModelListText(model) end end model.ChildAdded:Connect(function(child) if child.Name == "Owner" or string.lower(child.Name) == "helditem" then if child:IsA("ValueBase") then child.Changed:Connect(updateThisModelLabel) end task.defer(updateThisModelLabel) end end) for _, child in ipairs(model:GetChildren()) do if (child.Name == "Owner" or string.lower(child.Name) == "helditem") and child:IsA("ValueBase") then child.Changed:Connect(updateThisModelLabel) end end button.MouseButton1Click:Connect(function() if not model:IsDescendantOf(workspace) then return end selectedModel = model selectedMove = nil moveSearch.Text = "" showMoveList() end) end end updateCanvas(modelScroll, modelLayout) end local function refreshMovesModelLabels() for model, button in pairs(modelButtons) do if button and button.Parent then if model and model:IsDescendantOf(workspace) then button.Text = getModelListText(model) else button:Destroy() modelButtons[model] = nil end end end end -- INFO DISPLAY showMoveInfo = function() if not selectedMove then selectedLabel.Text = "INFO MODE | Tap a move" return end if not moveData then loadMoveData() end local data = moveData and moveData[selectedMove] movesContainer.Visible = false modelsContainer.Visible = false infoContainer.Visible = true backPokemonBtn.Visible = false infoTitle.Text = selectedMove clearInfoList() local order = 0 local function addInfoRow(labelText, valueText, highlight) order += 1 local row = Instance.new("TextLabel") row.Size = UDim2.new(1, -4, 0, 0) row.AutomaticSize = Enum.AutomaticSize.Y row.BackgroundColor3 = highlight and Color3.fromRGB(35, 65, 50) or Color3.fromRGB(35, 35, 45) row.Text = " " .. labelText .. ": " .. valueText row.TextColor3 = highlight and Color3.fromRGB(120, 255, 170) or Color3.fromRGB(235, 235, 240) row.TextSize = 10 row.Font = Enum.Font.Gotham row.TextWrapped = true row.TextXAlignment = Enum.TextXAlignment.Left row.TextYAlignment = Enum.TextYAlignment.Top row.LayoutOrder = order row.Parent = infoScroll Instance.new("UICorner", row).CornerRadius = UDim.new(0, 4) local pad = Instance.new("UIPadding") pad.PaddingTop = UDim.new(0, 5) pad.PaddingBottom = UDim.new(0, 5) pad.PaddingLeft = UDim.new(0, 4) pad.PaddingRight = UDim.new(0, 4) pad.Parent = row end addInfoRow("Move", selectedMove, true) addInfoRow("Pokémon", selectedModel and selectedModel.Name or "None", false) if not data or type(data) ~= "table" then addInfoRow( "Move data", "No matching entry found in ReplicatedStorage.Moves.", false ) selectedLabel.Text = "Viewing info: " .. selectedMove return end local preferredOrder = { "Category", "Type", "Power", "Accuracy", "Cooldown", "PP", "Priority", "Description", "Effect", "StatusEffect", "UserStatusEffect", "EnemyStatusEffect", "Target", "Heal", "LifeDrain", "CritMultiplier", "UserAttackStageIncrement", "UserDefenseStageIncrement", "UserSpecialAttackStageIncrement", "UserSpecialDefenseStageIncrement", "UserSpeedStageIncrement", "EnemyAttackStageIncrement", "EnemyDefenseStageIncrement", "EnemySpecialAttackStageIncrement", "EnemySpecialDefenseStageIncrement", "EnemySpeedStageIncrement", "Admin", "Superfast", } local shown = {} local function displayValue(value) if type(value) == "table" then local parts = {} for key, item in pairs(value) do table.insert(parts, tostring(key) .. "=" .. tostring(item)) end table.sort(parts) return "{" .. table.concat(parts, ", ") .. "}" end return tostring(value) end for _, key in ipairs(preferredOrder) do if data[key] ~= nil then shown[key] = true addInfoRow(key, displayValue(data[key]), false) end end local remaining = {} for key in pairs(data) do if not shown[key] then table.insert(remaining, key) end end table.sort(remaining, function(a, b) return tostring(a) < tostring(b) end) for _, key in ipairs(remaining) do addInfoRow(tostring(key), displayValue(data[key]), false) end if order <= 2 then addInfoRow("Properties", "No additional properties found.", false) end infoScroll.CanvasPosition = Vector2.new(0, 0) selectedLabel.Text = "Viewing info: " .. selectedMove end -- MOVE BUTTON local function addMoveButton(moveName, columnIndex) local targetScroll if columnIndex == 0 then targetScroll = moveScroll1 elseif columnIndex == 1 then targetScroll = moveScroll2 else targetScroll = moveScroll3 end local button = Instance.new("TextButton") button.Size = UDim2.new(1, -6, 0, 18) button.BackgroundColor3 = Color3.fromRGB(35, 35, 45) button.Text = moveName button.TextColor3 = Color3.new(1, 1, 1) button.TextSize = 7 button.Font = Enum.Font.Gotham button.TextTruncate = Enum.TextTruncate.AtEnd button.Parent = targetScroll Instance.new("UICorner", button).CornerRadius = UDim.new(0, 4) moveButtons[moveName] = button button.MouseButton1Click:Connect(function() if not selectedModel or not selectedModel:IsDescendantOf(workspace) then return end selectedMove = moveName for name, moveButton in pairs(moveButtons) do moveButton.BackgroundColor3 = name == moveName and Color3.fromRGB(0, 105, 65) or Color3.fromRGB(35, 35, 45) end -- INFO ON: show information only. if infoMode then showMoveInfo() return end -- INFO OFF: original TM teaching behavior. local remote = ReplicatedStorage:FindFirstChild("LearnMoveViaTM") if not remote or not remote:IsA("RemoteEvent") then selectedLabel.Text = "LearnMoveViaTM not found" return end selectedLabel.Text = "Teaching " .. moveName .. " to " .. selectedModel.Name remote:FireServer(selectedModel, moveName, "TM12 Cut") end) end -- MOVE LIST showMoveList = function() if not selectedModel then return end movesContainer.Visible = true modelsContainer.Visible = false infoContainer.Visible = false backPokemonBtn.Visible = true moveSearch.PlaceholderText = "Search move..." selectedLabel.Text = allMovesMode and ("ALL MOVES | " .. selectedModel.Name) or (infoMode and ("INFO MODE | " .. selectedModel.Name) or ("Moves: " .. selectedModel.Name)) clearMoveList() local moveNames if allMovesMode then moveNames = getAllMoveNames() else moveNames = getPokemonMoveNames(selectedModel) end local search = string.lower(moveSearch.Text or "") local filtered = {} for _, name in ipairs(moveNames) do if search == "" or string.find(string.lower(name), search, 1, true) then table.insert(filtered, name) end end local count = #filtered moveScroll1.Visible = true moveScroll2.Visible = count > 12 moveScroll3.Visible = count > 30 if count <= 12 then moveScroll1.Size = UDim2.new(1, 0, 1, 0) moveScroll1.Position = UDim2.new(0, 0, 0, 0) elseif count <= 30 then moveScroll1.Size = UDim2.new(0.49, 0, 1, 0) moveScroll1.Position = UDim2.new(0, 0, 0, 0) moveScroll2.Size = UDim2.new(0.49, 0, 1, 0) moveScroll2.Position = UDim2.new(0.51, 0, 0, 0) else moveScroll1.Size = UDim2.new(0.32, 0, 1, 0) moveScroll1.Position = UDim2.new(0, 0, 0, 0) moveScroll2.Size = UDim2.new(0.32, 0, 1, 0) moveScroll2.Position = UDim2.new(0.34, 0, 0, 0) moveScroll3.Size = UDim2.new(0.32, 0, 1, 0) moveScroll3.Position = UDim2.new(0.68, 0, 0, 0) end local columns = count <= 12 and 1 or count <= 30 and 2 or 3 for i, name in ipairs(filtered) do addMoveButton(name, (i - 1) % columns) end updateCanvas(moveScroll1, moveLayout1) updateCanvas(moveScroll2, moveLayout2) updateCanvas(moveScroll3, moveLayout3) end -- BACK TO POKEMON BUTTON backPokemonBtn.MouseButton1Click:Connect(function() returnToPokemonMenu() end) -- ALL MOVES BUTTON: switch list source without changing the teach action. allMovesBtn.MouseButton1Click:Connect(function() allMovesMode = not allMovesMode allMovesBtn.BackgroundColor3 = allMovesMode and Color3.fromRGB(0, 120, 65) or Color3.fromRGB(60, 60, 80) if allMovesMode then allMovesBtn.Text = "ALL ON" loadMoveData() else allMovesBtn.Text = "ALL MOVES" end if selectedModel and selectedModel:IsDescendantOf(workspace) then moveSearch.Text = "" showMoveList() end end) -- INFO BUTTON: TOGGLE INFO MODE infoBtn.MouseButton1Click:Connect(function() infoMode = not infoMode updateInfoButton() if infoMode then if selectedMove and selectedModel then showMoveInfo() elseif selectedModel then showMoveList() selectedLabel.Text = "INFO MODE | Tap a move" else showPokemonList() selectedLabel.Text = "INFO MODE | Select a Pokémon" end else infoContainer.Visible = false if selectedModel and selectedModel:IsDescendantOf(workspace) then showMoveList() selectedLabel.Text = "TEACH MODE | " .. selectedModel.Name else showPokemonList() end end end) -- BACK TO MOVES: KEEP INFO MODE ON infoBackBtn.MouseButton1Click:Connect(function() infoContainer.Visible = false if selectedModel and selectedModel:IsDescendantOf(workspace) then infoMode = true updateInfoButton() showMoveList() selectedLabel.Text = "INFO MODE | Tap a move" else selectedModel = nil showPokemonList() end end) -- REFRESH refreshBtn.MouseButton1Click:Connect(function() if infoContainer.Visible then loadMoveData() showMoveInfo() elseif selectedModel and movesContainer.Visible then showMoveList() else showPokemonList() end end) -- SEARCH moveSearch:GetPropertyChangedSignal("Text"):Connect(function() if infoContainer.Visible then return end if selectedModel and movesContainer.Visible then showMoveList() else showPokemonList() end end) -- AUTO REFRESH WHEN POKEMON APPEAR local function scheduleMovesModelRefresh(descendant) task.defer(function() -- Owner values are sometimes parented after the Pokémon model itself. -- Recheck on the next few scheduler steps instead of missing that model. for attempt = 1, 5 do if not selectedModel and not infoContainer.Visible then showPokemonList() else refreshMovesModelLabels() end if descendant:IsA("Model") then break end task.wait(0.08) end end) end workspace.DescendantAdded:Connect(function(descendant) if descendant:IsA("Model") or descendant.Name == "Owner" or string.lower(descendant.Name) == "helditem" then scheduleMovesModelRefresh(descendant) end end) workspace.DescendantRemoving:Connect(function(descendant) if descendant.Name == "Owner" or string.lower(descendant.Name) == "helditem" then task.defer(refreshMovesModelLabels) end end) -- RETURN TO POKEMON LIST IF SELECTED POKEMON DISAPPEARS workspace.DescendantRemoving:Connect(function(descendant) if descendant == selectedModel then task.defer(showPokemonList) end end) -- INITIALIZE updateInfoButton() showPokemonList() -- END MOVES TAB -- AUTO TARGET TAB local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer local battleRemote = ReplicatedStorage:WaitForChild("Battle") local autoTargetEnabled = false local skipShinyEnabled = true local skipCapturedEnabled = true -- AUTO TARGET TOGGLE local killToggle = Instance.new("TextButton") killToggle.Size = UDim2.new(0.9, 0, 0, 40) killToggle.Position = UDim2.new(0.05, 0, 0, 15) killToggle.BackgroundColor3 = Color3.fromRGB(40, 40, 50) killToggle.TextColor3 = Color3.fromRGB(255, 255, 255) killToggle.Text = "AUTO TARGET: OFF" killToggle.TextSize = 12 killToggle.Font = Enum.Font.GothamBold killToggle.Parent = contentKill local killCorner = Instance.new("UICorner") killCorner.CornerRadius = UDim.new(0, 8) killCorner.Parent = killToggle -- SKIP SHINY TOGGLE local shinyToggle = Instance.new("TextButton") shinyToggle.Size = UDim2.new(0.9, 0, 0, 35) shinyToggle.Position = UDim2.new(0.05, 0, 0, 65) shinyToggle.BackgroundColor3 = Color3.fromRGB(0, 100, 55) shinyToggle.TextColor3 = Color3.fromRGB(255, 255, 255) shinyToggle.Text = "SKIP SHINY: ON" shinyToggle.TextSize = 11 shinyToggle.Font = Enum.Font.GothamBold shinyToggle.Parent = contentKill local shinyCorner = Instance.new("UICorner") shinyCorner.CornerRadius = UDim.new(0, 8) shinyCorner.Parent = shinyToggle -- SKIP CAPTURED TOGGLE local captureToggle = Instance.new("TextButton") captureToggle.Size = UDim2.new(0.9, 0, 0, 35) captureToggle.Position = UDim2.new(0.05, 0, 0, 110) captureToggle.BackgroundColor3 = Color3.fromRGB(0, 100, 55) captureToggle.TextColor3 = Color3.fromRGB(255, 255, 255) captureToggle.Text = "SKIP CAPTURED: ON" captureToggle.TextSize = 11 captureToggle.Font = Enum.Font.GothamBold captureToggle.Parent = contentKill local captureCorner = Instance.new("UICorner") captureCorner.CornerRadius = UDim.new(0, 8) captureCorner.Parent = captureToggle -- CHECK WHETHER A POKEMON IS SHINY -- Uses the same marker-presence check as your shiny teleport script. local function isShiny(model) if not model then return false end return model:FindFirstChild("Shiny", true) ~= nil end -- ORIGINAL CAPTURED CHECK (UNCHANGED) local function isCaptured(model) local catchable = model:FindFirstChild("Catchable") return catchable ~= nil and catchable:IsA("ObjectValue") and catchable.Value ~= nil end -- TOGGLE BUTTONS killToggle.MouseButton1Click:Connect(function() autoTargetEnabled = not autoTargetEnabled killToggle.Text = autoTargetEnabled and "AUTO TARGET: ON" or "AUTO TARGET: OFF" killToggle.BackgroundColor3 = autoTargetEnabled and Color3.fromRGB(170, 35, 35) or Color3.fromRGB(40, 40, 50) end) shinyToggle.MouseButton1Click:Connect(function() skipShinyEnabled = not skipShinyEnabled shinyToggle.Text = skipShinyEnabled and "SKIP SHINY: ON" or "SKIP SHINY: OFF" shinyToggle.BackgroundColor3 = skipShinyEnabled and Color3.fromRGB(0, 100, 55) or Color3.fromRGB(100, 35, 35) end) captureToggle.MouseButton1Click:Connect(function() skipCapturedEnabled = not skipCapturedEnabled captureToggle.Text = skipCapturedEnabled and "SKIP CAPTURED: ON" or "SKIP CAPTURED: OFF" captureToggle.BackgroundColor3 = skipCapturedEnabled and Color3.fromRGB(0, 100, 55) or Color3.fromRGB(100, 35, 35) end) -- AUTO TARGET LOOP task.spawn(function() while true do task.wait(0.2) if not autoTargetEnabled then continue end local wildFolder = workspace:FindFirstChild("Wild") if not wildFolder then continue end for _, model in ipairs(wildFolder:GetChildren()) do if not autoTargetEnabled then break end if not model:IsA("Model") then continue end -- NEVER TARGET A SHINY WHEN SKIP SHINY IS ON if skipShinyEnabled and isShiny(model) then continue end -- KEEP THE ORIGINAL CAPTURED-POKEMON CHECK if skipCapturedEnabled and isCaptured(model) then continue end -- CONFIRM THE MODEL IS STILL IN THE WILD FOLDER if model.Parent ~= wildFolder then continue end -- RECHECK BEFORE TARGETING if skipShinyEnabled and isShiny(model) then continue end if skipCapturedEnabled and isCaptured(model) then continue end pcall(function() battleRemote:FireServer(model) end) task.wait(0.1) end end end) -- AUTO ATTACK TAB local blastToggle = Instance.new("TextButton") blastToggle.Size = UDim2.new(0.9, 0, 0, 40) blastToggle.Position = UDim2.new(0.05, 0, 0, 15) blastToggle.BackgroundColor3 = Color3.fromRGB(40, 40, 50) blastToggle.Text = "AUTO ATTACK: OFF" blastToggle.TextColor3 = Color3.fromRGB(255, 80, 80) blastToggle.TextSize = 11 blastToggle.Font = Enum.Font.GothamBold blastToggle.Parent = contentBlast Instance.new("UICorner", blastToggle).CornerRadius = UDim.new(0, 8) local blastRunning2 = false blastToggle.MouseButton1Click:Connect(function() blastRunning2 = not blastRunning2 if blastRunning2 then blastToggle.Text = "AUTO ATTACK: ON (4x)" blastToggle.TextColor3 = Color3.fromRGB(80, 255, 120) blastToggle.BackgroundColor3 = Color3.fromRGB(30, 60, 40) task.spawn(function() while blastRunning2 do local attackRemote = ReplicatedStorage:FindFirstChild("Attack") if attackRemote and attackRemote:IsA("RemoteEvent") then for i = 1, 4 do if not blastRunning2 then break end pcall(function() attackRemote:FireServer(i) end) task.wait(0.02) end end task.wait(0.05) end end) else blastToggle.Text = "AUTO ATTACK: OFF" blastToggle.TextColor3 = Color3.fromRGB(255, 80, 80) blastToggle.BackgroundColor3 = Color3.fromRGB(40, 40, 50) end end) -- SHOPS TAB local shopSearch = Instance.new("TextBox") shopSearch.Size = UDim2.new(1, -60, 0, 24) shopSearch.Position = UDim2.new(0, 0, 0, 0) shopSearch.BackgroundColor3 = Color3.fromRGB(18, 18, 24) shopSearch.Text = "" shopSearch.PlaceholderText = "Search shop..." shopSearch.TextColor3 = Color3.new(1, 1, 1) shopSearch.TextSize = 9 shopSearch.Font = Enum.Font.Gotham shopSearch.Parent = contentShops Instance.new("UICorner", shopSearch).CornerRadius = UDim.new(0, 6) local shopRefresh = Instance.new("TextButton") shopRefresh.Size = UDim2.new(0, 50, 0, 24) shopRefresh.Position = UDim2.new(1, -50, 0, 0) shopRefresh.BackgroundColor3 = Color3.fromRGB(0, 120, 200) shopRefresh.Text = "REFRESH" shopRefresh.TextColor3 = Color3.new(1, 1, 1) shopRefresh.TextSize = 8 shopRefresh.Font = Enum.Font.GothamBold shopRefresh.Parent = contentShops Instance.new("UICorner", shopRefresh).CornerRadius = UDim.new(0, 6) local shopScroll = Instance.new("ScrollingFrame") shopScroll.Size = UDim2.new(1, 0, 1, -30) shopScroll.Position = UDim2.new(0, 0, 0, 30) shopScroll.BackgroundColor3 = Color3.fromRGB(18, 18, 24) shopScroll.ScrollBarThickness = 4 shopScroll.CanvasSize = UDim2.new(0, 0, 0, 0) shopScroll.Parent = contentShops Instance.new("UICorner", shopScroll).CornerRadius = UDim.new(0, 8) local shopLayout = Instance.new("UIListLayout") shopLayout.Padding = UDim.new(0, 3) shopLayout.Parent = shopScroll local shopPadding = Instance.new("UIPadding") shopPadding.PaddingTop = UDim.new(0, 3) shopPadding.Parent = shopScroll local function openShopGui(guiObj) if not guiObj then return end pcall(function() local cur = guiObj while cur and cur ~= playerGui do if cur:IsA("ScreenGui") then cur.Enabled = true elseif cur:IsA("Frame") or cur:IsA("ScrollingFrame") then cur.Visible = true end cur = cur.Parent end if guiObj:IsA("Frame") or guiObj:IsA("ScrollingFrame") then guiObj.Visible = true end if guiObj.Parent and guiObj.Parent:IsA("Frame") then guiObj.Parent.Visible = true end end) end local shopButtons = {} local function clearShops() for _, b in pairs(shopButtons) do if b and b.Parent then b:Destroy() end end table.clear(shopButtons) end local function addShopButton(name, obj) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1, -8, 0, 26) btn.BackgroundColor3 = Color3.fromRGB(35, 45, 65) btn.Text = "🛒 " .. name btn.TextColor3 = Color3.new(1, 1, 1) btn.TextSize = 9 btn.Font = Enum.Font.GothamBold btn.TextXAlignment = Enum.TextXAlignment.Left btn.Parent = shopScroll Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6) local padding = Instance.new("UIPadding") padding.PaddingLeft = UDim.new(0, 8) padding.Parent = btn table.insert(shopButtons, btn) btn.MouseButton1Click:Connect(function() openShopGui(obj) end) end local function scanShops(filter) clearShops() filter = filter and string.lower(filter) or "" local added = {} local tmShops = playerGui:FindFirstChild("TMShops") if tmShops then for _, shop in ipairs(tmShops:GetChildren()) do if filter == "" or string.sub(string.lower(shop.Name), 1, #filter) == filter then addShopButton("TM: " .. shop.Name, shop) added[shop.Name] = true end end end local itemShops = playerGui:FindFirstChild("ItemShops") if itemShops then for _, shop in ipairs(itemShops:GetChildren()) do if filter == "" or string.sub(string.lower(shop.Name), 1, #filter) == filter then addShopButton("ITEM: " .. shop.Name, shop) added[shop.Name] = true end end end for _, directName in ipairs({ "Shop", "SafariShop", "PrideShop" }) do local g = playerGui:FindFirstChild(directName) if g and not added[g.Name] then if filter == "" or string.sub(string.lower(g.Name), 1, #filter) == filter then addShopButton(g.Name .. " [PlayerGui]", g) added[g.Name] = true end end end for _, gui in ipairs(playerGui:GetChildren()) do if gui:IsA("ScreenGui") and string.find(string.lower(gui.Name), "shop") and not added[gui.Name] then if filter == "" or string.sub(string.lower(gui.Name), 1, #filter) == filter then addShopButton(gui.Name .. " [ScreenGui]", gui) added[gui.Name] = true end end end task.defer(function() shopScroll.CanvasSize = UDim2.new(0, 0, 0, shopLayout.AbsoluteContentSize.Y + 10) end) end shopRefresh.MouseButton1Click:Connect(function() scanShops(shopSearch.Text) end) shopSearch:GetPropertyChangedSignal("Text"):Connect(function() scanShops(shopSearch.Text) end) scanShops("") -- ============================================================ -- GIVE ITEMS TAB -- ============================================================ local giveSelectedItem = nil local giveSelectedModel = nil local giveAllMode = false local giveItemButtons = {} local giveModelButtons = {} local giveItems = {} local giveRemote = ReplicatedStorage:FindFirstChild("SwapItems") -- ============================================================ -- HEADER -- ============================================================ local giveHeader = Instance.new("TextLabel") giveHeader.Size = UDim2.new(1, 0, 0, 20) giveHeader.Position = UDim2.new(0, 0, 0, 0) giveHeader.BackgroundColor3 = Color3.fromRGB(45, 30, 20) giveHeader.Text = "GIVE ITEMS" giveHeader.TextColor3 = Color3.fromRGB(255, 170, 70) giveHeader.TextSize = 10 giveHeader.Font = Enum.Font.GothamBold giveHeader.Parent = contentGive Instance.new("UICorner", giveHeader).CornerRadius = UDim.new(0, 6) local giveStatus = Instance.new("TextLabel") giveStatus.Size = UDim2.new(1, 0, 0, 18) giveStatus.Position = UDim2.new(0, 0, 0, 22) giveStatus.BackgroundColor3 = Color3.fromRGB(35, 35, 45) giveStatus.Text = "Selected Item: NONE" giveStatus.TextColor3 = Color3.fromRGB(255, 190, 90) giveStatus.TextSize = 7 giveStatus.Font = Enum.Font.GothamBold giveStatus.TextTruncate = Enum.TextTruncate.AtEnd giveStatus.Parent = contentGive Instance.new("UICorner", giveStatus).CornerRadius = UDim.new(0, 6) -- ============================================================ -- SEARCH -- ============================================================ local giveSearch = Instance.new("TextBox") giveSearch.Size = UDim2.new(1, -54, 0, 22) giveSearch.Position = UDim2.new(0, 0, 0, 44) giveSearch.BackgroundColor3 = Color3.fromRGB(18, 18, 24) giveSearch.Text = "" giveSearch.PlaceholderText = "Search item..." giveSearch.TextColor3 = Color3.new(1, 1, 1) giveSearch.TextSize = 8 giveSearch.Font = Enum.Font.Gotham giveSearch.ClearTextOnFocus = false giveSearch.Parent = contentGive Instance.new("UICorner", giveSearch).CornerRadius = UDim.new(0, 6) local giveRefresh = Instance.new("TextButton") giveRefresh.Size = UDim2.new(0, 50, 0, 22) giveRefresh.Position = UDim2.new(1, -50, 0, 44) giveRefresh.BackgroundColor3 = Color3.fromRGB(180, 100, 30) giveRefresh.Text = "SCAN" giveRefresh.TextColor3 = Color3.new(1, 1, 1) giveRefresh.TextSize = 8 giveRefresh.Font = Enum.Font.GothamBold giveRefresh.Parent = contentGive Instance.new("UICorner", giveRefresh).CornerRadius = UDim.new(0, 6) -- ============================================================ -- ITEM LIST -- ============================================================ local giveItemsContainer = Instance.new("Frame") giveItemsContainer.Size = UDim2.new(1, 0, 1, -70) giveItemsContainer.Position = UDim2.new(0, 0, 0, 70) giveItemsContainer.BackgroundTransparency = 1 giveItemsContainer.Visible = false giveItemsContainer.Parent = contentGive local giveChoosePokemon = Instance.new("TextButton") giveChoosePokemon.Size = UDim2.new(1, 0, 0, 24) giveChoosePokemon.Position = UDim2.new(0, 0, 0, 0) giveChoosePokemon.BackgroundColor3 = Color3.fromRGB(60, 60, 80) giveChoosePokemon.Text = "← SELECT POKEMON" giveChoosePokemon.TextColor3 = Color3.new(1, 1, 1) giveChoosePokemon.TextSize = 8 giveChoosePokemon.Font = Enum.Font.GothamBold giveChoosePokemon.Parent = giveItemsContainer Instance.new("UICorner", giveChoosePokemon).CornerRadius = UDim.new(0, 6) local giveItemScroll = Instance.new("ScrollingFrame") giveItemScroll.Size = UDim2.new(1, 0, 1, -29) giveItemScroll.Position = UDim2.new(0, 0, 0, 29) giveItemScroll.BackgroundColor3 = Color3.fromRGB(18, 18, 24) giveItemScroll.ScrollBarThickness = 3 giveItemScroll.CanvasSize = UDim2.new(0, 0, 0, 0) giveItemScroll.AutomaticCanvasSize = Enum.AutomaticSize.None giveItemScroll.Parent = giveItemsContainer Instance.new("UICorner", giveItemScroll).CornerRadius = UDim.new(0, 6) local giveItemLayout = Instance.new("UIListLayout") giveItemLayout.Padding = UDim.new(0, 3) giveItemLayout.Parent = giveItemScroll local giveItemPadding = Instance.new("UIPadding") giveItemPadding.PaddingTop = UDim.new(0, 3) giveItemPadding.Parent = giveItemScroll -- ============================================================ -- MODEL LIST -- ============================================================ local giveModelsContainer = Instance.new("Frame") giveModelsContainer.Size = UDim2.new(1, 0, 1, -70) giveModelsContainer.Position = UDim2.new(0, 0, 0, 70) giveModelsContainer.BackgroundTransparency = 1 giveModelsContainer.Visible = false giveModelsContainer.Parent = contentGive local giveTopBar = Instance.new("Frame") giveTopBar.Size = UDim2.new(1, 0, 0, 25) giveTopBar.BackgroundTransparency = 1 giveTopBar.Parent = giveModelsContainer local giveBack = Instance.new("TextButton") giveBack.Size = UDim2.new(0.30, 0, 1, 0) giveBack.BackgroundColor3 = Color3.fromRGB(60, 60, 80) giveBack.Text = "← ITEMS" giveBack.TextColor3 = Color3.new(1, 1, 1) giveBack.TextSize = 8 giveBack.Font = Enum.Font.GothamBold giveBack.Parent = giveTopBar Instance.new("UICorner", giveBack).CornerRadius = UDim.new(0, 6) local giveRefreshModels = Instance.new("TextButton") giveRefreshModels.Size = UDim2.new(0.66, 0, 1, 0) giveRefreshModels.Position = UDim2.new(0.34, 0, 0, 0) giveRefreshModels.BackgroundColor3 = Color3.fromRGB(180, 100, 30) giveRefreshModels.Text = "REFRESH MODELS" giveRefreshModels.TextColor3 = Color3.new(1, 1, 1) giveRefreshModels.TextSize = 8 giveRefreshModels.Font = Enum.Font.GothamBold giveRefreshModels.Parent = giveTopBar Instance.new("UICorner", giveRefreshModels).CornerRadius = UDim.new(0, 6) local giveSelectAllModels = Instance.new("TextButton") giveSelectAllModels.Size = UDim2.new(1, 0, 0, 24) giveSelectAllModels.Position = UDim2.new(0, 0, 0, 30) giveSelectAllModels.BackgroundColor3 = Color3.fromRGB(70, 130, 70) giveSelectAllModels.Text = "GIVE ITEMS TO ALL" giveSelectAllModels.TextColor3 = Color3.new(1, 1, 1) giveSelectAllModels.TextSize = 8 giveSelectAllModels.Font = Enum.Font.GothamBold giveSelectAllModels.Parent = giveModelsContainer Instance.new("UICorner", giveSelectAllModels).CornerRadius = UDim.new(0, 6) local giveModelScroll = Instance.new("ScrollingFrame") giveModelScroll.Size = UDim2.new(1, 0, 1, -57) giveModelScroll.Position = UDim2.new(0, 0, 0, 57) giveModelScroll.BackgroundColor3 = Color3.fromRGB(18, 18, 24) giveModelScroll.ScrollBarThickness = 3 giveModelScroll.CanvasSize = UDim2.new(0, 0, 0, 0) giveModelScroll.Parent = giveModelsContainer Instance.new("UICorner", giveModelScroll).CornerRadius = UDim.new(0, 6) local giveModelLayout = Instance.new("UIListLayout") giveModelLayout.Padding = UDim.new(0, 3) giveModelLayout.Parent = giveModelScroll local giveModelPadding = Instance.new("UIPadding") giveModelPadding.PaddingTop = UDim.new(0, 3) giveModelPadding.Parent = giveModelScroll -- ============================================================ -- CANVAS UPDATES -- ============================================================ local function updateGiveItemCanvas() giveItemScroll.CanvasSize = UDim2.new( 0, 0, 0, giveItemLayout.AbsoluteContentSize.Y + 10 ) end local function updateGiveModelCanvas() giveModelScroll.CanvasSize = UDim2.new( 0, 0, 0, giveModelLayout.AbsoluteContentSize.Y + 10 ) end giveItemLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect( updateGiveItemCanvas ) giveModelLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect( updateGiveModelCanvas ) -- ============================================================ -- CLEAR LISTS -- ============================================================ local function clearGiveItems() for _, button in pairs(giveItemButtons) do if button and button.Parent then button:Destroy() end end table.clear(giveItemButtons) end local function clearGiveModels() for _, button in pairs(giveModelButtons) do if button and button.Parent then button:Destroy() end end table.clear(giveModelButtons) end -- ============================================================ -- SHOW / HIDE LISTS -- ============================================================ local function showGiveItemList() giveItemsContainer.Visible = true giveModelsContainer.Visible = false local pokemonName = giveAllMode and "ALL ELIGIBLE POKEMON" or (giveSelectedModel and giveSelectedModel.Name or "NONE") giveStatus.Text = "POKEMON: " .. pokemonName .. " | Choose an item" updateGiveItemCanvas() end local function showGiveModels() giveItemsContainer.Visible = false giveModelsContainer.Visible = true giveStatus.Text = "Select a Pokemon first" updateGiveModelCanvas() end -- ============================================================ -- ITEM NAME CLEANUP -- Removes trailing bracketed labels: -- Rayquazite [6] -> Rayquazite -- Rayquazite [Mega Stone] -> Rayquazite -- ============================================================ local function cleanGiveItemName(itemName) if itemName == nil then return nil end itemName = tostring(itemName) itemName = itemName:gsub("^%s+", ""):gsub("%s+$", "") -- Remove one or more trailing bracketed labels. while true do local cleaned, count = itemName:gsub("%s*%b[]%s*$", "") if count == 0 then break end itemName = cleaned end itemName = itemName:gsub("^%s+", ""):gsub("%s+$", "") if itemName == "" then return nil end return itemName end -- ============================================================ -- REMOTE VALIDATION -- ============================================================ local function getGiveRemote() local remote = ReplicatedStorage:FindFirstChild("SwapItems") if not remote or not remote:IsA("RemoteEvent") then giveStatus.Text = "SwapItems RemoteEvent not found" return nil end return remote end -- ============================================================ -- MODEL OWNER LABEL -- ============================================================ local function getGiveHeldItemName(obj) return getHeldItemName(obj) end local function getGiveOwnerLabel(obj) local owner = obj:FindFirstChild("Owner") local ownerText = "" if owner and owner.Value then if owner.Value == player or owner.Value.Name == player.Name then ownerText = " [ME]" else ownerText = " [" .. owner.Value.Name .. "]" end end local heldItem = getGiveHeldItemName(obj) if heldItem then return ownerText .. " | " .. heldItem end return ownerText .. " | Held: NONE" end -- ============================================================ -- CREATE MODEL BUTTON -- ============================================================ local function addGiveModelButton(obj) if not obj or not obj.Parent then return end if not obj:IsA("Model") or not hasOwner(obj) then return end if giveModelButtons[obj] then return end local modelButton = Instance.new("TextButton") modelButton.Size = UDim2.new(1, -8, 0, 27) modelButton.BackgroundColor3 = Color3.fromRGB(45, 35, 55) modelButton.Text = obj.Name .. getGiveOwnerLabel(obj) modelButton.TextColor3 = Color3.new(1, 1, 1) modelButton.TextSize = 8 modelButton.Font = Enum.Font.GothamBold modelButton.TextXAlignment = Enum.TextXAlignment.Left modelButton.TextTruncate = Enum.TextTruncate.AtEnd modelButton.Parent = giveModelScroll Instance.new("UICorner", modelButton).CornerRadius = UDim.new(0, 6) local padding = Instance.new("UIPadding") padding.PaddingLeft = UDim.new(0, 8) padding.Parent = modelButton giveModelButtons[obj] = modelButton local function updateThisGiveModelLabel() if modelButton and modelButton.Parent and obj:IsDescendantOf(workspace) then modelButton.Text = obj.Name .. getGiveOwnerLabel(obj) end end obj.ChildAdded:Connect(function(child) if child.Name == "Owner" or string.lower(child.Name) == "helditem" then if child:IsA("ValueBase") then child.Changed:Connect(updateThisGiveModelLabel) end task.defer(updateThisGiveModelLabel) end end) for _, child in ipairs(obj:GetChildren()) do if (child.Name == "Owner" or string.lower(child.Name) == "helditem") and child:IsA("ValueBase") then child.Changed:Connect(updateThisGiveModelLabel) end end modelButton.MouseButton1Click:Connect(function() if not obj.Parent then if modelButton.Parent then modelButton:Destroy() end giveModelButtons[obj] = nil updateGiveModelCanvas() return end giveAllMode = false giveSelectedModel = obj giveSelectedItem = nil giveSelectAllModels.Text = "GIVE ITEMS TO ALL" giveStatus.Text = "Selected Pokemon: " .. obj.Name showGiveItemList() end) updateGiveModelCanvas() end -- ============================================================ -- SCAN MODELS -- ============================================================ local function scanGiveModels() -- Reconcile instead of blindly trusting DescendantAdded: some Pokémon -- receive their Owner ObjectValue a moment after their model is parented. local found = {} for _, obj in ipairs(workspace:GetDescendants()) do if obj:IsA("Model") and hasOwner(obj) then found[obj] = true addGiveModelButton(obj) end end for obj, button in pairs(giveModelButtons) do if not found[obj] or not obj:IsDescendantOf(workspace) then if button and button.Parent then button:Destroy() end giveModelButtons[obj] = nil end end updateGiveModelCanvas() end -- ============================================================ -- GIVE ITEMS TO ALL MODELS -- Selects every currently eligible Pokémon as the recipient group. -- The chosen item is then sent using the same SwapItems call as single give. -- ============================================================ giveSelectAllModels.MouseButton1Click:Connect(function() scanGiveModels() local count = 0 for model in pairs(giveModelButtons) do if model and model:IsDescendantOf(workspace) and hasOwner(model) then count += 1 end end if count == 0 then giveStatus.Text = "No eligible Pokémon found" return end giveAllMode = true giveSelectedModel = nil giveSelectedItem = nil giveStatus.Text = "ALL POKEMON SELECTED: " .. count .. " | Choose an item" showGiveItemList() end) -- ============================================================ -- GET ITEM NAME FROM GUI OBJECT -- ============================================================ local function getItemNameFromObject(obj) if not obj then return nil end if obj:IsA("TextButton") or obj:IsA("TextLabel") or obj:IsA("TextBox") then local text = obj.Text if text and text ~= "" then return cleanGiveItemName(text) end end local itemName = obj:GetAttribute("ItemName") if itemName then return cleanGiveItemName(itemName) end local itemAttribute = obj:GetAttribute("Item") if itemAttribute then return cleanGiveItemName(itemAttribute) end return cleanGiveItemName(obj.Name) end -- ============================================================ -- CREATE ITEM BUTTON -- ============================================================ local function addGiveItemButton(itemName, shopName) itemName = cleanGiveItemName(itemName) if not itemName then return end -- Use the cleaned name as the unique key. local key = string.lower(itemName) if giveItemButtons[key] then return end local button = Instance.new("TextButton") button.Size = UDim2.new(1, -8, 0, 25) button.BackgroundColor3 = string.lower(itemName) == string.lower(giveSelectedItem or "") and Color3.fromRGB(150, 80, 25) or Color3.fromRGB(40, 40, 50) -- Display ONLY the item name. -- No [6], [Mega Stone], [Items], or shop label. button.Text = itemName button.TextColor3 = Color3.new(1, 1, 1) button.TextSize = 8 button.Font = Enum.Font.GothamBold button.TextXAlignment = Enum.TextXAlignment.Left button.TextTruncate = Enum.TextTruncate.AtEnd button.Parent = giveItemScroll Instance.new("UICorner", button).CornerRadius = UDim.new(0, 5) local padding = Instance.new("UIPadding") padding.PaddingLeft = UDim.new(0, 8) padding.Parent = button giveItemButtons[key] = button button.MouseButton1Click:Connect(function() if not giveAllMode and (not giveSelectedModel or not giveSelectedModel:IsDescendantOf(workspace)) then giveStatus.Text = "Select a Pokemon first" showGiveModels() return end giveSelectedItem = itemName for _, b in pairs(giveItemButtons) do if b and b.Parent then b.BackgroundColor3 = Color3.fromRGB(40, 40, 50) end end button.BackgroundColor3 = Color3.fromRGB(150, 80, 25) local remote = getGiveRemote() if not remote then return end if giveAllMode then local recipients = {} for model in pairs(giveModelButtons) do if model and model:IsDescendantOf(workspace) and hasOwner(model) then table.insert(recipients, model) end end table.sort(recipients, function(a, b) return a.Name < b.Name end) local sent, failed = 0, 0 for index, recipient in ipairs(recipients) do if recipient:IsDescendantOf(workspace) then local ok = pcall(function() remote:FireServer(recipient, itemName) end) if ok then sent += 1 else failed += 1 end end if index % 8 == 0 then giveStatus.Text = "Giving " .. itemName .. "... " .. index .. "/" .. #recipients task.wait(0.03) end end giveStatus.Text = "Gave " .. itemName .. " to " .. sent .. " Pokémon" .. (failed > 0 and (" | Failed: " .. failed) or "") giveAllMode = false giveSelectedModel = nil showGiveModels() else local selectedPokemon = giveSelectedModel local success = pcall(function() remote:FireServer(selectedPokemon, itemName) end) if success then giveStatus.Text = "Sent: " .. itemName .. " → " .. selectedPokemon.Name else giveStatus.Text = "Failed to send item" end end end) end -- ============================================================ -- SCAN ITEMS -- ============================================================ local function scanGiveItems(filter) clearGiveItems() table.clear(giveItems) filter = string.lower(tostring(filter or "")) local itemShops = playerGui:FindFirstChild("ItemShops") local scanned = {} local function addFoundItem(itemName, shopName) itemName = cleanGiveItemName(itemName) if not itemName or itemName == "" then return end -- Exclude names containing Ball. local lowerName = string.lower(itemName) if string.find(lowerName, "ball", 1, true) then return end -- Exclude names starting with TM, case-insensitively. if string.sub(lowerName, 1, 2) == "tm" then return end -- Case-insensitive substring search. -- Searching "ite" finds every name containing "ite". if filter ~= "" and not string.find(lowerName, filter, 1, true) then return end -- Deduplicate using the cleaned item name. local uniqueKey = lowerName if scanned[uniqueKey] then return end scanned[uniqueKey] = true table.insert(giveItems, { Name = itemName, Shop = shopName or "" }) end -- ========================================================= -- SCAN ITEMSHOPS -- ========================================================= if itemShops then for _, shopNumber in ipairs(itemShops:GetChildren()) do local scrollingFrames = {} for _, descendant in ipairs(shopNumber:GetDescendants()) do if descendant:IsA("ScrollingFrame") then table.insert(scrollingFrames, descendant) end end if shopNumber:IsA("ScrollingFrame") then table.insert(scrollingFrames, shopNumber) end for _, scrollingFrame in ipairs(scrollingFrames) do for _, item in ipairs(scrollingFrame:GetChildren()) do if item:IsA("GuiObject") then local itemName = getItemNameFromObject(item) if itemName and itemName ~= "UIListLayout" and itemName ~= "UIPadding" and itemName ~= "UICorner" then addFoundItem(itemName, shopNumber.Name) end end end end end end -- ========================================================= -- SCAN ReplicatedStorage.Items -- ========================================================= local itemsModule = ReplicatedStorage:FindFirstChild("Items") if itemsModule and itemsModule:IsA("ModuleScript") then local success, itemData = pcall(require, itemsModule) if success and type(itemData) == "table" then for itemName in pairs(itemData) do if type(itemName) == "string" then addFoundItem(itemName, "Items") end end end end -- ========================================================= -- ALWAYS INCLUDE THESE THREE ITEMS -- ========================================================= addFoundItem("Rayquazite", "Special") addFoundItem("Skarmorite", "Special") addFoundItem("Dragonitite", "Special") -- ========================================================= -- SORT ALPHABETICALLY -- ========================================================= table.sort(giveItems, function(a, b) return string.lower(a.Name) < string.lower(b.Name) end) -- ========================================================= -- CREATE BUTTONS -- ========================================================= for _, itemData in ipairs(giveItems) do addGiveItemButton(itemData.Name, itemData.Shop) end if #giveItems == 0 then giveStatus.Text = "No items found" else giveStatus.Text = "Items Found: " .. #giveItems end updateGiveItemCanvas() end -- ============================================================ -- SEARCH AND SCAN BUTTONS -- ============================================================ giveRefresh.MouseButton1Click:Connect(function() scanGiveItems(giveSearch.Text) end) giveSearch:GetPropertyChangedSignal("Text"):Connect(function() scanGiveItems(giveSearch.Text) end) -- ============================================================ -- BACK TO ITEMS -- ============================================================ giveBack.MouseButton1Click:Connect(function() giveSelectedModel = nil giveSelectedItem = nil giveAllMode = false showGiveModels() end) giveChoosePokemon.MouseButton1Click:Connect(function() giveSelectedModel = nil giveSelectedItem = nil giveAllMode = false showGiveModels() end) -- ============================================================ -- REFRESH MODELS -- ============================================================ giveRefreshModels.MouseButton1Click:Connect(function() scanGiveModels() giveStatus.Text = "Select a Pokemon first" end) -- ============================================================ -- INITIAL SCAN -- ============================================================ scanGiveItems("") scanGiveModels() showGiveModels() -- ============================================================ -- WATCH FOR ITEMSHOPS -- ============================================================ playerGui.ChildAdded:Connect(function(child) if child.Name == "ItemShops" then task.wait(0.3) scanGiveItems(giveSearch.Text) child.DescendantAdded:Connect(function() task.wait(0.15) if contentGive.Visible and giveItemsContainer.Visible then scanGiveItems(giveSearch.Text) end end) child.DescendantRemoving:Connect(function() task.wait(0.15) if contentGive.Visible and giveItemsContainer.Visible then scanGiveItems(giveSearch.Text) end end) end end) local existingItemShops = playerGui:FindFirstChild("ItemShops") if existingItemShops then existingItemShops.DescendantAdded:Connect(function() task.wait(0.15) if contentGive.Visible and giveItemsContainer.Visible then scanGiveItems(giveSearch.Text) end end) existingItemShops.DescendantRemoving:Connect(function() task.wait(0.15) if contentGive.Visible and giveItemsContainer.Visible then scanGiveItems(giveSearch.Text) end end) end -- ============================================================ -- WATCH FOR NEW MODELS -- ============================================================ local function refreshGiveModelLabels() for model, button in pairs(giveModelButtons) do if model and button and button.Parent and model:IsDescendantOf(workspace) then button.Text = model.Name .. getGiveOwnerLabel(model) end end end local function tryAddGiveModel(model) if not model or not model:IsA("Model") then return end for attempt = 1, 6 do if not model:IsDescendantOf(workspace) then return end if hasOwner(model) then addGiveModelButton(model) refreshGiveModelLabels() return end task.wait(0.08) end end workspace.DescendantAdded:Connect(function(obj) if obj:IsA("Model") then task.defer(tryAddGiveModel, obj) elseif obj.Name == "Owner" or string.lower(obj.Name) == "helditem" then local model = obj:FindFirstAncestorOfClass("Model") if model then task.defer(tryAddGiveModel, model) end task.defer(refreshGiveModelLabels) end end) workspace.DescendantRemoving:Connect(function(obj) if obj.Name == "Owner" or string.lower(obj.Name) == "helditem" then task.defer(refreshGiveModelLabels) end end) -- ============================================================ -- REMOVE MODELS THAT DISAPPEAR -- ============================================================ workspace.DescendantRemoving:Connect(function(obj) local button = giveModelButtons[obj] if button then if button.Parent then button:Destroy() end giveModelButtons[obj] = nil updateGiveModelCanvas() end end) -- TRAINER TAB -- Requires: player, ReplicatedStorage, contentTrainer local trainersFolder = workspace:FindFirstChild("Trainers") local fightRemote = ReplicatedStorage:FindFirstChild("FightTrainer") local battleRemote = ReplicatedStorage:FindFirstChild("Battle") local selectedTrainer = nil local fightEnabled = false local battleEnabled = false local fightThreadRunning = false local battleThreadRunning = false local trainerButtons = {} -- HELPERS local function getMonsterFolder(trainer) return trainer and trainer:FindFirstChild("Monster") end -- DISPLAY ONLY 5 POKÉMON NAMES, THEN "+ X MORE" -- This only changes the displayed text, not which Pokémon Battle uses. local function getPokemonNames(trainer) local folder = getMonsterFolder(trainer) if not folder then return "No Pokémon" end local pokemon = folder:GetChildren() table.sort(pokemon, function(a, b) return a.Name:lower() < b.Name:lower() end) if #pokemon == 0 then return "No Pokémon" end local names = {} local showCount = math.min(5, #pokemon) for i = 1, showCount do table.insert(names, pokemon[i].Name) end local result = table.concat(names, ", ") if #pokemon > 5 then result = result .. " +" .. (#pokemon - 5) .. " more" end return result end -- NEW: GET A SORTING KEY FROM EACH TRAINER'S POKÉMON -- Uses the alphabetically first Pokémon name as the primary key. local function getTrainerPokemonSortKey(trainer) local folder = getMonsterFolder(trainer) if not folder then return "zzzz_no_pokemon" end local pokemon = folder:GetChildren() if #pokemon == 0 then return "zzzz_no_pokemon" end local names = {} for _, monster in ipairs(pokemon) do table.insert(names, monster.Name:lower()) end table.sort(names) return names[1] end local function rounded(instance, radius) local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, radius or 6) corner.Parent = instance end local function makeButton(parent, text, position, size, color) local button = Instance.new("TextButton") button.Position = position button.Size = size button.BackgroundColor3 = color button.Text = text button.TextColor3 = Color3.new(1, 1, 1) button.TextSize = 9 button.Font = Enum.Font.GothamBold button.TextWrapped = true button.Parent = parent rounded(button) return button end -- TITLE local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -8, 0, 22) title.Position = UDim2.new(0, 4, 0, 2) title.BackgroundTransparency = 1 title.Text = "TRAINER AUTOMATION" title.TextColor3 = Color3.fromRGB(220, 150, 255) title.TextSize = 12 title.Font = Enum.Font.GothamBold title.Parent = contentTrainer -- STATUS local status = Instance.new("TextLabel") status.Size = UDim2.new(1, -8, 0, 18) status.Position = UDim2.new(0, 4, 0, 24) status.BackgroundTransparency = 1 status.Text = "Status: Select a trainer" status.TextColor3 = Color3.fromRGB(180, 180, 180) status.TextSize = 9 status.Font = Enum.Font.Gotham status.TextXAlignment = Enum.TextXAlignment.Left status.TextTruncate = Enum.TextTruncate.AtEnd status.Parent = contentTrainer -- SELECTED TRAINER local selectedLabel = Instance.new("TextLabel") selectedLabel.Size = UDim2.new(1, -8, 0, 26) selectedLabel.Position = UDim2.new(0, 4, 0, 43) selectedLabel.BackgroundColor3 = Color3.fromRGB(35, 35, 45) selectedLabel.Text = "Trainer: NONE" selectedLabel.TextColor3 = Color3.fromRGB(230, 230, 230) selectedLabel.TextSize = 9 selectedLabel.Font = Enum.Font.GothamBold selectedLabel.TextWrapped = true selectedLabel.Parent = contentTrainer rounded(selectedLabel) -- SCROLLABLE TRAINER LIST local trainerList = Instance.new("ScrollingFrame") trainerList.Size = UDim2.new(1, -8, 0, 112) trainerList.Position = UDim2.new(0, 4, 0, 72) trainerList.BackgroundColor3 = Color3.fromRGB(25, 25, 32) trainerList.BorderSizePixel = 0 trainerList.ScrollBarThickness = 4 trainerList.AutomaticCanvasSize = Enum.AutomaticSize.Y trainerList.CanvasSize = UDim2.new(0, 0, 0, 0) trainerList.Parent = contentTrainer rounded(trainerList) local trainerLayout = Instance.new("UIListLayout") trainerLayout.Padding = UDim.new(0, 4) trainerLayout.SortOrder = Enum.SortOrder.LayoutOrder trainerLayout.Parent = trainerList local trainerPadding = Instance.new("UIPadding") trainerPadding.PaddingTop = UDim.new(0, 4) trainerPadding.PaddingBottom = UDim.new(0, 4) trainerPadding.PaddingLeft = UDim.new(0, 4) trainerPadding.PaddingRight = UDim.new(0, 4) trainerPadding.Parent = trainerList -- ACTION BUTTONS local teleportButton = makeButton( contentTrainer, "TELEPORT", UDim2.new(0.02, 0, 0, 188), UDim2.new(0.32, 0, 0, 28), Color3.fromRGB(70, 70, 120) ) local fightToggle = makeButton( contentTrainer, "FIGHT: OFF", UDim2.new(0.34, 0, 0, 188), UDim2.new(0.32, 0, 0, 28), Color3.fromRGB(150, 55, 55) ) local battleToggle = makeButton( contentTrainer, "BATTLE: OFF", UDim2.new(0.66, 0, 0, 188), UDim2.new(0.32, 0, 0, 28), Color3.fromRGB(120, 40, 40) ) local refreshButton = makeButton( contentTrainer, "REFRESH TRAINERS", UDim2.new(0.02, 0, 0, 220), UDim2.new(0.96, 0, 0, 23), Color3.fromRGB(55, 55, 70) ) -- UPDATE STATUS local function updateStatus() if fightEnabled and battleEnabled then status.Text = "Status: Fight + Battle running" elseif fightEnabled then status.Text = "Status: Fight running" elseif battleEnabled then status.Text = "Status: Battle running" elseif selectedTrainer then status.Text = "Status: Trainer selected" else status.Text = "Status: Select a trainer" end status.TextColor3 = (fightEnabled or battleEnabled) and Color3.fromRGB(80, 255, 120) or Color3.fromRGB(180, 180, 180) fightToggle.Text = fightEnabled and "FIGHT: ON" or "FIGHT: OFF" fightToggle.BackgroundColor3 = fightEnabled and Color3.fromRGB(45, 150, 75) or Color3.fromRGB(150, 55, 55) battleToggle.Text = battleEnabled and "BATTLE: ON" or "BATTLE: OFF" battleToggle.BackgroundColor3 = battleEnabled and Color3.fromRGB(45, 120, 55) or Color3.fromRGB(120, 40, 40) selectedLabel.Text = "Trainer: " .. (selectedTrainer and selectedTrainer.Name or "NONE") end -- REFRESH TRAINER LIST local function refreshTrainers() for _, button in ipairs(trainerButtons) do if button.Parent then button:Destroy() end end table.clear(trainerButtons) trainersFolder = workspace:FindFirstChild("Trainers") if not trainersFolder then status.Text = "Status: workspace.Trainers not found" return end local trainers = trainersFolder:GetChildren() -- NEW SORTING: -- 1. Sort by the alphabetically first Pokémon name. -- 2. If those names match, sort by trainer name. table.sort(trainers, function(a, b) local keyA = getTrainerPokemonSortKey(a) local keyB = getTrainerPokemonSortKey(b) if keyA == keyB then return a.Name:lower() < b.Name:lower() end return keyA < keyB end) for index, trainer in ipairs(trainers) do local button = makeButton( trainerList, trainer.Name .. " [" .. getPokemonNames(trainer) .. "]", UDim2.new(), UDim2.new(1, -4, 0, 32), selectedTrainer == trainer and Color3.fromRGB(90, 55, 125) or Color3.fromRGB(45, 45, 58) ) button.LayoutOrder = index table.insert(trainerButtons, button) button.MouseButton1Click:Connect(function() selectedTrainer = trainer refreshTrainers() updateStatus() end) end updateStatus() end -- TELEPORT TO SELECTED TRAINER teleportButton.MouseButton1Click:Connect(function() local trainer = selectedTrainer local character = player.Character local root = character and character:FindFirstChild("HumanoidRootPart") if not trainer or not trainer.Parent then status.Text = "Status: Select a trainer first" return end local trainerRoot = trainer:FindFirstChild("HumanoidRootPart") or trainer.PrimaryPart or trainer:FindFirstChildWhichIsA("BasePart", true) if root and trainerRoot then root.CFrame = trainerRoot.CFrame + Vector3.new(0, 3, 0) status.Text = "Status: Teleported to " .. trainer.Name else status.Text = "Status: Trainer position not found" end end) -- FIGHT LOOP local function startFightLoop() if fightThreadRunning then return end if not fightRemote or not fightRemote:IsA("RemoteEvent") then fightEnabled = false updateStatus() status.Text = "Status: FightTrainer remote not found" return end fightThreadRunning = true task.spawn(function() while fightEnabled do local trainer = selectedTrainer if trainer and trainer.Parent then pcall(function() fightRemote:FireServer(trainer) end) end task.wait(0.15) end fightThreadRunning = false if fightEnabled then startFightLoop() end end) end -- FIND THE MATCHING POKÉMON IN WORKSPACE local function findWorkspacePokemon(pokemon) if not pokemon then return nil end return workspace:FindFirstChild(pokemon.Name) or workspace:FindFirstChild(pokemon.Name, true) end -- BATTLE LOOP: AUTOMATICALLY BATTLE ALL POKÉMON local function startBattleLoop() if battleThreadRunning then return end if not battleRemote or not battleRemote:IsA("RemoteEvent") then battleEnabled = false updateStatus() status.Text = "Status: Battle remote not found" return end battleThreadRunning = true task.spawn(function() while battleEnabled do local trainer = selectedTrainer local folder = getMonsterFolder(trainer) if trainer and trainer.Parent and folder then local pokemon = folder:GetChildren() table.sort(pokemon, function(a, b) return a.Name:lower() < b.Name:lower() end) if #pokemon == 0 then status.Text = "Status: Trainer has no Pokémon" task.wait(0.5) else for _, monster in ipairs(pokemon) do if not battleEnabled then break end if selectedTrainer ~= trainer then break end local target = findWorkspacePokemon(monster) if target then pcall(function() battleRemote:FireServer(target) end) end task.wait(0.15) end end else status.Text = "Status: Select a trainer with Pokémon" task.wait(0.5) end task.wait(0.15) end battleThreadRunning = false if battleEnabled then startBattleLoop() end end) end -- FIGHT TOGGLE fightToggle.MouseButton1Click:Connect(function() fightEnabled = not fightEnabled if fightEnabled then startFightLoop() end updateStatus() end) -- BATTLE TOGGLE battleToggle.MouseButton1Click:Connect(function() battleEnabled = not battleEnabled if battleEnabled then startBattleLoop() end updateStatus() end) -- REFRESH TRAINERS refreshButton.MouseButton1Click:Connect(refreshTrainers) -- INITIALIZE refreshTrainers() updateStatus() -- SETTINGS local settingsScroll = Instance.new("ScrollingFrame") settingsScroll.Size = UDim2.new(1, 0, 1, 0) settingsScroll.BackgroundTransparency = 1 settingsScroll.ScrollBarThickness = 3 settingsScroll.CanvasSize = UDim2.new(0, 0, 0, 250) settingsScroll.Parent = contentSettings local settingsLayout = Instance.new("UIListLayout") settingsLayout.Padding = UDim.new(0, 5) settingsLayout.Parent = settingsScroll local function createSettingBtn(text) local b = Instance.new("TextButton") b.Size = UDim2.new(1, -8, 0, 32) b.BackgroundColor3 = Color3.fromRGB(40, 40, 55) b.Text = text .. " : OFF" b.TextColor3 = Color3.new(1, 1, 1) b.TextSize = 9 b.Font = Enum.Font.GothamBold b.TextXAlignment = Enum.TextXAlignment.Left b.Parent = settingsScroll Instance.new("UICorner", b).CornerRadius = UDim.new(0, 8) local padding = Instance.new("UIPadding") padding.PaddingLeft = UDim.new(0, 10) padding.Parent = b return b end local s1 = createSettingBtn("🎨 Low Graphics") local s2 = createSettingBtn("💡 No Shadows") local s3 = createSettingBtn("✨ No Particles") local s4 = createSettingBtn("🌿 No Grass") local s5 = createSettingBtn("💧 Optimize Sky") local s6 = Instance.new("TextButton") s6.Size = UDim2.new(1, -8, 0, 32) s6.BackgroundColor3 = Color3.fromRGB(200, 50, 50) s6.Text = "⚡ ULTRA FPS BOOST" s6.TextColor3 = Color3.new(1, 1, 1) s6.TextSize = 9 s6.Font = Enum.Font.GothamBold s6.Parent = settingsScroll Instance.new("UICorner", s6).CornerRadius = UDim.new(0, 8) s1.MouseButton1Click:Connect(function() s1.Text = "🎨 Low Graphics : ON" s1.BackgroundColor3 = Color3.fromRGB(45, 90, 60) for _, v in ipairs(workspace:GetDescendants()) do if v:IsA("BasePart") then pcall(function() v.Material = Enum.Material.SmoothPlastic end) end end end) s2.MouseButton1Click:Connect(function() s2.Text = "💡 No Shadows : ON" s2.BackgroundColor3 = Color3.fromRGB(45, 90, 60) Lighting.GlobalShadows = false for _, v in ipairs(workspace:GetDescendants()) do if v:IsA("BasePart") then v.CastShadow = false end end end) s3.MouseButton1Click:Connect(function() s3.Text = "✨ No Particles : ON" s3.BackgroundColor3 = Color3.fromRGB(45, 90, 60) for _, v in ipairs(workspace:GetDescendants()) do if v:IsA("ParticleEmitter") or v:IsA("Trail") then v.Enabled = false end end end) s4.MouseButton1Click:Connect(function() s4.Text = "🌿 No Grass : ON" s4.BackgroundColor3 = Color3.fromRGB(45, 90, 60) local terrain = workspace:FindFirstChild("Terrain") if terrain then terrain.Decoration = false end end) s5.MouseButton1Click:Connect(function() s5.Text = "💧 Optimize Sky : ON" s5.BackgroundColor3 = Color3.fromRGB(45, 90, 60) Lighting.FogEnd = 100000 end) s6.MouseButton1Click:Connect(function() Lighting.GlobalShadows = false Lighting.FogEnd = 100000 for _, v in ipairs(workspace:GetDescendants()) do pcall(function() if v:IsA("BasePart") then v.Material = Enum.Material.SmoothPlastic v.CastShadow = false end if v:IsA("ParticleEmitter") or v:IsA("Trail") then v.Enabled = false end end) end local terrain = workspace:FindFirstChild("Terrain") if terrain then terrain.Decoration = false end s1.Text = "🎨 Low Graphics : ON" s1.BackgroundColor3 = Color3.fromRGB(45, 90, 60) s2.Text = "💡 No Shadows : ON" s2.BackgroundColor3 = Color3.fromRGB(45, 90, 60) s3.Text = "✨ No Particles : ON" s3.BackgroundColor3 = Color3.fromRGB(45, 90, 60) s4.Text = "🌿 No Grass : ON" s4.BackgroundColor3 = Color3.fromRGB(45, 90, 60) s5.Text = "💧 Optimize Sky : ON" s5.BackgroundColor3 = Color3.fromRGB(45, 90, 60) end) -- DRAGGING / MINIMIZE local dragging = false local dragStart = nil local startPos = nil local logoDragging = false local logoDragStart = nil local logoStartPos = nil local logoMoved = false titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = frame.Position end end) UserInputService.InputChanged:Connect(function(input) if dragging and ( input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch ) then local d = input.Position - dragStart frame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y ) end if logoDragging and ( input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch ) then local d = input.Position - logoDragStart if math.abs(d.X) > 5 or math.abs(d.Y) > 5 then logoMoved = true end logo.Position = UDim2.new( logoStartPos.X.Scale, logoStartPos.X.Offset + d.X, logoStartPos.Y.Scale, logoStartPos.Y.Offset + d.Y ) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false if logoDragging then if not logoMoved then frame.Position = logo.Position logo.Visible = false frame.Visible = true end logoDragging = false end end end) logo.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then logoDragging = true logoMoved = false logoDragStart = input.Position logoStartPos = logo.Position end end) minBtn.MouseButton1Click:Connect(function() logo.Position = frame.Position frame.Visible = false logo.Visible = true end) closeBtn.MouseButton1Click:Connect(function() screenGui:Destroy() end)