Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players, UIS, RunService = game:GetService('Players'), game:GetService('UserInputService'), game:GetService('RunService')
- local LocalPlayer = Players.LocalPlayer
- local PlayerGui = LocalPlayer:WaitForChild('PlayerGui')
- local Camera = workspace.CurrentCamera
- local C = {
- PANEL = Color3.fromRGB(15, 15, 20),
- 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(120, 120, 140),
- WHITE = Color3.new(1, 1, 1),
- }
- local petDB, dbReady, lastHoveredPet = {}, false, ""
- 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"%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
- local function parsePetVariant(rawName)
- local name, variant = rawName:lower(), "r"
- if name:find("mega neon") or name:find("mfr") or name:match("%smr%s") or name:match("^mr%s") or name:match("%smf%s") or name:match("^mf%s") then
- variant = "m"
- name = name:gsub("mega neon%s*", ""):gsub("mfr%s*", ""):gsub("mr%s*", ""):gsub("mf%s*", "")
- elseif name:find("neon") or name:find("nfr") or name:match("%snr%s") or name:match("^nr%s") or name:match("%snf%s") or name:match("^nf%s") then
- variant = "n"
- name = name:gsub("neon%s*", ""):gsub("nfr%s*", ""):gsub("nr%s*", ""):gsub("nf%s*", "")
- end
- return name:gsub("^%s+", ""):gsub("%s+$", ""), variant
- end
- local function lookupPet(raw)
- local cName, cVar = parsePetVariant(raw)
- if petDB[cName] then return petDB[cName], cVar end
- local best, bestLen = nil, 0
- for k, v in pairs(petDB) do
- if cName:find(k) and #k > bestLen then bestLen = #k; best = v end
- end
- return best, cVar
- end
- -- Limpieza de GUI anterior
- 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") then v:Destroy() end
- end
- end
- end)
- -- Interface Grafica
- local screen = Instance.new('ScreenGui', game.CoreGui)
- screen.Name = 'ENI_TradeChecker'
- screen.ResetOnSpawn = false
- local frame = Instance.new('Frame', screen)
- frame.Size = UDim2.new(0, 310, 0, 140)
- frame.Position = UDim2.new(1, -330, 0.5, -70)
- frame.BackgroundColor3 = C.PANEL
- frame.BorderSizePixel = 0
- Instance.new('UICorner', frame).CornerRadius = UDim.new(0, 8)
- local uiStroke = Instance.new('UIStroke', frame)
- uiStroke.Color, uiStroke.Thickness = C.ACCENT, 2
- local title = Instance.new('TextLabel', frame)
- title.Size = UDim2.new(1, -30, 0, 28)
- title.BackgroundTransparency = 1
- title.Text = "✨ ENI | Live Trade & Inspector"
- title.TextColor3, title.Font, title.TextSize = C.WHITE, Enum.Font.GothamBold, 13
- local closeBtn = Instance.new('TextButton', frame)
- closeBtn.Size, closeBtn.Position, closeBtn.BackgroundTransparency = UDim2.new(0, 30, 0, 28), UDim2.new(1, -30, 0, 0), 1
- closeBtn.Text, closeBtn.TextColor3, closeBtn.Font, closeBtn.TextSize = "✕", C.WHITE, Enum.Font.GothamBold, 14
- local openBtn = Instance.new('TextButton', screen)
- openBtn.Size, openBtn.Position = UDim2.new(0, 48, 0, 48), UDim2.new(1, -65, 0.5, -24)
- 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
- -- Arrastrar GUI
- local function makeDraggable(guiObj, handle)
- handle = handle or guiObj
- local dragging, dragStart, startPos
- handle.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(frame, title); makeDraggable(openBtn, openBtn)
- closeBtn.MouseButton1Click:Connect(function() frame.Visible = false; openBtn.Visible = true end)
- openBtn.MouseButton1Click:Connect(function() frame.Visible = true; openBtn.Visible = false end)
- -- Componentes de Texto
- local container = Instance.new('Frame', frame)
- container.Size, container.Position, container.BackgroundTransparency = UDim2.new(1, -20, 0, 100), UDim2.new(0, 10, 0, 32), 1
- local uiList = Instance.new('UIListLayout', container)
- uiList.SortOrder, uiList.Padding = Enum.SortOrder.LayoutOrder, UDim.new(0, 4)
- local function createLabel(fontSize, color, font)
- local l = Instance.new('TextLabel', container)
- l.Size, l.BackgroundTransparency = UDim2.new(1, 0, 0, 20), 1
- l.TextColor3, l.Font, l.TextSize, l.RichText, l.TextXAlignment = color, font or Enum.Font.Gotham, fontSize, true, Enum.TextXAlignment.Left
- return l
- end
- local petL = createLabel(12, C.TEXT, Enum.Font.GothamMedium)
- petL.Text = "Cargando base de datos..."
- local valL = createLabel(12, C.MUTED)
- local tradeL = createLabel(12, C.TEXT, Enum.Font.GothamMedium)
- tradeL.Text = "Takas: <font color=\"#888\">Fuera de intercambio</font>"
- local winL = createLabel(13, C.WHITE, Enum.Font.GothamBold)
- -- Inspector de Pociones en Hover
- local function getHoveredPotionsFallback()
- local mouse = UIS:GetMouseLocation()
- local mx, my, isFly, isRide, foundSlot = mouse.X, mouse.Y, false, false, false
- 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, isHovered, depth = child.Parent, false, 0
- while slot and slot:IsA("GuiObject") and depth < 8 do
- local px, py, pw, ph = slot.AbsolutePosition.X, slot.AbsolutePosition.Y, slot.AbsoluteSize.X, slot.AbsoluteSize.Y
- if pw < 180 and ph < 180 and ((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
- slot, depth = slot.Parent, depth + 1
- end
- if isHovered then
- foundSlot = true
- 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
- if foundSlot then break end
- end
- return isFly, isRide, not foundSlot
- end
- -- Inspector en tiempo real
- RunService.RenderStepped:Connect(function()
- if not dbReady or not frame.Visible 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, rawText = "r", "", ""
- local headerLbl = tooltip:FindFirstChild('Header', true)
- if headerLbl then rawText = headerLbl.Text end
- for _, lbl in ipairs(tooltip:GetDescendants()) do
- if lbl:IsA("TextLabel") and lbl.Visible then
- local t = lbl.Text:lower()
- if t:find("mega neon") or t:find("mfr") then variant = "m"
- elseif (t:find("neon") or t:find("nfr")) and variant ~= "m" then variant = "n" end
- local data, v = lookupPet(lbl.Text)
- if data then
- bestMatch = data.name
- if v == "m" then variant = "m" elseif v == "n" and variant ~= "m" then variant = "n" end
- end
- end
- end
- if bestMatch == "" and rawText ~= "" then
- local data, v = lookupPet(rawText)
- if data then bestMatch = data.name; if v == "m" then variant = "m" elseif v == "n" and variant ~= "m" then variant = "n" end end
- end
- if bestMatch ~= "" then
- local isFly, isRide, fallback = getHoveredPotionsFallback()
- local currentState = bestMatch .. variant .. tostring(isFly) .. tostring(isRide) .. tostring(fallback)
- if currentState ~= lastHoveredPet then
- lastHoveredPet = currentState
- petL.Text = '🐾 ' .. bestMatch:upper()
- local data = petDB[bestMatch:lower()]
- if not data then return end
- local p = data[variant] or data.r
- local pre = variant == "n" and "Neon " or (variant == "m" and "Mega " or "")
- if p.np == p.fr and p.np > 0 then
- valL.Text = string.format('<font color="#3CDD64">💎 Valor: %s</font>', tostring(p.np))
- elseif not fallback then
- local val, lbl = p.np, pre
- if isFly and isRide then val = p.fr; lbl = lbl.."Fly Ride"
- elseif isFly then val = p.f; lbl = lbl.."Fly"
- elseif isRide then val = p.r; lbl = lbl.."Ride"
- else lbl = lbl:gsub("%s*$", "") end
- valL.Text = string.format('<font color="#C084FC">💎 %s: %s</font>', lbl == "" and "Normal" or lbl, tostring(val))
- else
- valL.Text = string.format('<font color="#888">NP:%s</font> | <font color="#3CDD64">R:%s</font> | <font color="#4DA6FF">F:%s</font> | <font color="#C084FC">FR:%s</font>',
- tostring(p.np), tostring(p.r), tostring(p.f), tostring(p.fr))
- end
- end
- end
- else
- lastHoveredPet = ""
- end
- end)
- -- Calculador del TRADE en Vivo (Win / Lose / Fair)
- task.spawn(function()
- while task.wait(0.4) do
- if dbReady and frame.Visible then
- local TradeApp = PlayerGui:FindFirstChild('TradeApp')
- if not TradeApp or not TradeApp.Visible then
- tradeL.Text = 'Takas: <font color="#888">No estás en Trade</font>'
- winL.Text = ""
- else
- local myTotal, theirTotal, midX = 0, 0, Camera.ViewportSize.X / 2
- local scanned, anyFound = {}, false
- for _, v in ipairs(TradeApp:GetDescendants()) do
- if v:IsA("TextLabel") and v.Text ~= "" and v.Parent.Name ~= "Tooltip" and v.Name ~= "Header" and v.Visible and v.TextTransparency < 1 and not scanned[v] then
- scanned[v] = true
- local data, variant = lookupPet(v.Text)
- if data then
- anyFound = true
- for _, desc in ipairs(v.Parent:GetDescendants()) do
- if desc:IsA("UIGradient") then
- variant = #desc.Color.Keypoints > 3 and "m" or "n"
- break
- end
- end
- local p = data[variant] or data.r
- local isFly, isRide, slot = false, false, v
- while slot and slot:IsA("GuiObject") and slot.AbsoluteSize.X < 180 do slot = slot.Parent end
- if slot then
- for _, child in ipairs(slot:GetDescendants()) do
- if child:IsA("ImageLabel") and 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
- local val = (isFly and isRide and p.fr) or (isFly and p.f) or (isRide and p.r) or p.np
- if val then
- if v.AbsolutePosition.X < midX then
- myTotal = myTotal + val
- else
- theirTotal = theirTotal + val
- end
- end
- end
- end
- end
- if not anyFound then
- tradeL.Text = 'Trade: <font color="#FFD700">Esperando mascotas...</font>'
- winL.Text = ""
- else
- myTotal = math.floor(myTotal * 100) / 100
- theirTotal = math.floor(theirTotal * 100) / 100
- tradeL.Text = string.format('Tú: <font color="#3CDD64">%s</font> | Rival: <font color="#FFD700">%s</font>', tostring(myTotal), tostring(theirTotal))
- local diff = math.floor((theirTotal - myTotal) * 100) / 100
- if diff > 0.1 then
- winL.Text = string.format('Resultado: <font color="#3CDD64">WIN (+%s)</font>', tostring(diff))
- elseif diff < -0.1 then
- winL.Text = string.format('Resultado: <font color="#FF5050">LOSE (%s)</font>', tostring(diff))
- else
- winL.Text = 'Resultado: <font color="#FFD700">FAIR (Justo)</font>'
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment