Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService('Players')
- local UIS = game:GetService('UserInputService')
- local RunService = game:GetService('RunService')
- local LocalPlayer = Players.LocalPlayer
- local PlayerGui = LocalPlayer:WaitForChild('PlayerGui')
- local C = {
- PANEL = Color3.fromRGB(15, 15, 22),
- CARD = Color3.fromRGB(25, 25, 35),
- ACCENT = Color3.fromRGB(200, 80, 255),
- TEXT = Color3.fromRGB(240, 240, 255),
- GREEN = Color3.fromRGB(50, 230, 90),
- YELLOW = Color3.fromRGB(255, 210, 40),
- RED = Color3.fromRGB(255, 60, 60),
- MUTED = Color3.fromRGB(130, 130, 150),
- WHITE = Color3.new(1, 1, 1),
- }
- local petDB, dbReady = {}, false
- local activeSide = "ME"
- local myPets, myTotal = {}, 0
- local theirPets, theirTotal = {}, 0
- local lastAddedKey = ""
- local function unescape(s)
- return (s:gsub('\\"','"'):gsub('\\/','/'):gsub('\\n','\n'):gsub('\\\\','\\'))
- end
- local function getBestValue(obj, prefix)
- local np = tonumber(obj:match('"'..prefix..'value %- nopotion"%s*:%s*(%-?[%d%.]+)')) or tonumber(obj:match('"'..prefix..'value"%s*:%s*(%-?[%d%.]+)')) or 0
- local r = tonumber(obj:match('"'..prefix..'value %- ride"%s*:%s*(%-?[%d%.]+)')) or 0
- local f = tonumber(obj:match('"'..prefix..'value %- fly"%s*:%s*(%-?[%d%.]+)')) or 0
- local fr = tonumber(obj:match('"'..prefix..'value %- fly\\u0026ride"%s*:%s*(%-?[%d%.]+)'))
- or tonumber(obj:match('"'..prefix..'value %- fly&ride"%s*:%s*(%-?[%d%.]+)'))
- or tonumber(obj:match('"'..prefix..'value"%s*:%s*(%-?[%d%.]+)')) or 0
- return { np = np, r = r, f = f, fr = fr }
- end
- local function smartFill(p)
- if not p then return end
- if p.np == 0 and p.fr > 0 then p.np = p.fr end
- if p.fr == 0 and p.np > 0 then p.fr = p.np end
- if p.np > 0 and p.fr > 0 then
- if p.r == 0 then p.r = math.floor((p.np + (p.fr - p.np) * 0.45) * 100) / 100 end
- if p.f == 0 then p.f = math.floor((p.np + (p.fr - p.np) * 0.55) * 100) / 100 end
- end
- end
- -- Cargar Base de Datos
- local reqFn = (syn and syn.request) or (http and http.request) or request
- if reqFn then
- task.spawn(function()
- local res = reqFn({Url = "https://elvebredd.com/adopt-me-calculator", Method = "GET"})
- if res and res.Body then
- for obj in unescape(res.Body):gmatch("{(.-)}") do
- local petName, status = obj:match('"[nN]ame"%s*:%s*"(.-)"'), obj:match('"[sS]tatus"%s*:%s*"(.-)"')
- if petName and status == "Ready" then
- petName = petName:lower()
- petDB[petName] = {
- name = petName,
- r = getBestValue(obj, "r"),
- n = getBestValue(obj, "n"),
- m = getBestValue(obj, "m")
- }
- smartFill(petDB[petName].r); smartFill(petDB[petName].n); smartFill(petDB[petName].m)
- end
- end
- dbReady = true
- end
- end)
- end
- -- Extrae solo el nombre base sin prefijos
- local function cleanPetName(rawName)
- local name = rawName:lower()
- name = name:gsub("mega neon", ""):gsub("neon", ""):gsub("mfr", ""):gsub("nfr", "")
- name = name:gsub("^mr%s+", ""):gsub("%s+mr$", ""):gsub("^mf%s+", ""):gsub("%s+mf$", "")
- name = name:gsub("^nr%s+", ""):gsub("%s+nr$", ""):gsub("^nf%s+", ""):gsub("%s+nf$", "")
- name = name:gsub("^m%s+", ""):gsub("^n%s+", "")
- return name:gsub("^%s+", ""):gsub("%s+$", "")
- end
- local function lookupPet(raw)
- local cName = cleanPetName(raw)
- if petDB[cName] then return petDB[cName] end
- local best, bestLen = nil, 0
- for k, v in pairs(petDB) do
- if (cName == k or cName:find("^" .. k .. "$")) and #k > bestLen then
- bestLen = #k; best = v
- end
- end
- if not best then
- for k, v in pairs(petDB) do
- if cName:find(k, 1, true) and #k > bestLen then
- bestLen = #k; best = v
- end
- end
- end
- return best
- end
- -- Limpieza de GUI previa
- pcall(function()
- local containers = {game.CoreGui, PlayerGui}
- if gethui then table.insert(containers, gethui()) end
- for _, c in ipairs(containers) do
- for _, v in ipairs(c:GetChildren()) do
- if v:IsA("ScreenGui") and (v.Name:find("TradeChecker") or v.Name:find("Gigi")) then v:Destroy() end
- end
- end
- end)
- -- ScreenGui Principal
- local screen = Instance.new('ScreenGui', game.CoreGui)
- screen.Name = 'Gigi_TradeChecker'
- screen.ResetOnSpawn = false
- -- Panel Principal Centrado
- local frame = Instance.new('Frame', screen)
- frame.Size = UDim2.new(0, 360, 0, 260)
- frame.Position = UDim2.new(0.5, -180, 0.5, -130)
- frame.BackgroundColor3 = C.PANEL
- frame.BorderSizePixel = 0
- Instance.new('UICorner', frame).CornerRadius = UDim.new(0, 10)
- local uiStroke = Instance.new('UIStroke', frame)
- uiStroke.Color, uiStroke.Thickness = C.ACCENT, 2
- -- Encabezado del Panel
- local title = Instance.new('TextLabel', frame)
- title.Size = UDim2.new(1, -70, 0, 32)
- title.Position = UDim2.new(0, 10, 0, 0)
- title.BackgroundTransparency = 1
- title.Text = "✨ Gigi value"
- title.TextColor3, title.Font, title.TextSize = C.WHITE, Enum.Font.GothamBold, 14
- title.TextXAlignment = Enum.TextXAlignment.Left
- -- Botón Reset (🔄)
- local resetBtn = Instance.new('TextButton', frame)
- resetBtn.Size, resetBtn.Position = UDim2.new(0, 28, 0, 28), UDim2.new(1, -60, 0, 2)
- resetBtn.BackgroundTransparency = 1
- resetBtn.Text, resetBtn.TextSize = "🔄", 14
- -- Botón Cerrar (✕)
- local closeBtn = Instance.new('TextButton', frame)
- closeBtn.Size, closeBtn.Position = UDim2.new(0, 28, 0, 28), UDim2.new(1, -30, 0, 2)
- closeBtn.BackgroundTransparency = 1
- closeBtn.Text, closeBtn.TextColor3, closeBtn.Font, closeBtn.TextSize = "✕", C.WHITE, Enum.Font.GothamBold, 14
- -- Logo Flotante
- local openBtn = Instance.new('TextButton', screen)
- openBtn.Size, openBtn.Position = UDim2.new(0, 50, 0, 50), UDim2.new(0.05, 0, 0.5, -25)
- openBtn.BackgroundColor3, openBtn.Text, openBtn.TextSize, openBtn.Visible = C.PANEL, "✨", 22, false
- Instance.new('UICorner', openBtn).CornerRadius = UDim.new(1, 0)
- local openStroke = Instance.new('UIStroke', openBtn)
- openStroke.Color, openStroke.Thickness = C.ACCENT, 2
- local function makeDraggable(guiObj)
- local dragging, dragStart, startPos
- guiObj.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true; dragStart = input.Position; startPos = guiObj.Position
- end
- end)
- UIS.InputChanged:Connect(function(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - dragStart
- guiObj.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- UIS.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end
- end)
- end
- makeDraggable(openBtn)
- closeBtn.MouseButton1Click:Connect(function() frame.Visible = false; openBtn.Visible = true end)
- openBtn.MouseButton1Click:Connect(function() frame.Visible = true; openBtn.Visible = false end)
- -- Botones Selector ME y THEM
- local meBtn = Instance.new('TextButton', frame)
- meBtn.Size, meBtn.Position = UDim2.new(0, 75, 0, 24), UDim2.new(0, 10, 0, 34)
- meBtn.BackgroundColor3 = C.GREEN
- meBtn.Text = "ME"
- meBtn.TextColor3, meBtn.Font, meBtn.TextSize = C.WHITE, Enum.Font.GothamBold, 12
- Instance.new('UICorner', meBtn).CornerRadius = UDim.new(0, 5)
- local themBtn = Instance.new('TextButton', frame)
- themBtn.Size, themBtn.Position = UDim2.new(0, 75, 0, 24), UDim2.new(1, -85, 0, 34)
- themBtn.BackgroundColor3 = C.CARD
- themBtn.Text = "THEM"
- themBtn.TextColor3, themBtn.Font, themBtn.TextSize = C.WHITE, Enum.Font.GothamBold, 12
- Instance.new('UICorner', themBtn).CornerRadius = UDim.new(0, 5)
- local statusLbl = Instance.new('TextLabel', frame)
- statusLbl.Size, statusLbl.Position = UDim2.new(1, -170, 0, 24), UDim2.new(0, 85, 0, 34)
- statusLbl.BackgroundTransparency = 1
- statusLbl.Text = "Añadiendo a: ME"
- statusLbl.TextColor3, statusLbl.Font, statusLbl.TextSize = C.YELLOW, Enum.Font.Gotham, 11
- meBtn.MouseButton1Click:Connect(function()
- activeSide = "ME"
- meBtn.BackgroundColor3 = C.GREEN
- themBtn.BackgroundColor3 = C.CARD
- statusLbl.Text = "Añadiendo a: ME"
- end)
- themBtn.MouseButton1Click:Connect(function()
- activeSide = "THEM"
- themBtn.BackgroundColor3 = C.GREEN
- meBtn.BackgroundColor3 = C.CARD
- statusLbl.Text = "Añadiendo a: THEM"
- end)
- -- Listas
- local meScroll = Instance.new('ScrollingFrame', frame)
- meScroll.Size, meScroll.Position = UDim2.new(0.46, 0, 0, 135), UDim2.new(0, 10, 0, 65)
- meScroll.BackgroundColor3, meScroll.BorderSizePixel = C.CARD, 0
- meScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
- meScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
- Instance.new('UICorner', meScroll).CornerRadius = UDim.new(0, 6)
- local meList = Instance.new('UIListLayout', meScroll); meList.Padding = UDim.new(0, 2)
- local themScroll = Instance.new('ScrollingFrame', frame)
- themScroll.Size, themScroll.Position = UDim2.new(0.46, 0, 0, 135), UDim2.new(0.52, 0, 0, 65)
- themScroll.BackgroundColor3, themScroll.BorderSizePixel = C.CARD, 0
- themScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
- themScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
- Instance.new('UICorner', themScroll).CornerRadius = UDim.new(0, 6)
- local themList = Instance.new('UIListLayout', themScroll); themList.Padding = UDim.new(0, 2)
- -- Panel Inferior
- local resultFrame = Instance.new('Frame', frame)
- resultFrame.Size, resultFrame.Position = UDim2.new(1, -20, 0, 48), UDim2.new(0, 10, 1, -54)
- resultFrame.BackgroundColor3 = C.CARD
- Instance.new('UICorner', resultFrame).CornerRadius = UDim.new(0, 6)
- local totalsLbl = Instance.new('TextLabel', resultFrame)
- totalsLbl.Size, totalsLbl.Position = UDim2.new(1, 0, 0, 22), UDim2.new(0, 0, 0, 2)
- totalsLbl.BackgroundTransparency = 1
- totalsLbl.Text = "Tú: 0 | Rival: 0"
- totalsLbl.TextColor3, totalsLbl.Font, totalsLbl.TextSize = C.WHITE, Enum.Font.GothamMedium, 12
- totalsLbl.RichText = true
- local outcomeLbl = Instance.new('TextLabel', resultFrame)
- outcomeLbl.Size, outcomeLbl.Position = UDim2.new(1, 0, 0, 20), UDim2.new(0, 0, 0, 24)
- outcomeLbl.BackgroundTransparency = 1
- outcomeLbl.Text = "Esperando mascotas..."
- outcomeLbl.TextColor3, outcomeLbl.Font, outcomeLbl.TextSize = C.YELLOW, Enum.Font.GothamBold, 12
- outcomeLbl.RichText = true
- local updateUI
- updateUI = function()
- myTotal, theirTotal = 0, 0
- for _, child in ipairs(meScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
- for _, child in ipairs(themScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
- for index, pet in ipairs(myPets) do
- myTotal = myTotal + pet.val
- local btn = Instance.new('TextButton', meScroll)
- btn.Size = UDim2.new(1, 0, 0, 20)
- btn.BackgroundTransparency = 1
- btn.Text = string.format(" ✕ %s (<font color=\"#3CDD64\">%s</font>)", pet.name, tostring(pet.val))
- btn.TextColor3, btn.Font, btn.TextSize, btn.RichText, btn.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
- btn.MouseButton1Click:Connect(function()
- table.remove(myPets, index)
- updateUI()
- end)
- end
- for index, pet in ipairs(theirPets) do
- theirTotal = theirTotal + pet.val
- local btn = Instance.new('TextButton', themScroll)
- btn.Size = UDim2.new(1, 0, 0, 20)
- btn.BackgroundTransparency = 1
- btn.Text = string.format(" ✕ %s (<font color=\"#FFD700\">%s</font>)", pet.name, tostring(pet.val))
- btn.TextColor3, btn.Font, btn.TextSize, btn.RichText, btn.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
- btn.MouseButton1Click:Connect(function()
- table.remove(theirPets, index)
- updateUI()
- end)
- end
- myTotal = math.floor(myTotal * 100) / 100
- theirTotal = math.floor(theirTotal * 100) / 100
- totalsLbl.Text = string.format('Tú (ME): <font color="#3CDD64">%s</font> | Rival (THEM): <font color="#FFD700">%s</font>', tostring(myTotal), tostring(theirTotal))
- local diff = math.floor((theirTotal - myTotal) * 100) / 100
- if #myPets == 0 and #theirPets == 0 then
- outcomeLbl.Text = "Toca mascotas para registrarlas."
- elseif diff > 0.1 then
- outcomeLbl.Text = string.format('Resultado: <font color="#3CDD64">WIN (+%s)</font>', tostring(diff))
- elseif diff < -0.1 then
- outcomeLbl.Text = string.format('Resultado: <font color="#FF5050">LOSE (%s)</font>', tostring(diff))
- else
- outcomeLbl.Text = 'Resultado: <font color="#FFD700">FAIR (Justo)</font>'
- end
- end
- resetBtn.MouseButton1Click:Connect(function()
- myPets, theirPets = {}, {}
- lastAddedKey = ""
- updateUI()
- end)
- -- Escaneo de pociones e iconos
- local function getHoveredPotionsFallback(tooltipObj)
- local mouse = UIS:GetMouseLocation()
- local mx, my = mouse.X, mouse.Y
- local isFly, isRide = false, false
- if tooltipObj then
- for _, desc in ipairs(tooltipObj:GetDescendants()) do
- if desc:IsA("ImageLabel") or desc:IsA("ImageButton") then
- local n = desc.Name:lower()
- if (n == "flyable" or n == "fly") and desc.Visible and desc.ImageTransparency < 0.9 and desc.Image ~= "" then isFly = true end
- if (n == "rideable" or n == "ride") and desc.Visible and desc.ImageTransparency < 0.9 and desc.Image ~= "" then isRide = true end
- end
- end
- end
- for _, appName in ipairs({"TradeApp", "InventoryApp"}) do
- local app = PlayerGui:FindFirstChild(appName)
- if app then
- for _, child in ipairs(app:GetDescendants()) do
- if child:IsA("ImageLabel") and (child.Name:lower() == "flyable" or child.Name:lower() == "rideable") then
- local slot = child.Parent
- local isHovered, depth = false, 0
- while slot and slot:IsA("GuiObject") and depth < 8 do
- local px, py = slot.AbsolutePosition.X, slot.AbsolutePosition.Y
- local pw, ph = slot.AbsoluteSize.X, slot.AbsoluteSize.Y
- if pw < 180 and ph < 180 then
- if (mx >= px and mx <= px + pw and my >= py and my <= py + ph) or
- (mx >= px and mx <= px + pw and (my - 36) >= py and (my - 36) <= py + ph) then
- isHovered = true; break
- end
- end
- slot = slot.Parent; depth = depth + 1
- end
- if isHovered then
- if child.Visible and child.ImageTransparency < 0.9 and child.Image ~= "" then
- if child.Name:lower() == "flyable" then isFly = true end
- if child.Name:lower() == "rideable" then isRide = true end
- end
- end
- end
- end
- end
- end
- return isFly, isRide
- end
- RunService.RenderStepped:Connect(function()
- if not dbReady then return end
- local tooltip = nil
- for _, appName in ipairs({'TradeApp', 'InventoryApp'}) do
- local app = PlayerGui:FindFirstChild(appName)
- if app then
- for _, c in ipairs(app:GetChildren()) do
- if c.Name == 'Tooltip' and c.Visible and c.AbsolutePosition.X > -4000 then tooltip = c; break end
- end
- end
- if tooltip then break end
- end
- if tooltip then
- local variant, bestMatch, fullTooltipText = "r", "", ""
- -- Acumulamos todo el texto visible del tooltip para buscar la variante exacta
- for _, lbl in ipairs(tooltip:GetDescendants()) do
- if lbl:IsA("TextLabel") and lbl.Visible then
- fullTooltipText = fullTooltipText .. " " .. lbl.Text:lower()
- local data = lookupPet(lbl.Text)
- if data then bestMatch = data.name end
- end
- end
- -- Detección rigurosa de variante (Mega > Neón > Normal)
- if fullTooltipText:find("mega neon") or fullTooltipText:find("mega") or fullTooltipText:find("mfr") then
- variant = "m"
- elseif fullTooltipText:find("neon") or fullTooltipText:find("nfr") then
- variant = "n"
- else
- -- Verificación adicional por degradado UIGradient del marco neón/mega
- for _, desc in ipairs(tooltip:GetDescendants()) do
- if desc:IsA("UIGradient") then
- if #desc.Color.Keypoints > 3 then
- variant = "m"
- else
- variant = "n"
- end
- break
- end
- end
- end
- if bestMatch ~= "" then
- local isFly, isRide = getHoveredPotionsFallback(tooltip)
- local currentKey = activeSide .. "_" .. bestMatch .. "_" .. variant .. "_" .. tostring(isFly) .. "_" .. tostring(isRide)
- if currentKey ~= lastAddedKey then
- lastAddedKey = currentKey
- local data = petDB[bestMatch:lower()]
- if data then
- -- Seleccionar objeto de datos según la variante (m = mega, n = neon, r = regular)
- local p = data[variant] or data.r
- local val = 0
- -- Obtención estricta del valor según las pociones detectadas
- if isFly and isRide then
- val = p.fr
- elseif isFly then
- val = p.f
- elseif isRide then
- val = p.r
- else
- val = p.np
- end
- -- Si no hay valor específico de la poción, usar FR o NP como fallback
- if (not val or val == 0) then
- if (isFly or isRide) and p.fr > 0 then
- val = p.fr
- else
- val = p.np
- end
- end
- local pre = (variant == "m" and "M " or (variant == "n" and "N " or ""))
- local potStr = (isFly and isRide and " FR") or (isFly and " F") or (isRide and " R") or " No Pot"
- local fullName = pre .. bestMatch:sub(1,1):upper() .. bestMatch:sub(2) .. potStr
- if activeSide == "ME" then
- table.insert(myPets, {name = fullName, val = val or 0})
- else
- table.insert(theirPets, {name = fullName, val = val or 0})
- end
- updateUI()
- end
- end
- end
- else
- lastAddedKey = ""
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment