Tahatahaqeq

Untitled

Jul 25th, 2026
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.15 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. -- Limpiador exacto de variantes sin corromper nombres de pets (como Otter)
  74. local function parsePetVariant(rawName)
  75. local name = rawName:lower()
  76. local variant = "r"
  77.  
  78. 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") or name:match("^m%s") then
  79. variant = "m"
  80. name = name:gsub("mega neon", ""):gsub("mfr", ""):gsub("^mr%s+", ""):gsub("%s+mr$", ""):gsub("^m%s+", "")
  81. 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") or name:match("^n%s") then
  82. variant = "n"
  83. name = name:gsub("neon", ""):gsub("nfr", ""):gsub("^nr%s+", ""):gsub("%s+nr$", ""):gsub("^n%s+", "")
  84. end
  85.  
  86. return name:gsub("^%s+", ""):gsub("%s+$", ""), variant
  87. end
  88.  
  89. local function lookupPet(raw)
  90. local cName, cVar = parsePetVariant(raw)
  91. if petDB[cName] then return petDB[cName], cVar end
  92.  
  93. local best, bestLen = nil, 0
  94. for k, v in pairs(petDB) do
  95. if (cName == k or cName:find("^" .. k .. "$")) and #k > bestLen then
  96. bestLen = #k; best = v
  97. end
  98. end
  99.  
  100. if not best then
  101. for k, v in pairs(petDB) do
  102. if cName:find(k, 1, true) and #k > bestLen then
  103. bestLen = #k; best = v
  104. end
  105. end
  106. end
  107.  
  108. return best, cVar
  109. end
  110.  
  111. -- Limpieza
  112. pcall(function()
  113. local containers = {game.CoreGui, PlayerGui}
  114. if gethui then table.insert(containers, gethui()) end
  115. for _, c in ipairs(containers) do
  116. for _, v in ipairs(c:GetChildren()) do
  117. if v:IsA("ScreenGui") and v.Name:find("TradeChecker") then v:Destroy() end
  118. end
  119. end
  120. end)
  121.  
  122. -- ScreenGui Principal
  123. local screen = Instance.new('ScreenGui', game.CoreGui)
  124. screen.Name = 'ENI_TradeChecker'
  125. screen.ResetOnSpawn = false
  126.  
  127. -- Panel Principal Centrado (NO DRAGGEABLE)
  128. local frame = Instance.new('Frame', screen)
  129. frame.Size = UDim2.new(0, 360, 0, 260)
  130. frame.Position = UDim2.new(0.5, -180, 0.5, -130)
  131. frame.BackgroundColor3 = C.PANEL
  132. frame.BorderSizePixel = 0
  133.  
  134. Instance.new('UICorner', frame).CornerRadius = UDim.new(0, 10)
  135. local uiStroke = Instance.new('UIStroke', frame)
  136. uiStroke.Color, uiStroke.Thickness = C.ACCENT, 2
  137.  
  138. -- Encabezado del Panel
  139. local title = Instance.new('TextLabel', frame)
  140. title.Size = UDim2.new(1, -70, 0, 32)
  141. title.Position = UDim2.new(0, 10, 0, 0)
  142. title.BackgroundTransparency = 1
  143. title.Text = "✨ ENI | Calculator Trade"
  144. title.TextColor3, title.Font, title.TextSize = C.WHITE, Enum.Font.GothamBold, 13
  145. title.TextXAlignment = Enum.TextXAlignment.Left
  146.  
  147. -- Botón Reset (🔄)
  148. local resetBtn = Instance.new('TextButton', frame)
  149. resetBtn.Size, resetBtn.Position = UDim2.new(0, 28, 0, 28), UDim2.new(1, -60, 0, 2)
  150. resetBtn.BackgroundTransparency = 1
  151. resetBtn.Text, resetBtn.TextSize = "🔄", 14
  152.  
  153. -- Botón Cerrar (✕)
  154. local closeBtn = Instance.new('TextButton', frame)
  155. closeBtn.Size, closeBtn.Position = UDim2.new(0, 28, 0, 28), UDim2.new(1, -30, 0, 2)
  156. closeBtn.BackgroundTransparency = 1
  157. closeBtn.Text, closeBtn.TextColor3, closeBtn.Font, closeBtn.TextSize = "✕", C.WHITE, Enum.Font.GothamBold, 14
  158.  
  159. -- Logo Flotante (DRAGGEABLE)
  160. local openBtn = Instance.new('TextButton', screen)
  161. openBtn.Size, openBtn.Position = UDim2.new(0, 50, 0, 50), UDim2.new(0.05, 0, 0.5, -25)
  162. openBtn.BackgroundColor3, openBtn.Text, openBtn.TextSize, openBtn.Visible = C.PANEL, "✨", 22, false
  163. Instance.new('UICorner', openBtn).CornerRadius = UDim.new(1, 0)
  164. local openStroke = Instance.new('UIStroke', openBtn)
  165. openStroke.Color, openStroke.Thickness = C.ACCENT, 2
  166.  
  167. local function makeDraggable(guiObj)
  168. local dragging, dragStart, startPos
  169. guiObj.InputBegan:Connect(function(input)
  170. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  171. dragging = true; dragStart = input.Position; startPos = guiObj.Position
  172. end
  173. end)
  174. UIS.InputChanged:Connect(function(input)
  175. if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  176. local delta = input.Position - dragStart
  177. guiObj.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  178. end
  179. end)
  180. UIS.InputEnded:Connect(function(input)
  181. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end
  182. end)
  183. end
  184. makeDraggable(openBtn)
  185.  
  186. closeBtn.MouseButton1Click:Connect(function() frame.Visible = false; openBtn.Visible = true end)
  187. openBtn.MouseButton1Click:Connect(function() frame.Visible = true; openBtn.Visible = false end)
  188.  
  189. -- Botones Selector ME y THEM
  190. local meBtn = Instance.new('TextButton', frame)
  191. meBtn.Size, meBtn.Position = UDim2.new(0, 75, 0, 24), UDim2.new(0, 10, 0, 34)
  192. meBtn.BackgroundColor3 = C.GREEN
  193. meBtn.Text = "ME"
  194. meBtn.TextColor3, meBtn.Font, meBtn.TextSize = C.WHITE, Enum.Font.GothamBold, 12
  195. Instance.new('UICorner', meBtn).CornerRadius = UDim.new(0, 5)
  196.  
  197. local themBtn = Instance.new('TextButton', frame)
  198. themBtn.Size, themBtn.Position = UDim2.new(0, 75, 0, 24), UDim2.new(1, -85, 0, 34)
  199. themBtn.BackgroundColor3 = C.CARD
  200. themBtn.Text = "THEM"
  201. themBtn.TextColor3, themBtn.Font, themBtn.TextSize = C.WHITE, Enum.Font.GothamBold, 12
  202. Instance.new('UICorner', themBtn).CornerRadius = UDim.new(0, 5)
  203.  
  204. local statusLbl = Instance.new('TextLabel', frame)
  205. statusLbl.Size, statusLbl.Position = UDim2.new(1, -170, 0, 24), UDim2.new(0, 85, 0, 34)
  206. statusLbl.BackgroundTransparency = 1
  207. statusLbl.Text = "Añadiendo a: ME"
  208. statusLbl.TextColor3, statusLbl.Font, statusLbl.TextSize = C.YELLOW, Enum.Font.Gotham, 11
  209.  
  210. meBtn.MouseButton1Click:Connect(function()
  211. activeSide = "ME"
  212. meBtn.BackgroundColor3 = C.GREEN
  213. themBtn.BackgroundColor3 = C.CARD
  214. statusLbl.Text = "Añadiendo a: ME"
  215. end)
  216.  
  217. themBtn.MouseButton1Click:Connect(function()
  218. activeSide = "THEM"
  219. themBtn.BackgroundColor3 = C.GREEN
  220. meBtn.BackgroundColor3 = C.CARD
  221. statusLbl.Text = "Añadiendo a: THEM"
  222. end)
  223.  
  224. -- Listas
  225. local meScroll = Instance.new('ScrollingFrame', frame)
  226. meScroll.Size, meScroll.Position = UDim2.new(0.46, 0, 0, 135), UDim2.new(0, 10, 0, 65)
  227. meScroll.BackgroundColor3, meScroll.BorderSizePixel = C.CARD, 0
  228. meScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
  229. meScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
  230. Instance.new('UICorner', meScroll).CornerRadius = UDim.new(0, 6)
  231. local meList = Instance.new('UIListLayout', meScroll); meList.Padding = UDim.new(0, 2)
  232.  
  233. local themScroll = Instance.new('ScrollingFrame', frame)
  234. themScroll.Size, themScroll.Position = UDim2.new(0.46, 0, 0, 135), UDim2.new(0.52, 0, 0, 65)
  235. themScroll.BackgroundColor3, themScroll.BorderSizePixel = C.CARD, 0
  236. themScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
  237. themScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
  238. Instance.new('UICorner', themScroll).CornerRadius = UDim.new(0, 6)
  239. local themList = Instance.new('UIListLayout', themScroll); themList.Padding = UDim.new(0, 2)
  240.  
  241. -- Panel Inferior
  242. local resultFrame = Instance.new('Frame', frame)
  243. resultFrame.Size, resultFrame.Position = UDim2.new(1, -20, 0, 48), UDim2.new(0, 10, 1, -54)
  244. resultFrame.BackgroundColor3 = C.CARD
  245. Instance.new('UICorner', resultFrame).CornerRadius = UDim.new(0, 6)
  246.  
  247. local totalsLbl = Instance.new('TextLabel', resultFrame)
  248. totalsLbl.Size, totalsLbl.Position = UDim2.new(1, 0, 0, 22), UDim2.new(0, 0, 0, 2)
  249. totalsLbl.BackgroundTransparency = 1
  250. totalsLbl.Text = "Tú: 0 | Rival: 0"
  251. totalsLbl.TextColor3, totalsLbl.Font, totalsLbl.TextSize = C.WHITE, Enum.Font.GothamMedium, 12
  252. totalsLbl.RichText = true
  253.  
  254. local outcomeLbl = Instance.new('TextLabel', resultFrame)
  255. outcomeLbl.Size, outcomeLbl.Position = UDim2.new(1, 0, 0, 20), UDim2.new(0, 0, 0, 24)
  256. outcomeLbl.BackgroundTransparency = 1
  257. outcomeLbl.Text = "Esperando mascotas..."
  258. outcomeLbl.TextColor3, outcomeLbl.Font, outcomeLbl.TextSize = C.YELLOW, Enum.Font.GothamBold, 12
  259. outcomeLbl.RichText = true
  260.  
  261. local updateUI
  262.  
  263. updateUI = function()
  264. myTotal, theirTotal = 0, 0
  265.  
  266. for _, child in ipairs(meScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
  267. for _, child in ipairs(themScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
  268.  
  269. for index, pet in ipairs(myPets) do
  270. myTotal = myTotal + pet.val
  271. local btn = Instance.new('TextButton', meScroll)
  272. btn.Size = UDim2.new(1, 0, 0, 20)
  273. btn.BackgroundTransparency = 1
  274. btn.Text = string.format(" ✕ %s (<font color=\"#3CDD64\">%s</font>)", pet.name, tostring(pet.val))
  275. btn.TextColor3, btn.Font, btn.TextSize, btn.RichText, btn.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
  276.  
  277. btn.MouseButton1Click:Connect(function()
  278. table.remove(myPets, index)
  279. updateUI()
  280. end)
  281. end
  282.  
  283. for index, pet in ipairs(theirPets) do
  284. theirTotal = theirTotal + pet.val
  285. local btn = Instance.new('TextButton', themScroll)
  286. btn.Size = UDim2.new(1, 0, 0, 20)
  287. btn.BackgroundTransparency = 1
  288. btn.Text = string.format(" ✕ %s (<font color=\"#FFD700\">%s</font>)", pet.name, tostring(pet.val))
  289. btn.TextColor3, btn.Font, btn.TextSize, btn.RichText, btn.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
  290.  
  291. btn.MouseButton1Click:Connect(function()
  292. table.remove(theirPets, index)
  293. updateUI()
  294. end)
  295. end
  296.  
  297. myTotal = math.floor(myTotal * 100) / 100
  298. theirTotal = math.floor(theirTotal * 100) / 100
  299.  
  300. totalsLbl.Text = string.format('Tú (ME): <font color="#3CDD64">%s</font> | Rival (THEM): <font color="#FFD700">%s</font>', tostring(myTotal), tostring(theirTotal))
  301.  
  302. local diff = math.floor((theirTotal - myTotal) * 100) / 100
  303. if #myPets == 0 and #theirPets == 0 then
  304. outcomeLbl.Text = "Toca mascotas para registrarlas."
  305. elseif diff > 0.1 then
  306. outcomeLbl.Text = string.format('Resultado: <font color="#3CDD64">WIN (+%s)</font>', tostring(diff))
  307. elseif diff < -0.1 then
  308. outcomeLbl.Text = string.format('Resultado: <font color="#FF5050">LOSE (%s)</font>', tostring(diff))
  309. else
  310. outcomeLbl.Text = 'Resultado: <font color="#FFD700">FAIR (Justo)</font>'
  311. end
  312. end
  313.  
  314. resetBtn.MouseButton1Click:Connect(function()
  315. myPets, theirPets = {}, {}
  316. lastAddedKey = ""
  317. updateUI()
  318. end)
  319.  
  320. local function getHoveredPotionsFallback()
  321. local mouse = UIS:GetMouseLocation()
  322. local mx, my = mouse.X, mouse.Y
  323. local isFly, isRide, foundSlot = false, false, false
  324.  
  325. for _, appName in ipairs({"TradeApp", "InventoryApp"}) do
  326. local app = PlayerGui:FindFirstChild(appName)
  327. if app then
  328. for _, child in ipairs(app:GetDescendants()) do
  329. if child:IsA("ImageLabel") and (child.Name:lower() == "flyable" or child.Name:lower() == "rideable") then
  330. local slot = child.Parent
  331. local isHovered, depth = false, 0
  332. while slot and slot:IsA("GuiObject") and depth < 8 do
  333. local px, py = slot.AbsolutePosition.X, slot.AbsolutePosition.Y
  334. local pw, ph = slot.AbsoluteSize.X, slot.AbsoluteSize.Y
  335. if pw < 180 and ph < 180 then
  336. if (mx >= px and mx <= px + pw and my >= py and my <= py + ph) or
  337. (mx >= px and mx <= px + pw and (my - 36) >= py and (my - 36) <= py + ph) then
  338. isHovered = true; break
  339. end
  340. end
  341. slot = slot.Parent; depth = depth + 1
  342. end
  343. if isHovered then
  344. foundSlot = true
  345. if child.Visible and child.ImageTransparency < 0.9 and child.Image ~= "" then
  346. if child.Name:lower() == "flyable" then isFly = true end
  347. if child.Name:lower() == "rideable" then isRide = true end
  348. end
  349. end
  350. end
  351. end
  352. end
  353. if foundSlot then break end
  354. end
  355. return isFly, isRide
  356. end
  357.  
  358. RunService.RenderStepped:Connect(function()
  359. if not dbReady then return end
  360.  
  361. local tooltip = nil
  362. for _, appName in ipairs({'TradeApp', 'InventoryApp'}) do
  363. local app = PlayerGui:FindFirstChild(appName)
  364. if app then
  365. for _, c in ipairs(app:GetChildren()) do
  366. if c.Name == 'Tooltip' and c.Visible and c.AbsolutePosition.X > -4000 then tooltip = c; break end
  367. end
  368. end
  369. if tooltip then break end
  370. end
  371.  
  372. if tooltip then
  373. local variant, bestMatch, rawText = "r", "", ""
  374. local headerLbl = tooltip:FindFirstChild('Header', true)
  375. if headerLbl then rawText = headerLbl.Text end
  376.  
  377. for _, lbl in ipairs(tooltip:GetDescendants()) do
  378. if lbl:IsA("TextLabel") and lbl.Visible then
  379. local t = lbl.Text:lower()
  380. if t:find("mega neon") or t:find("mfr") then variant = "m"
  381. elseif (t:find("neon") or t:find("nfr")) and variant ~= "m" then variant = "n" end
  382. local data, v = lookupPet(lbl.Text)
  383. if data then
  384. bestMatch = data.name
  385. if v == "m" then variant = "m" elseif v == "n" and variant ~= "m" then variant = "n" end
  386. end
  387. end
  388. end
  389.  
  390. if bestMatch == "" and rawText ~= "" then
  391. local data, v = lookupPet(rawText)
  392. if data then bestMatch = data.name; if v == "m" then variant = "m" elseif v == "n" and variant ~= "m" then variant = "n" end end
  393. end
  394.  
  395. if bestMatch ~= "" then
  396. local isFly, isRide = getHoveredPotionsFallback()
  397. local currentKey = activeSide .. "_" .. bestMatch .. "_" .. variant .. "_" .. tostring(isFly) .. "_" .. tostring(isRide)
  398.  
  399. if currentKey ~= lastAddedKey then
  400. lastAddedKey = currentKey
  401. local data = petDB[bestMatch:lower()]
  402. if data then
  403. local p = data[variant] or data.r
  404. local val = (isFly and isRide and p.fr) or (isFly and p.f) or (isRide and p.r) or p.np
  405. if (not val or val == 0) and p.fr > 0 then val = p.fr end
  406.  
  407. local pre = variant == "n" and "N " or (variant == "m" and "M " or "")
  408. local fullName = pre .. bestMatch:sub(1,1):upper()..bestMatch:sub(2)
  409.  
  410. if activeSide == "ME" then
  411. table.insert(myPets, {name = fullName, val = val or 0})
  412. else
  413. table.insert(theirPets, {name = fullName, val = val or 0})
  414. end
  415. updateUI()
  416. end
  417. end
  418. end
  419. else
  420. lastAddedKey = ""
  421. end
  422. end)
  423.  
Advertisement
Add Comment
Please, Sign In to add comment