Tahatahaqeq

Untitled

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