Tahatahaqeq

Untitled

Jul 25th, 2026
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.51 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 ARRAGTRABLE)
  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) -- Centrado en pantalla
  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 (SÓLO ESTE ELEMENTO ES 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 Añadidas
  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. -- Actualización del UI
  245. local function updateUI()
  246. myTotal, theirTotal = 0, 0
  247.  
  248. for _, child in ipairs(meScroll:GetChildren()) do if child:IsA("TextLabel") then child:Destroy() end end
  249. for _, child in ipairs(themScroll:GetChildren()) do if child:IsA("TextLabel") then child:Destroy() end end
  250.  
  251. for _, pet in ipairs(myPets) do
  252. myTotal = myTotal + pet.val
  253. local lbl = Instance.new('TextLabel', meScroll)
  254. lbl.Size = UDim2.new(1, 0, 0, 18)
  255. lbl.BackgroundTransparency = 1
  256. lbl.Text = string.format(" %s (<font color=\"#3CDD64\">%s</font>)", pet.name, tostring(pet.val))
  257. lbl.TextColor3, lbl.Font, lbl.TextSize, lbl.RichText, lbl.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
  258. end
  259.  
  260. for _, pet in ipairs(theirPets) do
  261. theirTotal = theirTotal + pet.val
  262. local lbl = Instance.new('TextLabel', themScroll)
  263. lbl.Size = UDim2.new(1, 0, 0, 18)
  264. lbl.BackgroundTransparency = 1
  265. lbl.Text = string.format(" %s (<font color=\"#FFD700\">%s</font>)", pet.name, tostring(pet.val))
  266. lbl.TextColor3, lbl.Font, lbl.TextSize, lbl.RichText, lbl.TextXAlignment = C.TEXT, Enum.Font.Gotham, 10, true, Enum.TextXAlignment.Left
  267. end
  268.  
  269. myTotal = math.floor(myTotal * 100) / 100
  270. theirTotal = math.floor(theirTotal * 100) / 100
  271.  
  272. totalsLbl.Text = string.format('Tú (ME): <font color="#3CDD64">%s</font> | Rival (THEM): <font color="#FFD700">%s</font>', tostring(myTotal), tostring(theirTotal))
  273.  
  274. local diff = math.floor((theirTotal - myTotal) * 100) / 100
  275. if #myPets == 0 and #theirPets == 0 then
  276. outcomeLbl.Text = "Toca mascotas para registrarlas."
  277. elseif diff > 0.1 then
  278. outcomeLbl.Text = string.format('Resultado: <font color="#3CDD64">WIN (+%s)</font>', tostring(diff))
  279. elseif diff < -0.1 then
  280. outcomeLbl.Text = string.format('Resultado: <font color="#FF5050">LOSE (%s)</font>', tostring(diff))
  281. else
  282. outcomeLbl.Text = 'Resultado: <font color="#FFD700">FAIR (Justo)</font>'
  283. end
  284. end
  285.  
  286. resetBtn.MouseButton1Click:Connect(function()
  287. myPets, theirPets = {}, {}
  288. lastAddedKey = ""
  289. updateUI()
  290. end)
  291.  
  292. -- Detector de mascotas activado al mantener presionada la pantalla/pet
  293. local function getHoveredPotionsFallback()
  294. local mouse = UIS:GetMouseLocation()
  295. local mx, my = mouse.X, mouse.Y
  296. local isFly, isRide, foundSlot = false, false, false
  297.  
  298. for _, appName in ipairs({"TradeApp", "InventoryApp"}) do
  299. local app = PlayerGui:FindFirstChild(appName)
  300. if app then
  301. for _, child in ipairs(app:GetDescendants()) do
  302. if child:IsA("ImageLabel") and (child.Name:lower() == "flyable" or child.Name:lower() == "rideable") then
  303. local slot = child.Parent
  304. local isHovered, depth = false, 0
  305. while slot and slot:IsA("GuiObject") and depth < 8 do
  306. local px, py = slot.AbsolutePosition.X, slot.AbsolutePosition.Y
  307. local pw, ph = slot.AbsoluteSize.X, slot.AbsoluteSize.Y
  308. if pw < 180 and ph < 180 then
  309. if (mx >= px and mx <= px + pw and my >= py and my <= py + ph) or
  310. (mx >= px and mx <= px + pw and (my - 36) >= py and (my - 36) <= py + ph) then
  311. isHovered = true; break
  312. end
  313. end
  314. slot = slot.Parent; depth = depth + 1
  315. end
  316. if isHovered then
  317. foundSlot = true
  318. if child.Visible and child.ImageTransparency < 0.9 and child.Image ~= "" then
  319. if child.Name:lower() == "flyable" then isFly = true end
  320. if child.Name:lower() == "rideable" then isRide = true end
  321. end
  322. end
  323. end
  324. end
  325. end
  326. if foundSlot then break end
  327. end
  328. return isFly, isRide
  329. end
  330.  
  331. RunService.RenderStepped:Connect(function()
  332. if not dbReady or not frame.Visible then return end
  333.  
  334. local tooltip = nil
  335. for _, appName in ipairs({'TradeApp', 'InventoryApp'}) do
  336. local app = PlayerGui:FindFirstChild(appName)
  337. if app then
  338. for _, c in ipairs(app:GetChildren()) do
  339. if c.Name == 'Tooltip' and c.Visible and c.AbsolutePosition.X > -4000 then tooltip = c; break end
  340. end
  341. end
  342. if tooltip then break end
  343. end
  344.  
  345. if tooltip then
  346. local variant, bestMatch, rawText = "r", "", ""
  347. local headerLbl = tooltip:FindFirstChild('Header', true)
  348. if headerLbl then rawText = headerLbl.Text end
  349.  
  350. for _, lbl in ipairs(tooltip:GetDescendants()) do
  351. if lbl:IsA("TextLabel") and lbl.Visible then
  352. local t = lbl.Text:lower()
  353. if t:find("mega neon") or t:find("mfr") then variant = "m"
  354. elseif (t:find("neon") or t:find("nfr")) and variant ~= "m" then variant = "n" end
  355. local data, v = lookupPet(lbl.Text)
  356. if data then
  357. bestMatch = data.name
  358. if v == "m" then variant = "m" elseif v == "n" and variant ~= "m" then variant = "n" end
  359. end
  360. end
  361. end
  362.  
  363. if bestMatch == "" and rawText ~= "" then
  364. local data, v = lookupPet(rawText)
  365. if data then bestMatch = data.name; if v == "m" then variant = "m" elseif v == "n" and variant ~= "m" then variant = "n" end end
  366. end
  367.  
  368. if bestMatch ~= "" then
  369. local isFly, isRide = getHoveredPotionsFallback()
  370. local currentKey = activeSide .. "_" .. bestMatch .. "_" .. variant .. "_" .. tostring(isFly) .. "_" .. tostring(isRide)
  371.  
  372. if currentKey ~= lastAddedKey then
  373. lastAddedKey = currentKey
  374. local data = petDB[bestMatch:lower()]
  375. if data then
  376. local p = data[variant] or data.r
  377. local val = (isFly and isRide and p.fr) or (isFly and p.f) or (isRide and p.r) or p.np
  378. local pre = variant == "n" and "N " or (variant == "m" and "M " or "")
  379. local fullName = pre .. bestMatch:sub(1,1):upper()..bestMatch:sub(2)
  380.  
  381. if activeSide == "ME" then
  382. table.insert(myPets, {name = fullName, val = val or 0})
  383. else
  384. table.insert(theirPets, {name = fullName, val = val or 0})
  385. end
  386. updateUI()
  387. end
  388. end
  389. end
  390. else
  391. lastAddedKey = ""
  392. end
  393. end)
  394.  
Advertisement
Add Comment
Please, Sign In to add comment