Tahatahaqeq

Untitled

Jul 25th, 2026
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.34 KB | None | 0 0
  1. local Players = game:GetService('Players')
  2. local UIS = game:GetService('UserInputService')
  3. local RunService = game:GetService('RunService')
  4. local LocalPlayer = Players.LocalPlayer
  5. local PlayerGui = LocalPlayer:WaitForChild('PlayerGui')
  6.  
  7. local C = {
  8. PANEL = Color3.fromRGB(15, 15, 22),
  9. CARD = Color3.fromRGB(25, 25, 35),
  10. ACCENT = Color3.fromRGB(200, 80, 255),
  11. TEXT = Color3.fromRGB(240, 240, 255),
  12. GREEN = Color3.fromRGB(50, 230, 90),
  13. YELLOW = Color3.fromRGB(255, 210, 40),
  14. RED = Color3.fromRGB(255, 60, 60),
  15. MUTED = Color3.fromRGB(130, 130, 150),
  16. WHITE = Color3.new(1, 1, 1),
  17. }
  18.  
  19. local petDB, dbReady = {}, false
  20. local activeSide = "ME"
  21. local myPets, myTotal = {}, 0
  22. local theirPets, theirTotal = {}, 0
  23. local lastAddedKey = ""
  24.  
  25. local function unescape(s)
  26. return (s:gsub('\\"','"'):gsub('\\/','/'):gsub('\\n','\n'):gsub('\\\\','\\'))
  27. end
  28.  
  29. local function getBestValue(obj, prefix)
  30. local np = tonumber(obj:match('"'..prefix..'value %- nopotion"%s*:%s*(%-?[%d%.]+)')) or tonumber(obj:match('"'..prefix..'value"%s*:%s*(%-?[%d%.]+)')) or 0
  31. local r = tonumber(obj:match('"'..prefix..'value %- ride"%s*:%s*(%-?[%d%.]+)')) or 0
  32. local f = tonumber(obj:match('"'..prefix..'value %- fly"%s*:%s*(%-?[%d%.]+)')) or 0
  33. local fr = tonumber(obj:match('"'..prefix..'value %- fly\\u0026ride"%s*:%s*(%-?[%d%.]+)'))
  34. or tonumber(obj:match('"'..prefix..'value %- fly&ride"%s*:%s*(%-?[%d%.]+)'))
  35. or tonumber(obj:match('"'..prefix..'value"%s*:%s*(%-?[%d%.]+)')) or 0
  36. return { np = np, r = r, f = f, fr = fr }
  37. end
  38.  
  39. local function smartFill(p)
  40. if not p then return end
  41. if p.np == 0 and p.fr > 0 then p.np = p.fr end
  42. if p.fr == 0 and p.np > 0 then p.fr = p.np end
  43. if p.np > 0 and p.fr > 0 then
  44. if p.r == 0 then p.r = math.floor((p.np + (p.fr - p.np) * 0.45) * 100) / 100 end
  45. if p.f == 0 then p.f = math.floor((p.np + (p.fr - p.np) * 0.55) * 100) / 100 end
  46. end
  47. end
  48.  
  49. -- Cargar Base de Datos
  50. local reqFn = (syn and syn.request) or (http and http.request) or request
  51. if reqFn then
  52. task.spawn(function()
  53. local res = reqFn({Url = "https://elvebredd.com/adopt-me-calculator", Method = "GET"})
  54. if res and res.Body then
  55. for obj in unescape(res.Body):gmatch("{(.-)}") do
  56. local petName, status = obj:match('"[nN]ame"%s*:%s*"(.-)"'), obj:match('"[sS]tatus"%s*:%s*"(.-)"')
  57. if petName and status == "Ready" then
  58. petName = petName:lower()
  59. petDB[petName] = {
  60. name = petName,
  61. r = getBestValue(obj, "r"),
  62. n = getBestValue(obj, "n"),
  63. m = getBestValue(obj, "m")
  64. }
  65. smartFill(petDB[petName].r); smartFill(petDB[petName].n); smartFill(petDB[petName].m)
  66. end
  67. end
  68. dbReady = true
  69. end
  70. end)
  71. end
  72.  
  73. -- Extrae solo el nombre base sin prefijos
  74. local function cleanPetName(rawName)
  75. local name = rawName:lower()
  76. name = name:gsub("mega neon", ""):gsub("neon", ""):gsub("mfr", ""):gsub("nfr", "")
  77. name = name:gsub("^mr%s+", ""):gsub("%s+mr$", ""):gsub("^mf%s+", ""):gsub("%s+mf$", "")
  78. name = name:gsub("^nr%s+", ""):gsub("%s+nr$", ""):gsub("^nf%s+", ""):gsub("%s+nf$", "")
  79. name = name:gsub("^m%s+", ""):gsub("^n%s+", "")
  80. return name:gsub("^%s+", ""):gsub("%s+$", "")
  81. end
  82.  
  83. local function lookupPet(raw)
  84. local cName = cleanPetName(raw)
  85. if petDB[cName] then return petDB[cName] end
  86.  
  87. local best, bestLen = nil, 0
  88. for k, v in pairs(petDB) do
  89. if (cName == k or cName:find("^" .. k .. "$")) and #k > bestLen then
  90. bestLen = #k; best = v
  91. end
  92. end
  93.  
  94. if not best then
  95. for k, v in pairs(petDB) do
  96. if cName:find(k, 1, true) and #k > bestLen then
  97. bestLen = #k; best = v
  98. end
  99. end
  100. end
  101.  
  102. return best
  103. end
  104.  
  105. -- Limpieza de GUI previa
  106. pcall(function()
  107. local containers = {game.CoreGui, PlayerGui}
  108. if gethui then table.insert(containers, gethui()) end
  109. for _, c in ipairs(containers) do
  110. for _, v in ipairs(c:GetChildren()) do
  111. if v:IsA("ScreenGui") and (v.Name:find("TradeChecker") or v.Name:find("Gigi")) then v:Destroy() end
  112. end
  113. end
  114. end)
  115.  
  116. -- ScreenGui Principal
  117. local screen = Instance.new('ScreenGui', game.CoreGui)
  118. screen.Name = 'Gigi_TradeChecker'
  119. screen.ResetOnSpawn = false
  120.  
  121. -- Panel Principal Centrado
  122. local frame = Instance.new('Frame', screen)
  123. frame.Size = UDim2.new(0, 360, 0, 260)
  124. frame.Position = UDim2.new(0.5, -180, 0.5, -130)
  125. frame.BackgroundColor3 = C.PANEL
  126. frame.BorderSizePixel = 0
  127.  
  128. Instance.new('UICorner', frame).CornerRadius = UDim.new(0, 10)
  129. local uiStroke = Instance.new('UIStroke', frame)
  130. uiStroke.Color, uiStroke.Thickness = C.ACCENT, 2
  131.  
  132. -- Encabezado del Panel
  133. local title = Instance.new('TextLabel', frame)
  134. title.Size = UDim2.new(1, -70, 0, 32)
  135. title.Position = UDim2.new(0, 10, 0, 0)
  136. title.BackgroundTransparency = 1
  137. title.Text = "✨ Gigi value"
  138. title.TextColor3, title.Font, title.TextSize = C.WHITE, Enum.Font.GothamBold, 14
  139. title.TextXAlignment = Enum.TextXAlignment.Left
  140.  
  141. -- Botón Reset (🔄)
  142. local resetBtn = Instance.new('TextButton', frame)
  143. resetBtn.Size, resetBtn.Position = UDim2.new(0, 28, 0, 28), UDim2.new(1, -60, 0, 2)
  144. resetBtn.BackgroundTransparency = 1
  145. resetBtn.Text, resetBtn.TextSize = "🔄", 14
  146.  
  147. -- Botón Cerrar (✕)
  148. local closeBtn = Instance.new('TextButton', frame)
  149. closeBtn.Size, closeBtn.Position = UDim2.new(0, 28, 0, 28), UDim2.new(1, -30, 0, 2)
  150. closeBtn.BackgroundTransparency = 1
  151. closeBtn.Text, closeBtn.TextColor3, closeBtn.Font, closeBtn.TextSize = "✕", C.WHITE, Enum.Font.GothamBold, 14
  152.  
  153. -- Logo Flotante
  154. local openBtn = Instance.new('TextButton', screen)
  155. openBtn.Size, openBtn.Position = UDim2.new(0, 50, 0, 50), UDim2.new(0.05, 0, 0.5, -25)
  156. openBtn.BackgroundColor3, openBtn.Text, openBtn.TextSize, openBtn.Visible = C.PANEL, "✨", 22, false
  157. Instance.new('UICorner', openBtn).CornerRadius = UDim.new(1, 0)
  158. local openStroke = Instance.new('UIStroke', openBtn)
  159. openStroke.Color, openStroke.Thickness = C.ACCENT, 2
  160.  
  161. local function makeDraggable(guiObj)
  162. local dragging, dragStart, startPos
  163. guiObj.InputBegan:Connect(function(input)
  164. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  165. dragging = true; dragStart = input.Position; startPos = guiObj.Position
  166. end
  167. end)
  168. UIS.InputChanged:Connect(function(input)
  169. if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  170. local delta = input.Position - dragStart
  171. guiObj.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  172. end
  173. end)
  174. UIS.InputEnded:Connect(function(input)
  175. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end
  176. end)
  177. end
  178. makeDraggable(openBtn)
  179.  
  180. closeBtn.MouseButton1Click:Connect(function() frame.Visible = false; openBtn.Visible = true end)
  181. openBtn.MouseButton1Click:Connect(function() frame.Visible = true; openBtn.Visible = false end)
  182.  
  183. -- Botones Selector ME y THEM
  184. local meBtn = Instance.new('TextButton', frame)
  185. meBtn.Size, meBtn.Position = UDim2.new(0, 75, 0, 24), UDim2.new(0, 10, 0, 34)
  186. meBtn.BackgroundColor3 = C.GREEN
  187. meBtn.Text = "ME"
  188. meBtn.TextColor3, meBtn.Font, meBtn.TextSize = C.WHITE, Enum.Font.GothamBold, 12
  189. Instance.new('UICorner', meBtn).CornerRadius = UDim.new(0, 5)
  190.  
  191. local themBtn = Instance.new('TextButton', frame)
  192. themBtn.Size, themBtn.Position = UDim2.new(0, 75, 0, 24), UDim2.new(1, -85, 0, 34)
  193. themBtn.BackgroundColor3 = C.CARD
  194. themBtn.Text = "THEM"
  195. themBtn.TextColor3, themBtn.Font, themBtn.TextSize = C.WHITE, Enum.Font.GothamBold, 12
  196. Instance.new('UICorner', themBtn).CornerRadius = UDim.new(0, 5)
  197.  
  198. local statusLbl = Instance.new('TextLabel', frame)
  199. statusLbl.Size, statusLbl.Position = UDim2.new(1, -170, 0, 24), UDim2.new(0, 85, 0, 34)
  200. statusLbl.BackgroundTransparency = 1
  201. statusLbl.Text = "Añadiendo a: ME"
  202. statusLbl.TextColor3, statusLbl.Font, statusLbl.TextSize = C.YELLOW, Enum.Font.Gotham, 11
  203.  
  204. meBtn.MouseButton1Click:Connect(function()
  205. activeSide = "ME"
  206. meBtn.BackgroundColor3 = C.GREEN
  207. themBtn.BackgroundColor3 = C.CARD
  208. statusLbl.Text = "Añadiendo a: ME"
  209. end)
  210.  
  211. themBtn.MouseButton1Click:Connect(function()
  212. activeSide = "THEM"
  213. themBtn.BackgroundColor3 = C.GREEN
  214. meBtn.BackgroundColor3 = C.CARD
  215. statusLbl.Text = "Añadiendo a: THEM"
  216. end)
  217.  
  218. -- Listas
  219. local meScroll = Instance.new('ScrollingFrame', frame)
  220. meScroll.Size, meScroll.Position = UDim2.new(0.46, 0, 0, 135), UDim2.new(0, 10, 0, 65)
  221. meScroll.BackgroundColor3, meScroll.BorderSizePixel = C.CARD, 0
  222. meScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
  223. meScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
  224. Instance.new('UICorner', meScroll).CornerRadius = UDim.new(0, 6)
  225. local meList = Instance.new('UIListLayout', meScroll); meList.Padding = UDim.new(0, 2)
  226.  
  227. local themScroll = Instance.new('ScrollingFrame', frame)
  228. themScroll.Size, themScroll.Position = UDim2.new(0.46, 0, 0, 135), UDim2.new(0.52, 0, 0, 65)
  229. themScroll.BackgroundColor3, themScroll.BorderSizePixel = C.CARD, 0
  230. themScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
  231. themScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
  232. Instance.new('UICorner', themScroll).CornerRadius = UDim.new(0, 6)
  233. local themList = Instance.new('UIListLayout', themScroll); themList.Padding = UDim.new(0, 2)
  234.  
  235. -- Panel Inferior
  236. local resultFrame = Instance.new('Frame', frame)
  237. resultFrame.Size, resultFrame.Position = UDim2.new(1, -20, 0, 48), UDim2.new(0, 10, 1, -54)
  238. resultFrame.BackgroundColor3 = C.CARD
  239. Instance.new('UICorner', resultFrame).CornerRadius = UDim.new(0, 6)
  240.  
  241. local totalsLbl = Instance.new('TextLabel', resultFrame)
  242. totalsLbl.Size, totalsLbl.Position = UDim2.new(1, 0, 0, 22), UDim2.new(0, 0, 0, 2)
  243. totalsLbl.BackgroundTransparency = 1
  244. totalsLbl.Text = "Tú: 0 | Rival: 0"
  245. totalsLbl.TextColor3, totalsLbl.Font, totalsLbl.TextSize = C.WHITE, Enum.Font.GothamMedium, 12
  246. totalsLbl.RichText = true
  247.  
  248. local outcomeLbl = Instance.new('TextLabel', resultFrame)
  249. outcomeLbl.Size, outcomeLbl.Position = UDim2.new(1, 0, 0, 20), UDim2.new(0, 0, 0, 24)
  250. outcomeLbl.BackgroundTransparency = 1
  251. outcomeLbl.Text = "Esperando mascotas..."
  252. outcomeLbl.TextColor3, outcomeLbl.Font, outcomeLbl.TextSize = C.YELLOW, Enum.Font.GothamBold, 12
  253. outcomeLbl.RichText = true
  254.  
  255. local updateUI
  256.  
  257. updateUI = function()
  258. myTotal, theirTotal = 0, 0
  259.  
  260. for _, child in ipairs(meScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
  261. for _, child in ipairs(themScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
  262.  
  263. for index, pet in ipairs(myPets) do
  264. myTotal = myTotal + pet.val
  265. local btn = Instance.new('TextButton', meScroll)
  266. btn.Size = UDim2.new(1, 0, 0, 20)
  267. btn.BackgroundTransparency = 1
  268. btn.Text = string.format(" ✕ %s (<font color=\"#3CDD64\">%s</font>)", pet.name, tostring(pet.val))
  269. btn.TextColor3, btn.Font, btn.TextSize, btn.RichText, btn.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
  270.  
  271. btn.MouseButton1Click:Connect(function()
  272. table.remove(myPets, index)
  273. updateUI()
  274. end)
  275. end
  276.  
  277. for index, pet in ipairs(theirPets) do
  278. theirTotal = theirTotal + pet.val
  279. local btn = Instance.new('TextButton', themScroll)
  280. btn.Size = UDim2.new(1, 0, 0, 20)
  281. btn.BackgroundTransparency = 1
  282. btn.Text = string.format(" ✕ %s (<font color=\"#FFD700\">%s</font>)", pet.name, tostring(pet.val))
  283. btn.TextColor3, btn.Font, btn.TextSize, btn.RichText, btn.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
  284.  
  285. btn.MouseButton1Click:Connect(function()
  286. table.remove(theirPets, index)
  287. updateUI()
  288. end)
  289. end
  290.  
  291. myTotal = math.floor(myTotal * 100) / 100
  292. theirTotal = math.floor(theirTotal * 100) / 100
  293.  
  294. totalsLbl.Text = string.format('Tú (ME): <font color="#3CDD64">%s</font> | Rival (THEM): <font color="#FFD700">%s</font>', tostring(myTotal), tostring(theirTotal))
  295.  
  296. local diff = math.floor((theirTotal - myTotal) * 100) / 100
  297. if #myPets == 0 and #theirPets == 0 then
  298. outcomeLbl.Text = "Toca mascotas para registrarlas."
  299. elseif diff > 0.1 then
  300. outcomeLbl.Text = string.format('Resultado: <font color="#3CDD64">WIN (+%s)</font>', tostring(diff))
  301. elseif diff < -0.1 then
  302. outcomeLbl.Text = string.format('Resultado: <font color="#FF5050">LOSE (%s)</font>', tostring(diff))
  303. else
  304. outcomeLbl.Text = 'Resultado: <font color="#FFD700">FAIR (Justo)</font>'
  305. end
  306. end
  307.  
  308. resetBtn.MouseButton1Click:Connect(function()
  309. myPets, theirPets = {}, {}
  310. lastAddedKey = ""
  311. updateUI()
  312. end)
  313.  
  314. -- Escaneo de pociones e iconos
  315. local function getHoveredPotionsFallback(tooltipObj)
  316. local mouse = UIS:GetMouseLocation()
  317. local mx, my = mouse.X, mouse.Y
  318. local isFly, isRide = false, false
  319.  
  320. if tooltipObj then
  321. for _, desc in ipairs(tooltipObj:GetDescendants()) do
  322. if desc:IsA("ImageLabel") or desc:IsA("ImageButton") then
  323. local n = desc.Name:lower()
  324. if (n == "flyable" or n == "fly") and desc.Visible and desc.ImageTransparency < 0.9 and desc.Image ~= "" then isFly = true end
  325. if (n == "rideable" or n == "ride") and desc.Visible and desc.ImageTransparency < 0.9 and desc.Image ~= "" then isRide = true end
  326. end
  327. end
  328. end
  329.  
  330. for _, appName in ipairs({"TradeApp", "InventoryApp"}) do
  331. local app = PlayerGui:FindFirstChild(appName)
  332. if app then
  333. for _, child in ipairs(app:GetDescendants()) do
  334. if child:IsA("ImageLabel") and (child.Name:lower() == "flyable" or child.Name:lower() == "rideable") then
  335. local slot = child.Parent
  336. local isHovered, depth = false, 0
  337. while slot and slot:IsA("GuiObject") and depth < 8 do
  338. local px, py = slot.AbsolutePosition.X, slot.AbsolutePosition.Y
  339. local pw, ph = slot.AbsoluteSize.X, slot.AbsoluteSize.Y
  340. if pw < 180 and ph < 180 then
  341. if (mx >= px and mx <= px + pw and my >= py and my <= py + ph) or
  342. (mx >= px and mx <= px + pw and (my - 36) >= py and (my - 36) <= py + ph) then
  343. isHovered = true; break
  344. end
  345. end
  346. slot = slot.Parent; depth = depth + 1
  347. end
  348. if isHovered then
  349. if child.Visible and child.ImageTransparency < 0.9 and child.Image ~= "" then
  350. if child.Name:lower() == "flyable" then isFly = true end
  351. if child.Name:lower() == "rideable" then isRide = true end
  352. end
  353. end
  354. end
  355. end
  356. end
  357. end
  358. return isFly, isRide
  359. end
  360.  
  361. RunService.RenderStepped:Connect(function()
  362. if not dbReady then return end
  363.  
  364. local tooltip = nil
  365. for _, appName in ipairs({'TradeApp', 'InventoryApp'}) do
  366. local app = PlayerGui:FindFirstChild(appName)
  367. if app then
  368. for _, c in ipairs(app:GetChildren()) do
  369. if c.Name == 'Tooltip' and c.Visible and c.AbsolutePosition.X > -4000 then tooltip = c; break end
  370. end
  371. end
  372. if tooltip then break end
  373. end
  374.  
  375. if tooltip then
  376. local variant, bestMatch, fullTooltipText = "r", "", ""
  377.  
  378. -- Acumulamos todo el texto visible del tooltip para buscar la variante exacta
  379. for _, lbl in ipairs(tooltip:GetDescendants()) do
  380. if lbl:IsA("TextLabel") and lbl.Visible then
  381. fullTooltipText = fullTooltipText .. " " .. lbl.Text:lower()
  382. local data = lookupPet(lbl.Text)
  383. if data then bestMatch = data.name end
  384. end
  385. end
  386.  
  387. -- Detección rigurosa de variante (Mega > Neón > Normal)
  388. if fullTooltipText:find("mega neon") or fullTooltipText:find("mega") or fullTooltipText:find("mfr") then
  389. variant = "m"
  390. elseif fullTooltipText:find("neon") or fullTooltipText:find("nfr") then
  391. variant = "n"
  392. else
  393. -- Verificación adicional por degradado UIGradient del marco neón/mega
  394. for _, desc in ipairs(tooltip:GetDescendants()) do
  395. if desc:IsA("UIGradient") then
  396. if #desc.Color.Keypoints > 3 then
  397. variant = "m"
  398. else
  399. variant = "n"
  400. end
  401. break
  402. end
  403. end
  404. end
  405.  
  406. if bestMatch ~= "" then
  407. local isFly, isRide = getHoveredPotionsFallback(tooltip)
  408. local currentKey = activeSide .. "_" .. bestMatch .. "_" .. variant .. "_" .. tostring(isFly) .. "_" .. tostring(isRide)
  409.  
  410. if currentKey ~= lastAddedKey then
  411. lastAddedKey = currentKey
  412. local data = petDB[bestMatch:lower()]
  413. if data then
  414. -- Seleccionar objeto de datos según la variante (m = mega, n = neon, r = regular)
  415. local p = data[variant] or data.r
  416. local val = 0
  417.  
  418. -- Obtención estricta del valor según las pociones detectadas
  419. if isFly and isRide then
  420. val = p.fr
  421. elseif isFly then
  422. val = p.f
  423. elseif isRide then
  424. val = p.r
  425. else
  426. val = p.np
  427. end
  428.  
  429. -- Si no hay valor específico de la poción, usar FR o NP como fallback
  430. if (not val or val == 0) then
  431. if (isFly or isRide) and p.fr > 0 then
  432. val = p.fr
  433. else
  434. val = p.np
  435. end
  436. end
  437.  
  438. local pre = (variant == "m" and "M " or (variant == "n" and "N " or ""))
  439. local potStr = (isFly and isRide and " FR") or (isFly and " F") or (isRide and " R") or " No Pot"
  440. local fullName = pre .. bestMatch:sub(1,1):upper() .. bestMatch:sub(2) .. potStr
  441.  
  442. if activeSide == "ME" then
  443. table.insert(myPets, {name = fullName, val = val or 0})
  444. else
  445. table.insert(theirPets, {name = fullName, val = val or 0})
  446. end
  447. updateUI()
  448. end
  449. end
  450. end
  451. else
  452. lastAddedKey = ""
  453. end
  454. end)
  455.  
Advertisement
Add Comment
Please, Sign In to add comment