Zyrenscripter

Zyren ai

Mar 13th, 2026
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.60 KB | None | 0 0
  1. -- ============================================================
  2. -- DELTA AI v8 — by : zyren
  3. -- Groq + Claude | Delta Executor | Multi-idioma
  4. -- ============================================================
  5.  
  6. local API_KEY = "PON_TU_API_KEY_AQUI"
  7. local MODEL = "llama-3.3-70b-versatile"
  8. local MAX_TOKENS = 800
  9. local PROVIDER = "groq" -- "groq" o "claude"
  10.  
  11. local GROQ_MODELS = {"llama-3.3-70b-versatile","llama-3.1-8b-instant","mixtral-8x7b-32768","gemma2-9b-it"}
  12. local CLAUDE_MODELS = {"claude-sonnet-4-5","claude-haiku-4-5","claude-opus-4-5"}
  13.  
  14. local httpRequest = (http and http.request) or request or (syn and syn.request)
  15. local Players = game:GetService("Players")
  16. local TweenService = game:GetService("TweenService")
  17. local HttpService = game:GetService("HttpService")
  18. local UserInputService = game:GetService("UserInputService")
  19.  
  20. local LP = Players.LocalPlayer
  21. local PGui = LP:WaitForChild("PlayerGui")
  22. if PGui:FindFirstChild("DeltaAI") then PGui:FindFirstChild("DeltaAI"):Destroy() end
  23.  
  24. local history = {}
  25. local waiting = false
  26. local opened = true
  27.  
  28. -- ============================================================
  29. -- IDIOMAS
  30. -- ============================================================
  31. local LANGS = {
  32. {
  33. code="ES", sys="Eres experto en Lua para Roblox y Delta executor. Si el usuario pide codigo, escribe bloques ```lua ... ```. Codigo compatible con Delta. Responde en espanol corto.",
  34. chooseTitle="ELIGE TU PROVEEDOR DE IA",
  35. groqName="GROQ", groqSub="Gratis - Ultra rapido", groqBadge="GRATIS",
  36. cldName="CLAUDE", cldSub="Mas inteligente - Anthropic", cldBadge="PAGO",
  37. subtitle_groq="ASISTENTE LUA - GROQ", subtitle_claude="ASISTENTE LUA - CLAUDE",
  38. keyLbl_groq="CLAVE API DE GROQ", keyLbl_claude="CLAVE API DE CLAUDE",
  39. keyPH_groq="gsk_...", keyPH_claude="sk-ant-...",
  40. keyDesc_groq="groq.com - Gratis, sin tarjeta", keyDesc_claude="console.anthropic.com",
  41. conBtn="CONECTAR", errMsg="Escribe tu API key", helpBtnTxt="Como obtener la API key?",
  42. statusOn="EN LINEA", statusWait="PENSANDO", clearBtn="CLR", inputPH="Escribe aqui...",
  43. clearMsg="Chat limpiado.",
  44. startMsg_groq="Conectado con Groq! Pideme cualquier script Lua.",
  45. startMsg_claude="Conectado con Claude! Pideme cualquier script Lua.",
  46. errPfx="Error: ", copyBtn="COPIAR", copiedBtn="OK!", execBtn="EXEC",
  47. helpTitle_groq="COMO OBTENER LA API KEY DE GROQ",
  48. helpTitle_claude="COMO OBTENER LA API KEY DE CLAUDE",
  49. helpSteps_groq={"1) Abre groq.com en tu navegador","2) Crea una cuenta gratis (sin tarjeta)","3) Ve a 'API Keys' en el menu lateral","4) Pulsa 'Create API Key'","5) Copia la clave - empieza con gsk_","6) Pegala en el campo de arriba"},
  50. helpSteps_claude={"1) Abre console.anthropic.com","2) Crea una cuenta (requiere tarjeta)","3) Ve a 'API Keys' en el menu","4) Pulsa 'Create Key'","5) Copia la clave - empieza con sk-ant-","6) Pegala en el campo de arriba"},
  51. helpNote_groq="100% gratis. Sin tarjeta de credito.", helpNote_claude="Requiere cuenta de pago en Anthropic.",
  52. backBtn="VOLVER",
  53. },
  54. {
  55. code="EN", sys="You are a Roblox Lua expert for Delta executor. If the user asks for code, write ```lua ... ``` blocks. Delta-compatible. Reply in short English.",
  56. chooseTitle="CHOOSE YOUR AI PROVIDER",
  57. groqName="GROQ", groqSub="Free - Ultra fast", groqBadge="FREE",
  58. cldName="CLAUDE", cldSub="Smarter - By Anthropic", cldBadge="PAID",
  59. subtitle_groq="LUA ASSISTANT - GROQ", subtitle_claude="LUA ASSISTANT - CLAUDE",
  60. keyLbl_groq="GROQ API KEY", keyLbl_claude="CLAUDE API KEY",
  61. keyPH_groq="gsk_...", keyPH_claude="sk-ant-...",
  62. keyDesc_groq="groq.com - Free, no card needed", keyDesc_claude="console.anthropic.com",
  63. conBtn="CONNECT", errMsg="Enter your API key", helpBtnTxt="How to get the API key?",
  64. statusOn="ONLINE", statusWait="THINKING", clearBtn="CLR", inputPH="Type here...",
  65. clearMsg="Chat cleared.",
  66. startMsg_groq="Connected to Groq! Ask me any Lua script.",
  67. startMsg_claude="Connected to Claude! Ask me any Lua script.",
  68. errPfx="Error: ", copyBtn="COPY", copiedBtn="OK!", execBtn="EXEC",
  69. helpTitle_groq="HOW TO GET THE GROQ API KEY",
  70. helpTitle_claude="HOW TO GET THE CLAUDE API KEY",
  71. helpSteps_groq={"1) Open groq.com in your browser","2) Create a free account (no card)","3) Go to 'API Keys' in the sidebar","4) Click 'Create API Key'","5) Copy the key - starts with gsk_","6) Paste it in the field above"},
  72. helpSteps_claude={"1) Open console.anthropic.com","2) Create an account (card required)","3) Go to 'API Keys' in the menu","4) Click 'Create Key'","5) Copy the key - starts with sk-ant-","6) Paste it in the field above"},
  73. helpNote_groq="100% free. No credit card required.", helpNote_claude="Requires a paid Anthropic account.",
  74. backBtn="BACK",
  75. },
  76. {
  77. code="PT", sys="Voce e especialista em Lua para Roblox e Delta executor. Se pedir codigo, escreva blocos ```lua ... ```. Codigo compativel com Delta. Responda em portugues curto.",
  78. chooseTitle="ESCOLHA SEU PROVEDOR DE IA",
  79. groqName="GROQ", groqSub="Gratis - Ultra rapido", groqBadge="GRATIS",
  80. cldName="CLAUDE", cldSub="Mais inteligente - Anthropic", cldBadge="PAGO",
  81. subtitle_groq="ASSISTENTE LUA - GROQ", subtitle_claude="ASSISTENTE LUA - CLAUDE",
  82. keyLbl_groq="CHAVE API GROQ", keyLbl_claude="CHAVE API CLAUDE",
  83. keyPH_groq="gsk_...", keyPH_claude="sk-ant-...",
  84. keyDesc_groq="groq.com - Gratis, sem cartao", keyDesc_claude="console.anthropic.com",
  85. conBtn="CONECTAR", errMsg="Digite sua API key", helpBtnTxt="Como obter a API key?",
  86. statusOn="ON-LINE", statusWait="PENSANDO", clearBtn="CLR", inputPH="Digite aqui...",
  87. clearMsg="Chat limpo.",
  88. startMsg_groq="Conectado ao Groq! Peca qualquer script Lua.",
  89. startMsg_claude="Conectado ao Claude! Peca qualquer script Lua.",
  90. errPfx="Erro: ", copyBtn="COPIAR", copiedBtn="OK!", execBtn="EXEC",
  91. helpTitle_groq="COMO OBTER A API KEY DO GROQ",
  92. helpTitle_claude="COMO OBTER A API KEY DO CLAUDE",
  93. helpSteps_groq={"1) Abra groq.com no navegador","2) Crie uma conta gratuita (sem cartao)","3) Va para 'API Keys' no menu lateral","4) Clique em 'Create API Key'","5) Copie a chave - comeca com gsk_","6) Cole no campo acima"},
  94. helpSteps_claude={"1) Abra console.anthropic.com","2) Crie uma conta (cartao necessario)","3) Va para 'API Keys' no menu","4) Clique em 'Create Key'","5) Copie a chave - comeca com sk-ant-","6) Cole no campo acima"},
  95. helpNote_groq="100% gratuito. Sem cartao de credito.", helpNote_claude="Requer conta paga na Anthropic.",
  96. backBtn="VOLTAR",
  97. },
  98. {
  99. code="FR", sys="Tu es expert Lua pour Roblox et Delta executor. Si code demande, ecris des blocs ```lua ... ```. Code compatible Delta. Reponds en francais court.",
  100. chooseTitle="CHOISIR TON FOURNISSEUR IA",
  101. groqName="GROQ", groqSub="Gratuit - Ultra rapide", groqBadge="GRATUIT",
  102. cldName="CLAUDE", cldSub="Plus intelligent - Anthropic", cldBadge="PAYANT",
  103. subtitle_groq="ASSISTANT LUA - GROQ", subtitle_claude="ASSISTANT LUA - CLAUDE",
  104. keyLbl_groq="CLE API GROQ", keyLbl_claude="CLE API CLAUDE",
  105. keyPH_groq="gsk_...", keyPH_claude="sk-ant-...",
  106. keyDesc_groq="groq.com - Gratuit, sans carte", keyDesc_claude="console.anthropic.com",
  107. conBtn="CONNECTER", errMsg="Entre ta cle API", helpBtnTxt="Comment obtenir la cle API?",
  108. statusOn="EN LIGNE", statusWait="REFLECHI", clearBtn="CLR", inputPH="Ecris ici...",
  109. clearMsg="Chat efface.",
  110. startMsg_groq="Connecte a Groq! Demande un script Lua.",
  111. startMsg_claude="Connecte a Claude! Demande un script Lua.",
  112. errPfx="Erreur: ", copyBtn="COPIER", copiedBtn="OK!", execBtn="EXEC",
  113. helpTitle_groq="OBTENIR LA CLE API GROQ",
  114. helpTitle_claude="OBTENIR LA CLE API CLAUDE",
  115. helpSteps_groq={"1) Ouvre groq.com dans ton navigateur","2) Cree un compte gratuit (sans carte)","3) Va dans 'API Keys' dans le menu","4) Clique sur 'Create API Key'","5) Copie la cle - commence par gsk_","6) Colle-la dans le champ ci-dessus"},
  116. helpSteps_claude={"1) Ouvre console.anthropic.com","2) Cree un compte (carte requise)","3) Va dans 'API Keys' dans le menu","4) Clique sur 'Create Key'","5) Copie la cle - commence par sk-ant-","6) Colle-la dans le champ ci-dessus"},
  117. helpNote_groq="100% gratuit. Sans carte bancaire.", helpNote_claude="Necessite un compte payant Anthropic.",
  118. backBtn="RETOUR",
  119. },
  120. {
  121. code="DE", sys="Du bist Lua-Experte fuer Roblox und Delta executor. Bei Code-Anfragen schreibe ```lua ... ``` Bloecke. Delta-kompatibler Code. Antworte kurz auf Deutsch.",
  122. chooseTitle="KI-ANBIETER WAEHLEN",
  123. groqName="GROQ", groqSub="Kostenlos - Ultra schnell", groqBadge="GRATIS",
  124. cldName="CLAUDE", cldSub="Intelligenter - Anthropic", cldBadge="BEZAHLT",
  125. subtitle_groq="LUA ASSISTENT - GROQ", subtitle_claude="LUA ASSISTENT - CLAUDE",
  126. keyLbl_groq="GROQ API-SCHLUESSEL", keyLbl_claude="CLAUDE API-SCHLUESSEL",
  127. keyPH_groq="gsk_...", keyPH_claude="sk-ant-...",
  128. keyDesc_groq="groq.com - Kostenlos, ohne Karte", keyDesc_claude="console.anthropic.com",
  129. conBtn="VERBINDEN", errMsg="API-Key eingeben", helpBtnTxt="Wie bekomme ich den API-Key?",
  130. statusOn="ONLINE", statusWait="DENKT", clearBtn="CLR", inputPH="Hier tippen...",
  131. clearMsg="Chat geleert.",
  132. startMsg_groq="Mit Groq verbunden! Frage ein Lua-Skript.",
  133. startMsg_claude="Mit Claude verbunden! Frage ein Lua-Skript.",
  134. errPfx="Fehler: ", copyBtn="KOPIEREN", copiedBtn="OK!", execBtn="EXEC",
  135. helpTitle_groq="GROQ API-KEY ERHALTEN",
  136. helpTitle_claude="CLAUDE API-KEY ERHALTEN",
  137. helpSteps_groq={"1) Oeffne groq.com im Browser","2) Erstelle ein kostenloses Konto","3) Gehe zu 'API Keys' im Seitenmenue","4) Klicke auf 'Create API Key'","5) Kopiere den Key - beginnt mit gsk_","6) Fuege ihn oben ins Feld ein"},
  138. helpSteps_claude={"1) Oeffne console.anthropic.com","2) Erstelle ein Konto (Karte erforderlich)","3) Gehe zu 'API Keys' im Menue","4) Klicke auf 'Create Key'","5) Kopiere den Key - beginnt mit sk-ant-","6) Fuege ihn oben ins Feld ein"},
  139. helpNote_groq="100% kostenlos. Keine Kreditkarte.", helpNote_claude="Erfordert bezahltes Anthropic-Konto.",
  140. backBtn="ZURUECK",
  141. },
  142. }
  143. local langIdx = 1
  144. local L = LANGS[langIdx]
  145.  
  146. -- Colores
  147. local C = {
  148. bg = Color3.fromRGB(8, 10, 14), surf = Color3.fromRGB(13, 17, 22),
  149. surf2 = Color3.fromRGB(18, 23, 30), bord = Color3.fromRGB(28, 40, 55),
  150. acc = Color3.fromRGB(0, 200,255), acc2 = Color3.fromRGB(255,100, 40),
  151. green = Color3.fromRGB(50, 255, 80), red = Color3.fromRGB(255, 60, 60),
  152. txt = Color3.fromRGB(195,210,228), dim = Color3.fromRGB(80, 100,118),
  153. usrB = Color3.fromRGB(15, 32, 48), aiB = Color3.fromRGB(18, 23, 30),
  154. hdr = Color3.fromRGB(10, 18, 28), code = Color3.fromRGB(6, 9, 13),
  155. cred = Color3.fromRGB(35, 50, 65),
  156. groq = Color3.fromRGB(0, 200,255),
  157. cld = Color3.fromRGB(200,150,255),
  158. }
  159.  
  160. local function tw(o,p,t,s,d) TweenService:Create(o,TweenInfo.new(t or .18,s or Enum.EasingStyle.Quad,d or Enum.EasingDirection.Out),p):Play() end
  161. local function rnd(o,r) local c=Instance.new("UICorner");c.CornerRadius=UDim.new(0,r or 7);c.Parent=o;return c end
  162. local function strk(o,col,th) local s=Instance.new("UIStroke");s.Color=col or C.bord;s.Thickness=th or 1;s.Parent=o;return s end
  163. local function pad(o,a) local u=Instance.new("UIPadding");u.PaddingTop=UDim.new(0,a);u.PaddingBottom=UDim.new(0,a);u.PaddingLeft=UDim.new(0,a);u.PaddingRight=UDim.new(0,a);u.Parent=o end
  164. local function padV(o,t,r,b,l) local u=Instance.new("UIPadding");u.PaddingTop=UDim.new(0,t or 0);u.PaddingRight=UDim.new(0,r or 0);u.PaddingBottom=UDim.new(0,b or 0);u.PaddingLeft=UDim.new(0,l or 0);u.Parent=o end
  165. local function vlist(o,sp) local l=Instance.new("UIListLayout");l.FillDirection=Enum.FillDirection.Vertical;l.HorizontalAlignment=Enum.HorizontalAlignment.Left;l.VerticalAlignment=Enum.VerticalAlignment.Top;l.Padding=UDim.new(0,sp or 0);l.SortOrder=Enum.SortOrder.LayoutOrder;l.Parent=o;return l end
  166. local function hlist(o,sp) local l=Instance.new("UIListLayout");l.FillDirection=Enum.FillDirection.Horizontal;l.VerticalAlignment=Enum.VerticalAlignment.Center;l.HorizontalAlignment=Enum.HorizontalAlignment.Left;l.Padding=UDim.new(0,sp or 0);l.SortOrder=Enum.SortOrder.LayoutOrder;l.Parent=o;return l end
  167.  
  168. -- ============================================================
  169. -- SCREENGUI + VENTANA 280x380
  170. -- ============================================================
  171. local SG = Instance.new("ScreenGui")
  172. SG.Name="DeltaAI";SG.ResetOnSpawn=false;SG.ZIndexBehavior=Enum.ZIndexBehavior.Sibling
  173. SG.DisplayOrder=999;SG.IgnoreGuiInset=true;SG.Parent=PGui
  174.  
  175. local Win = Instance.new("Frame")
  176. Win.Name="Win";Win.Size=UDim2.new(0,280,0,380)
  177. Win.Position=UDim2.new(0.5,-140,0.5,-190)
  178. Win.BackgroundColor3=C.bg;Win.BorderSizePixel=0;Win.ClipsDescendants=true;Win.Parent=SG
  179. rnd(Win,9)
  180. local WStroke=strk(Win,C.acc,1);WStroke.Transparency=0.55
  181. task.spawn(function()
  182. while Win and Win.Parent do
  183. tw(WStroke,{Transparency=0.15},1.1,Enum.EasingStyle.Sine);task.wait(1.2)
  184. tw(WStroke,{Transparency=0.65},1.1,Enum.EasingStyle.Sine);task.wait(1.2)
  185. end
  186. end)
  187.  
  188. -- ============================================================
  189. -- PANTALLA 1: ELEGIR PROVEEDOR
  190. -- ============================================================
  191. local ProvScreen = Instance.new("Frame")
  192. ProvScreen.Size=UDim2.new(1,0,1,0);ProvScreen.BackgroundColor3=C.bg
  193. ProvScreen.BorderSizePixel=0;ProvScreen.ZIndex=15;ProvScreen.Parent=Win
  194. pad(ProvScreen,16);vlist(ProvScreen,10)
  195.  
  196. -- Logo
  197. local PSLogoF=Instance.new("Frame")
  198. PSLogoF.Size=UDim2.new(1,0,0,36);PSLogoF.BackgroundTransparency=1
  199. PSLogoF.LayoutOrder=1;PSLogoF.Parent=ProvScreen;hlist(PSLogoF,8)
  200. local PSIco=Instance.new("ImageLabel")
  201. PSIco.Size=UDim2.new(0,26,0,26);PSIco.BackgroundColor3=C.acc
  202. PSIco.Image="rbxassetid://6031068426";PSIco.ImageColor3=Color3.fromRGB(0,0,0)
  203. PSIco.ScaleType=Enum.ScaleType.Fit;PSIco.LayoutOrder=1;PSIco.Parent=PSLogoF;rnd(PSIco,7)
  204. local PSTitle=Instance.new("TextLabel")
  205. PSTitle.Size=UDim2.new(1,-36,0,26);PSTitle.BackgroundTransparency=1
  206. PSTitle.Text="DELTA AI";PSTitle.TextSize=18;PSTitle.TextColor3=C.acc
  207. PSTitle.Font=Enum.Font.GothamBold;PSTitle.TextXAlignment=Enum.TextXAlignment.Left
  208. PSTitle.LayoutOrder=2;PSTitle.Parent=PSLogoF
  209.  
  210. -- Selector idioma
  211. local PSLangRow=Instance.new("Frame")
  212. PSLangRow.Size=UDim2.new(1,0,0,20);PSLangRow.BackgroundTransparency=1
  213. PSLangRow.LayoutOrder=2;PSLangRow.Parent=ProvScreen;hlist(PSLangRow,4)
  214. local PSLangLbl=Instance.new("TextLabel")
  215. PSLangLbl.Size=UDim2.new(0,34,0,18);PSLangLbl.BackgroundTransparency=1
  216. PSLangLbl.Text="LANG:";PSLangLbl.TextSize=9;PSLangLbl.TextColor3=C.dim
  217. PSLangLbl.Font=Enum.Font.GothamBold;PSLangLbl.LayoutOrder=1;PSLangLbl.Parent=PSLangRow
  218. local PSLangBtns={}
  219. for i,lang in ipairs(LANGS) do
  220. local lb=Instance.new("TextButton")
  221. lb.Size=UDim2.new(0,26,0,18);lb.BackgroundColor3=(i==langIdx) and C.acc2 or C.surf2
  222. lb.Text=lang.code;lb.TextSize=9;lb.TextColor3=(i==langIdx) and Color3.fromRGB(0,0,0) or C.dim
  223. lb.Font=Enum.Font.GothamBold;lb.AutoButtonColor=false;lb.LayoutOrder=i+1;lb.ZIndex=16;lb.Parent=PSLangRow;rnd(lb,4)
  224. strk(lb,(i==langIdx) and C.acc2 or C.bord);PSLangBtns[i]=lb
  225. end
  226.  
  227. -- Titulo elegir
  228. local ChooseLbl=Instance.new("TextLabel")
  229. ChooseLbl.Size=UDim2.new(1,0,0,13);ChooseLbl.BackgroundTransparency=1
  230. ChooseLbl.Text=L.chooseTitle;ChooseLbl.TextSize=10;ChooseLbl.TextColor3=C.dim
  231. ChooseLbl.Font=Enum.Font.GothamBold;ChooseLbl.TextXAlignment=Enum.TextXAlignment.Left
  232. ChooseLbl.TextWrapped=true;ChooseLbl.LayoutOrder=3;ChooseLbl.Parent=ProvScreen
  233.  
  234. -- Sep
  235. local PSSep=Instance.new("Frame")
  236. PSSep.Size=UDim2.new(1,0,0,1);PSSep.BackgroundColor3=C.bord
  237. PSSep.BorderSizePixel=0;PSSep.LayoutOrder=4;PSSep.Parent=ProvScreen
  238.  
  239. -- TARJETA GROQ
  240. local GroqCard=Instance.new("TextButton")
  241. GroqCard.Size=UDim2.new(1,0,0,86);GroqCard.BackgroundColor3=C.surf2
  242. GroqCard.Text="";GroqCard.AutoButtonColor=false
  243. GroqCard.LayoutOrder=5;GroqCard.ZIndex=16;GroqCard.Parent=ProvScreen;rnd(GroqCard,10)
  244. local GroqStroke=strk(GroqCard,C.groq,1.5);GroqStroke.Transparency=0.5
  245.  
  246. local GIco=Instance.new("Frame")
  247. GIco.Size=UDim2.new(0,34,0,34);GIco.Position=UDim2.new(0,12,0.5,-17)
  248. GIco.BackgroundColor3=C.groq;GIco.ZIndex=17;GIco.Parent=GroqCard;rnd(GIco,9)
  249. local GIcoL=Instance.new("TextLabel")
  250. GIcoL.Size=UDim2.new(1,0,1,0);GIcoL.BackgroundTransparency=1;GIcoL.Text="G"
  251. GIcoL.TextSize=19;GIcoL.TextColor3=Color3.fromRGB(0,0,0);GIcoL.Font=Enum.Font.GothamBold;GIcoL.ZIndex=18;GIcoL.Parent=GIco
  252.  
  253. local GName=Instance.new("TextLabel")
  254. GName.Size=UDim2.new(0,140,0,18);GName.Position=UDim2.new(0,56,0,14)
  255. GName.BackgroundTransparency=1;GName.Text=L.groqName;GName.TextSize=15;GName.TextColor3=C.groq
  256. GName.Font=Enum.Font.GothamBold;GName.TextXAlignment=Enum.TextXAlignment.Left;GName.ZIndex=17;GName.Parent=GroqCard
  257. local GSub=Instance.new("TextLabel")
  258. GSub.Size=UDim2.new(0,170,0,13);GSub.Position=UDim2.new(0,56,0,34)
  259. GSub.BackgroundTransparency=1;GSub.Text=L.groqSub;GSub.TextSize=10;GSub.TextColor3=C.dim
  260. GSub.Font=Enum.Font.Gotham;GSub.TextXAlignment=Enum.TextXAlignment.Left;GSub.ZIndex=17;GSub.Parent=GroqCard
  261. local GBadge=Instance.new("Frame")
  262. GBadge.Size=UDim2.new(0,52,0,17);GBadge.Position=UDim2.new(0,56,0,52)
  263. GBadge.BackgroundColor3=Color3.fromRGB(0,50,15);GBadge.ZIndex=17;GBadge.Parent=GroqCard;rnd(GBadge,5);strk(GBadge,C.green)
  264. local GBadgeL=Instance.new("TextLabel")
  265. GBadgeL.Size=UDim2.new(1,0,1,0);GBadgeL.BackgroundTransparency=1;GBadgeL.Text=L.groqBadge
  266. GBadgeL.TextSize=9;GBadgeL.TextColor3=C.green;GBadgeL.Font=Enum.Font.GothamBold;GBadgeL.ZIndex=18;GBadgeL.Parent=GBadge
  267. local GArrow=Instance.new("TextLabel")
  268. GArrow.Size=UDim2.new(0,18,0,18);GArrow.Position=UDim2.new(1,-28,0.5,-9)
  269. GArrow.BackgroundTransparency=1;GArrow.Text=">";GArrow.TextSize=16;GArrow.TextColor3=C.groq
  270. GArrow.Font=Enum.Font.GothamBold;GArrow.ZIndex=17;GArrow.Parent=GroqCard
  271.  
  272. -- TARJETA CLAUDE
  273. local CldCard=Instance.new("TextButton")
  274. CldCard.Size=UDim2.new(1,0,0,86);CldCard.BackgroundColor3=C.surf2
  275. CldCard.Text="";CldCard.AutoButtonColor=false
  276. CldCard.LayoutOrder=6;CldCard.ZIndex=16;CldCard.Parent=ProvScreen;rnd(CldCard,10)
  277. local CldStroke=strk(CldCard,C.cld,1.5);CldStroke.Transparency=0.5
  278.  
  279. local CIco=Instance.new("Frame")
  280. CIco.Size=UDim2.new(0,34,0,34);CIco.Position=UDim2.new(0,12,0.5,-17)
  281. CIco.BackgroundColor3=C.cld;CIco.ZIndex=17;CIco.Parent=CldCard;rnd(CIco,9)
  282. local CIcoL=Instance.new("TextLabel")
  283. CIcoL.Size=UDim2.new(1,0,1,0);CIcoL.BackgroundTransparency=1;CIcoL.Text="C"
  284. CIcoL.TextSize=19;CIcoL.TextColor3=Color3.fromRGB(0,0,0);CIcoL.Font=Enum.Font.GothamBold;CIcoL.ZIndex=18;CIcoL.Parent=CIco
  285.  
  286. local CName=Instance.new("TextLabel")
  287. CName.Size=UDim2.new(0,140,0,18);CName.Position=UDim2.new(0,56,0,14)
  288. CName.BackgroundTransparency=1;CName.Text=L.cldName;CName.TextSize=15;CName.TextColor3=C.cld
  289. CName.Font=Enum.Font.GothamBold;CName.TextXAlignment=Enum.TextXAlignment.Left;CName.ZIndex=17;CName.Parent=CldCard
  290. local CSub=Instance.new("TextLabel")
  291. CSub.Size=UDim2.new(0,170,0,13);CSub.Position=UDim2.new(0,56,0,34)
  292. CSub.BackgroundTransparency=1;CSub.Text=L.cldSub;CSub.TextSize=10;CSub.TextColor3=C.dim
  293. CSub.Font=Enum.Font.Gotham;CSub.TextXAlignment=Enum.TextXAlignment.Left;CSub.ZIndex=17;CSub.Parent=CldCard
  294. local CBadge=Instance.new("Frame")
  295. CBadge.Size=UDim2.new(0,52,0,17);CBadge.Position=UDim2.new(0,56,0,52)
  296. CBadge.BackgroundColor3=Color3.fromRGB(45,15,5);CBadge.ZIndex=17;CBadge.Parent=CldCard;rnd(CBadge,5);strk(CBadge,C.acc2)
  297. local CBadgeL=Instance.new("TextLabel")
  298. CBadgeL.Size=UDim2.new(1,0,1,0);CBadgeL.BackgroundTransparency=1;CBadgeL.Text=L.cldBadge
  299. CBadgeL.TextSize=9;CBadgeL.TextColor3=C.acc2;CBadgeL.Font=Enum.Font.GothamBold;CBadgeL.ZIndex=18;CBadgeL.Parent=CBadge
  300. local CArrow=Instance.new("TextLabel")
  301. CArrow.Size=UDim2.new(0,18,0,18);CArrow.Position=UDim2.new(1,-28,0.5,-9)
  302. CArrow.BackgroundTransparency=1;CArrow.Text=">";CArrow.TextSize=16;CArrow.TextColor3=C.cld
  303. CArrow.Font=Enum.Font.GothamBold;CArrow.ZIndex=17;CArrow.Parent=CldCard
  304.  
  305. -- Credito proveedor
  306. local PSCred=Instance.new("TextLabel")
  307. PSCred.Size=UDim2.new(1,0,0,11);PSCred.BackgroundTransparency=1
  308. PSCred.Text="by : zyren";PSCred.TextSize=8;PSCred.TextColor3=C.cred
  309. PSCred.Font=Enum.Font.Gotham;PSCred.TextXAlignment=Enum.TextXAlignment.Right
  310. PSCred.LayoutOrder=7;PSCred.Parent=ProvScreen
  311.  
  312. -- Hovers tarjetas
  313. GroqCard.MouseEnter:Connect(function() tw(GroqCard,{BackgroundColor3=Color3.fromRGB(12,22,32)});tw(GroqStroke,{Transparency=0}) end)
  314. GroqCard.MouseLeave:Connect(function() tw(GroqCard,{BackgroundColor3=C.surf2});tw(GroqStroke,{Transparency=0.5}) end)
  315. CldCard.MouseEnter:Connect(function() tw(CldCard,{BackgroundColor3=Color3.fromRGB(18,12,26)});tw(CldStroke,{Transparency=0}) end)
  316. CldCard.MouseLeave:Connect(function() tw(CldCard,{BackgroundColor3=C.surf2});tw(CldStroke,{Transparency=0.5}) end)
  317.  
  318. -- ============================================================
  319. -- PANTALLA 2: LOGIN (API KEY)
  320. -- ============================================================
  321. local Login=Instance.new("Frame")
  322. Login.Size=UDim2.new(1,0,1,0);Login.BackgroundColor3=C.bg
  323. Login.BorderSizePixel=0;Login.ZIndex=10;Login.Visible=false;Login.Parent=Win
  324. pad(Login,16);vlist(Login,9)
  325.  
  326. -- Logo login
  327. local LLogoF=Instance.new("Frame")
  328. LLogoF.Size=UDim2.new(1,0,0,36);LLogoF.BackgroundTransparency=1
  329. LLogoF.LayoutOrder=1;LLogoF.Parent=Login;hlist(LLogoF,6)
  330. local LIco=Instance.new("ImageLabel")
  331. LIco.Size=UDim2.new(0,24,0,24);LIco.BackgroundColor3=C.acc
  332. LIco.Image="rbxassetid://6031068426";LIco.ImageColor3=Color3.fromRGB(0,0,0)
  333. LIco.ScaleType=Enum.ScaleType.Fit;LIco.LayoutOrder=1;LIco.Parent=LLogoF;rnd(LIco,6)
  334. local LTF=Instance.new("Frame")
  335. LTF.Size=UDim2.new(1,-94,0,32);LTF.BackgroundTransparency=1;LTF.LayoutOrder=2;LTF.Parent=LLogoF;vlist(LTF,1)
  336. local LT1=Instance.new("TextLabel")
  337. LT1.Size=UDim2.new(1,0,0,16);LT1.BackgroundTransparency=1;LT1.Text="DELTA AI"
  338. LT1.TextSize=14;LT1.TextColor3=C.acc;LT1.Font=Enum.Font.GothamBold;LT1.TextXAlignment=Enum.TextXAlignment.Left;LT1.Parent=LTF
  339. local LT2=Instance.new("TextLabel")
  340. LT2.Size=UDim2.new(1,0,0,13);LT2.BackgroundTransparency=1;LT2.Text=L.subtitle_groq
  341. LT2.TextSize=9;LT2.TextColor3=C.dim;LT2.Font=Enum.Font.GothamBold;LT2.TextXAlignment=Enum.TextXAlignment.Left;LT2.Parent=LTF
  342.  
  343. -- Boton volver
  344. local BackBtn=Instance.new("TextButton")
  345. BackBtn.Size=UDim2.new(0,50,0,24);BackBtn.LayoutOrder=3
  346. BackBtn.BackgroundColor3=C.surf2;BackBtn.Text="< "..L.backBtn;BackBtn.TextSize=9
  347. BackBtn.TextColor3=C.dim;BackBtn.Font=Enum.Font.GothamBold
  348. BackBtn.AutoButtonColor=false;BackBtn.ZIndex=11;BackBtn.Parent=LLogoF
  349. rnd(BackBtn,6);strk(BackBtn)
  350. BackBtn.MouseEnter:Connect(function() tw(BackBtn,{BackgroundColor3=C.bord,TextColor3=C.txt}) end)
  351. BackBtn.MouseLeave:Connect(function() tw(BackBtn,{BackgroundColor3=C.surf2,TextColor3=C.dim}) end)
  352.  
  353. -- Lang row
  354. local LangRow=Instance.new("Frame")
  355. LangRow.Size=UDim2.new(1,0,0,20);LangRow.BackgroundTransparency=1
  356. LangRow.LayoutOrder=2;LangRow.Parent=Login;hlist(LangRow,4)
  357. local LangLbl=Instance.new("TextLabel")
  358. LangLbl.Size=UDim2.new(0,34,0,18);LangLbl.BackgroundTransparency=1;LangLbl.Text="LANG:"
  359. LangLbl.TextSize=9;LangLbl.TextColor3=C.dim;LangLbl.Font=Enum.Font.GothamBold;LangLbl.LayoutOrder=1;LangLbl.Parent=LangRow
  360. local LoginLangBtns={}
  361. for i,lang in ipairs(LANGS) do
  362. local lb=Instance.new("TextButton")
  363. lb.Size=UDim2.new(0,26,0,18);lb.BackgroundColor3=(i==langIdx) and C.acc2 or C.surf2
  364. lb.Text=lang.code;lb.TextSize=9;lb.TextColor3=(i==langIdx) and Color3.fromRGB(0,0,0) or C.dim
  365. lb.Font=Enum.Font.GothamBold;lb.AutoButtonColor=false;lb.LayoutOrder=i+1;lb.ZIndex=11;lb.Parent=LangRow;rnd(lb,4)
  366. strk(lb,(i==langIdx) and C.acc2 or C.bord);LoginLangBtns[i]=lb
  367. end
  368.  
  369. -- Key label + desc
  370. local KLblL=Instance.new("TextLabel")
  371. KLblL.Size=UDim2.new(1,0,0,13);KLblL.BackgroundTransparency=1;KLblL.Text=L.keyLbl_groq
  372. KLblL.TextSize=9;KLblL.TextColor3=C.dim;KLblL.Font=Enum.Font.GothamBold
  373. KLblL.TextXAlignment=Enum.TextXAlignment.Left;KLblL.LayoutOrder=3;KLblL.Parent=Login
  374. local KDescL=Instance.new("TextLabel")
  375. KDescL.Size=UDim2.new(1,0,0,12);KDescL.BackgroundTransparency=1;KDescL.Text=L.keyDesc_groq
  376. KDescL.TextSize=9;KDescL.TextColor3=C.dim;KDescL.Font=Enum.Font.Gotham
  377. KDescL.TextXAlignment=Enum.TextXAlignment.Left;KDescL.TextWrapped=true;KDescL.LayoutOrder=4;KDescL.Parent=Login
  378.  
  379. -- Input
  380. local KF=Instance.new("Frame")
  381. KF.Size=UDim2.new(1,0,0,32);KF.BackgroundColor3=C.surf2;KF.LayoutOrder=5;KF.Parent=Login;rnd(KF,7)
  382. local KStroke=strk(KF,C.bord)
  383. local KInput=Instance.new("TextBox")
  384. KInput.Size=UDim2.new(1,-16,1,0);KInput.Position=UDim2.new(0,8,0,0)
  385. KInput.BackgroundTransparency=1;KInput.Text="";KInput.PlaceholderText=L.keyPH_groq
  386. KInput.TextSize=12;KInput.TextColor3=C.txt;KInput.PlaceholderColor3=C.dim
  387. KInput.Font=Enum.Font.Code;KInput.TextXAlignment=Enum.TextXAlignment.Left
  388. KInput.ClearTextOnFocus=false;KInput.ZIndex=11;KInput.Parent=KF
  389. KInput.Focused:Connect(function() tw(KStroke,{Color=C.acc}) end)
  390. KInput.FocusLost:Connect(function() tw(KStroke,{Color=C.bord}) end)
  391.  
  392. -- Conectar
  393. local ConBtn=Instance.new("TextButton")
  394. ConBtn.Size=UDim2.new(1,0,0,32);ConBtn.BackgroundColor3=C.groq
  395. ConBtn.Text=L.conBtn;ConBtn.TextSize=13;ConBtn.TextColor3=Color3.fromRGB(0,0,0)
  396. ConBtn.Font=Enum.Font.GothamBold;ConBtn.AutoButtonColor=false
  397. ConBtn.LayoutOrder=6;ConBtn.ZIndex=11;ConBtn.Parent=Login;rnd(ConBtn,7)
  398. ConBtn.MouseEnter:Connect(function() tw(ConBtn,{BackgroundTransparency=0.18}) end)
  399. ConBtn.MouseLeave:Connect(function() tw(ConBtn,{BackgroundTransparency=0}) end)
  400.  
  401. -- Error
  402. local ELbl=Instance.new("TextLabel")
  403. ELbl.Size=UDim2.new(1,0,0,13);ELbl.BackgroundTransparency=1;ELbl.Text=""
  404. ELbl.TextSize=10;ELbl.TextColor3=C.red;ELbl.Font=Enum.Font.Gotham
  405. ELbl.TextXAlignment=Enum.TextXAlignment.Left;ELbl.TextWrapped=true;ELbl.LayoutOrder=7;ELbl.Parent=Login
  406.  
  407. -- Help btn
  408. local HelpBtnL=Instance.new("TextButton")
  409. HelpBtnL.Size=UDim2.new(1,0,0,26);HelpBtnL.BackgroundColor3=C.surf2
  410. HelpBtnL.Text=L.helpBtnTxt;HelpBtnL.TextSize=10;HelpBtnL.TextColor3=C.acc2
  411. HelpBtnL.Font=Enum.Font.GothamBold;HelpBtnL.AutoButtonColor=false
  412. HelpBtnL.LayoutOrder=8;HelpBtnL.ZIndex=11;HelpBtnL.Parent=Login;rnd(HelpBtnL,7);strk(HelpBtnL,C.acc2)
  413. HelpBtnL.MouseEnter:Connect(function() tw(HelpBtnL,{BackgroundColor3=Color3.fromRGB(30,16,8)}) end)
  414. HelpBtnL.MouseLeave:Connect(function() tw(HelpBtnL,{BackgroundColor3=C.surf2}) end)
  415.  
  416. -- Credito login
  417. local CreditLogin=Instance.new("TextLabel")
  418. CreditLogin.Size=UDim2.new(1,0,0,11);CreditLogin.BackgroundTransparency=1
  419. CreditLogin.Text="by : zyren";CreditLogin.TextSize=8;CreditLogin.TextColor3=C.cred
  420. CreditLogin.Font=Enum.Font.Gotham;CreditLogin.TextXAlignment=Enum.TextXAlignment.Right
  421. CreditLogin.LayoutOrder=9;CreditLogin.Parent=Login
  422.  
  423. -- ============================================================
  424. -- PANEL AYUDA
  425. -- ============================================================
  426. local HP=Instance.new("Frame")
  427. HP.Size=UDim2.new(1,0,1,0);HP.BackgroundColor3=C.bg
  428. HP.BorderSizePixel=0;HP.ZIndex=20;HP.Visible=false;HP.Parent=Win
  429. pad(HP,15);vlist(HP,9)
  430. local HPHdr=Instance.new("Frame")
  431. HPHdr.Size=UDim2.new(1,0,0,26);HPHdr.BackgroundTransparency=1;HPHdr.LayoutOrder=1;HPHdr.Parent=HP
  432. local HPTitleL=Instance.new("TextLabel")
  433. HPTitleL.Size=UDim2.new(1,-30,1,0);HPTitleL.BackgroundTransparency=1;HPTitleL.Text=L.helpTitle_groq
  434. HPTitleL.TextSize=11;HPTitleL.TextColor3=C.acc2;HPTitleL.Font=Enum.Font.GothamBold
  435. HPTitleL.TextXAlignment=Enum.TextXAlignment.Left;HPTitleL.TextWrapped=true;HPTitleL.Parent=HPHdr
  436. local HPClsB=Instance.new("TextButton")
  437. HPClsB.Size=UDim2.new(0,22,0,22);HPClsB.Position=UDim2.new(1,-22,0,2)
  438. HPClsB.BackgroundColor3=C.surf2;HPClsB.Text="X";HPClsB.TextSize=11;HPClsB.TextColor3=C.dim
  439. HPClsB.Font=Enum.Font.GothamBold;HPClsB.AutoButtonColor=false;HPClsB.ZIndex=21;HPClsB.Parent=HPHdr;rnd(HPClsB,5);strk(HPClsB)
  440. HPClsB.MouseEnter:Connect(function() tw(HPClsB,{BackgroundColor3=C.red,TextColor3=Color3.new(1,1,1)}) end)
  441. HPClsB.MouseLeave:Connect(function() tw(HPClsB,{BackgroundColor3=C.surf2,TextColor3=C.dim}) end)
  442. local HPSep=Instance.new("Frame")
  443. HPSep.Size=UDim2.new(1,0,0,1);HPSep.BackgroundColor3=C.acc2;HPSep.BorderSizePixel=0;HPSep.LayoutOrder=2;HPSep.Parent=HP
  444. local HPScroll=Instance.new("ScrollingFrame")
  445. HPScroll.Size=UDim2.new(1,0,0,232);HPScroll.BackgroundTransparency=1;HPScroll.BorderSizePixel=0
  446. HPScroll.ScrollBarThickness=2;HPScroll.ScrollBarImageColor3=C.bord
  447. HPScroll.CanvasSize=UDim2.new(0,0,0,0);HPScroll.AutomaticCanvasSize=Enum.AutomaticSize.Y
  448. HPScroll.ScrollingDirection=Enum.ScrollingDirection.Y;HPScroll.ZIndex=21;HPScroll.LayoutOrder=3;HPScroll.Parent=HP
  449. vlist(HPScroll,7);padV(HPScroll,2,2,2,0)
  450. local HPStepLabels={}
  451. for i=1,6 do
  452. local sF=Instance.new("Frame")
  453. sF.Size=UDim2.new(1,0,0,0);sF.AutomaticSize=Enum.AutomaticSize.Y
  454. sF.BackgroundColor3=C.surf2;sF.BorderSizePixel=0;sF.ZIndex=21;sF.Parent=HPScroll;rnd(sF,6);padV(sF,7,8,7,10)
  455. local dot=Instance.new("Frame")
  456. dot.Size=UDim2.new(0,3,0,3);dot.Position=UDim2.new(0,-1,0,8)
  457. dot.BackgroundColor3=C.acc2;dot.BorderSizePixel=0;dot.ZIndex=22;dot.Parent=sF;rnd(dot,2)
  458. local stl=Instance.new("TextLabel")
  459. stl.Size=UDim2.new(1,0,0,0);stl.AutomaticSize=Enum.AutomaticSize.Y;stl.BackgroundTransparency=1
  460. stl.Text=L.helpSteps_groq[i] or "";stl.TextSize=11;stl.TextColor3=C.txt;stl.Font=Enum.Font.Gotham
  461. stl.TextXAlignment=Enum.TextXAlignment.Left;stl.TextYAlignment=Enum.TextYAlignment.Top
  462. stl.TextWrapped=true;stl.ZIndex=22;stl.Parent=sF;HPStepLabels[i]=stl
  463. end
  464. local HPNoteL=Instance.new("TextLabel")
  465. HPNoteL.Size=UDim2.new(1,0,0,0);HPNoteL.AutomaticSize=Enum.AutomaticSize.Y;HPNoteL.BackgroundTransparency=1
  466. HPNoteL.Text=L.helpNote_groq;HPNoteL.TextSize=10;HPNoteL.TextColor3=C.green;HPNoteL.Font=Enum.Font.GothamBold
  467. HPNoteL.TextXAlignment=Enum.TextXAlignment.Left;HPNoteL.TextWrapped=true;HPNoteL.ZIndex=21;HPNoteL.LayoutOrder=4;HPNoteL.Parent=HP
  468. local HPCredit=Instance.new("TextLabel")
  469. HPCredit.Size=UDim2.new(1,0,0,11);HPCredit.BackgroundTransparency=1;HPCredit.Text="by : zyren"
  470. HPCredit.TextSize=8;HPCredit.TextColor3=C.cred;HPCredit.Font=Enum.Font.Gotham
  471. HPCredit.TextXAlignment=Enum.TextXAlignment.Right;HPCredit.ZIndex=21;HPCredit.LayoutOrder=5;HPCredit.Parent=HP
  472.  
  473. local function openHelp() HP.BackgroundTransparency=1;HP.Visible=true;tw(HP,{BackgroundTransparency=0},0.15) end
  474. local function closeHelp() tw(HP,{BackgroundTransparency=1},0.15);task.delay(0.16,function() HP.Visible=false end) end
  475. HelpBtnL.MouseButton1Click:Connect(openHelp)
  476. HPClsB.MouseButton1Click:Connect(closeHelp)
  477.  
  478. -- ============================================================
  479. -- CHAT SCREEN
  480. -- ============================================================
  481. local Chat=Instance.new("Frame")
  482. Chat.Size=UDim2.new(1,0,1,0);Chat.BackgroundTransparency=1;Chat.BorderSizePixel=0;Chat.Visible=false;Chat.Parent=Win
  483.  
  484. local Hdr=Instance.new("Frame")
  485. Hdr.Name="Hdr";Hdr.Size=UDim2.new(1,0,0,36);Hdr.BackgroundColor3=C.hdr;Hdr.BorderSizePixel=0;Hdr.ZIndex=5;Hdr.Parent=Chat
  486. local HGlow=Instance.new("Frame")
  487. HGlow.Size=UDim2.new(1,0,0,1);HGlow.Position=UDim2.new(0,0,1,-1);HGlow.BackgroundColor3=C.groq;HGlow.BorderSizePixel=0;HGlow.Parent=Hdr
  488. task.spawn(function()
  489. while HGlow and HGlow.Parent do
  490. tw(HGlow,{BackgroundTransparency=0.05},0.9,Enum.EasingStyle.Sine);task.wait(1)
  491. tw(HGlow,{BackgroundTransparency=0.65},0.9,Enum.EasingStyle.Sine);task.wait(1)
  492. end
  493. end)
  494. local HIco=Instance.new("ImageLabel")
  495. HIco.Size=UDim2.new(0,20,0,20);HIco.Position=UDim2.new(0,8,0.5,-10);HIco.BackgroundColor3=C.acc
  496. HIco.Image="rbxassetid://6031068426";HIco.ImageColor3=Color3.fromRGB(0,0,0);HIco.ScaleType=Enum.ScaleType.Fit
  497. HIco.ZIndex=6;HIco.Parent=Hdr;rnd(HIco,5)
  498. local HTitle=Instance.new("TextLabel")
  499. HTitle.Size=UDim2.new(0,80,0,16);HTitle.Position=UDim2.new(0,34,0,8);HTitle.BackgroundTransparency=1
  500. HTitle.Text="DELTA AI";HTitle.TextSize=13;HTitle.TextColor3=C.acc;HTitle.Font=Enum.Font.GothamBold
  501. HTitle.TextXAlignment=Enum.TextXAlignment.Left;HTitle.ZIndex=6;HTitle.Parent=Hdr
  502. local HCred=Instance.new("TextLabel")
  503. HCred.Size=UDim2.new(0,50,0,10);HCred.Position=UDim2.new(0,34,0,23);HCred.BackgroundTransparency=1
  504. HCred.Text="by : zyren";HCred.TextSize=8;HCred.TextColor3=C.cred;HCred.Font=Enum.Font.Gotham
  505. HCred.TextXAlignment=Enum.TextXAlignment.Left;HCred.ZIndex=6;HCred.Parent=Hdr
  506. local SDot=Instance.new("Frame")
  507. SDot.Size=UDim2.new(0,6,0,6);SDot.Position=UDim2.new(0,128,0.5,-3);SDot.BackgroundColor3=C.groq
  508. SDot.BorderSizePixel=0;SDot.ZIndex=6;SDot.Parent=Hdr;rnd(SDot,3)
  509. task.spawn(function()
  510. while SDot and SDot.Parent do
  511. tw(SDot,{BackgroundTransparency=0},0.6,Enum.EasingStyle.Sine);task.wait(0.8)
  512. tw(SDot,{BackgroundTransparency=0.65},0.6,Enum.EasingStyle.Sine);task.wait(0.8)
  513. end
  514. end)
  515. local SLbl=Instance.new("TextLabel")
  516. SLbl.Size=UDim2.new(0,55,0,12);SLbl.Position=UDim2.new(0,140,0.5,-6);SLbl.BackgroundTransparency=1
  517. SLbl.Text=L.statusOn;SLbl.TextSize=8;SLbl.TextColor3=C.groq;SLbl.Font=Enum.Font.GothamBold
  518. SLbl.TextXAlignment=Enum.TextXAlignment.Left;SLbl.ZIndex=6;SLbl.Parent=Hdr
  519. local MinB=Instance.new("TextButton")
  520. MinB.Size=UDim2.new(0,22,0,22);MinB.Position=UDim2.new(1,-50,0.5,-11);MinB.BackgroundColor3=C.surf2
  521. MinB.Text="-";MinB.TextSize=14;MinB.TextColor3=C.dim;MinB.Font=Enum.Font.GothamBold
  522. MinB.AutoButtonColor=false;MinB.ZIndex=7;MinB.Parent=Hdr;rnd(MinB,5);strk(MinB)
  523. local ClsB=Instance.new("TextButton")
  524. ClsB.Size=UDim2.new(0,22,0,22);ClsB.Position=UDim2.new(1,-24,0.5,-11);ClsB.BackgroundColor3=C.surf2
  525. ClsB.Text="X";ClsB.TextSize=11;ClsB.TextColor3=C.dim;ClsB.Font=Enum.Font.GothamBold
  526. ClsB.AutoButtonColor=false;ClsB.ZIndex=7;ClsB.Parent=Hdr;rnd(ClsB,5);strk(ClsB)
  527. MinB.MouseEnter:Connect(function() tw(MinB,{BackgroundColor3=C.acc,TextColor3=Color3.new(0,0,0)}) end)
  528. MinB.MouseLeave:Connect(function() tw(MinB,{BackgroundColor3=C.surf2,TextColor3=C.dim}) end)
  529. ClsB.MouseEnter:Connect(function() tw(ClsB,{BackgroundColor3=C.red,TextColor3=Color3.new(1,1,1)}) end)
  530. ClsB.MouseLeave:Connect(function() tw(ClsB,{BackgroundColor3=C.surf2,TextColor3=C.dim}) end)
  531.  
  532. -- Model bar
  533. local MBar=Instance.new("Frame")
  534. MBar.Size=UDim2.new(1,0,0,24);MBar.Position=UDim2.new(0,0,0,36);MBar.BackgroundColor3=C.bg
  535. MBar.BorderSizePixel=0;MBar.ZIndex=4;MBar.Parent=Chat
  536. local MBarSep=Instance.new("Frame")
  537. MBarSep.Size=UDim2.new(1,0,0,1);MBarSep.Position=UDim2.new(0,0,1,-1);MBarSep.BackgroundColor3=C.bord;MBarSep.BorderSizePixel=0;MBarSep.Parent=MBar
  538. local mIdx=1
  539. local MBtn=Instance.new("TextButton")
  540. MBtn.Size=UDim2.new(0,112,0,18);MBtn.Position=UDim2.new(0,6,0.5,-9);MBtn.BackgroundColor3=C.surf2
  541. MBtn.Text=GROQ_MODELS[1]:sub(1,15);MBtn.TextSize=9;MBtn.TextColor3=C.acc;MBtn.Font=Enum.Font.Code
  542. MBtn.AutoButtonColor=false;MBtn.TextXAlignment=Enum.TextXAlignment.Left;MBtn.ZIndex=5;MBtn.Parent=MBar
  543. rnd(MBtn,4);strk(MBtn);padV(MBtn,0,0,0,4)
  544. MBtn.MouseButton1Click:Connect(function()
  545. local models=PROVIDER=="groq" and GROQ_MODELS or CLAUDE_MODELS
  546. mIdx=mIdx%#models+1;MODEL=models[mIdx]
  547. MBtn.Text=(#MODEL>15) and MODEL:sub(1,14).."~" or MODEL
  548. end)
  549. local LangB=Instance.new("TextButton")
  550. LangB.Size=UDim2.new(0,28,0,18);LangB.Position=UDim2.new(1,-104,0.5,-9);LangB.BackgroundColor3=C.surf2
  551. LangB.Text=L.code;LangB.TextSize=10;LangB.TextColor3=C.acc2;LangB.Font=Enum.Font.GothamBold
  552. LangB.AutoButtonColor=false;LangB.ZIndex=5;LangB.Parent=MBar;rnd(LangB,4);strk(LangB,C.acc2)
  553. LangB.MouseEnter:Connect(function() tw(LangB,{TextColor3=Color3.new(1,1,1)}) end)
  554. LangB.MouseLeave:Connect(function() tw(LangB,{TextColor3=C.acc2}) end)
  555. local ChatHelpB=Instance.new("TextButton")
  556. ChatHelpB.Size=UDim2.new(0,22,0,18);ChatHelpB.Position=UDim2.new(1,-72,0.5,-9);ChatHelpB.BackgroundColor3=C.surf2
  557. ChatHelpB.Text="?";ChatHelpB.TextSize=12;ChatHelpB.TextColor3=C.acc2;ChatHelpB.Font=Enum.Font.GothamBold
  558. ChatHelpB.AutoButtonColor=false;ChatHelpB.ZIndex=5;ChatHelpB.Parent=MBar;rnd(ChatHelpB,4);strk(ChatHelpB,C.bord)
  559. ChatHelpB.MouseEnter:Connect(function() tw(ChatHelpB,{BackgroundColor3=Color3.fromRGB(30,16,8),TextColor3=Color3.new(1,1,1)}) end)
  560. ChatHelpB.MouseLeave:Connect(function() tw(ChatHelpB,{BackgroundColor3=C.surf2,TextColor3=C.acc2}) end)
  561. ChatHelpB.MouseButton1Click:Connect(openHelp)
  562. local ClrB=Instance.new("TextButton")
  563. ClrB.Size=UDim2.new(0,36,0,18);ClrB.Position=UDim2.new(1,-40,0.5,-9);ClrB.BackgroundColor3=C.surf2
  564. ClrB.Text=L.clearBtn;ClrB.TextSize=10;ClrB.TextColor3=C.dim;ClrB.Font=Enum.Font.GothamBold
  565. ClrB.AutoButtonColor=false;ClrB.ZIndex=5;ClrB.Parent=MBar;rnd(ClrB,4);strk(ClrB)
  566. ClrB.MouseEnter:Connect(function() tw(ClrB,{TextColor3=C.red}) end)
  567. ClrB.MouseLeave:Connect(function() tw(ClrB,{TextColor3=C.dim}) end)
  568.  
  569. local MsgF=Instance.new("Frame")
  570. MsgF.Size=UDim2.new(1,0,0,276);MsgF.Position=UDim2.new(0,0,0,60);MsgF.BackgroundColor3=C.surf
  571. MsgF.BorderSizePixel=0;MsgF.ClipsDescendants=true;MsgF.ZIndex=3;MsgF.Parent=Chat
  572. local SF=Instance.new("ScrollingFrame")
  573. SF.Size=UDim2.new(1,0,1,0);SF.BackgroundTransparency=1;SF.BorderSizePixel=0
  574. SF.ScrollBarThickness=2;SF.ScrollBarImageColor3=C.bord;SF.CanvasSize=UDim2.new(0,0,0,0)
  575. SF.AutomaticCanvasSize=Enum.AutomaticSize.Y;SF.ScrollingDirection=Enum.ScrollingDirection.Y
  576. SF.ZIndex=3;SF.Parent=MsgF;vlist(SF,6);padV(SF,7,7,7,7)
  577. local function scrollBot() task.defer(function() SF.CanvasPosition=Vector2.new(0,math.huge) end) end
  578.  
  579. local IA=Instance.new("Frame")
  580. IA.Size=UDim2.new(1,0,0,44);IA.Position=UDim2.new(0,0,1,-44);IA.BackgroundColor3=C.hdr
  581. IA.BorderSizePixel=0;IA.ZIndex=5;IA.Parent=Chat
  582. local IASep=Instance.new("Frame")
  583. IASep.Size=UDim2.new(1,0,0,1);IASep.BackgroundColor3=C.bord;IASep.BorderSizePixel=0;IASep.Parent=IA
  584. local IAGlow=Instance.new("Frame")
  585. IAGlow.Size=UDim2.new(1,0,0,1);IAGlow.Position=UDim2.new(0,0,1,-1);IAGlow.BackgroundColor3=C.acc
  586. IAGlow.BackgroundTransparency=0.5;IAGlow.BorderSizePixel=0;IAGlow.Parent=IA
  587. local TB=Instance.new("TextBox")
  588. TB.Size=UDim2.new(1,-50,0,28);TB.Position=UDim2.new(0,7,0.5,-14);TB.BackgroundColor3=C.surf2
  589. TB.Text="";TB.PlaceholderText=L.inputPH;TB.TextSize=12;TB.TextColor3=C.txt;TB.PlaceholderColor3=C.dim
  590. TB.Font=Enum.Font.Gotham;TB.TextXAlignment=Enum.TextXAlignment.Left;TB.ClearTextOnFocus=false
  591. TB.MultiLine=false;TB.TextWrapped=false;TB.ZIndex=8;TB.Parent=IA;rnd(TB,6)
  592. local TBStr=strk(TB,C.bord);padV(TB,0,6,0,6)
  593. TB.Focused:Connect(function() tw(TBStr,{Color=C.acc});tw(IAGlow,{BackgroundTransparency=0.05}) end)
  594. TB.FocusLost:Connect(function() tw(TBStr,{Color=C.bord});tw(IAGlow,{BackgroundTransparency=0.5}) end)
  595. local SndB=Instance.new("TextButton")
  596. SndB.Size=UDim2.new(0,36,0,28);SndB.Position=UDim2.new(1,-43,0.5,-14);SndB.BackgroundColor3=C.acc
  597. SndB.Text=">>";SndB.TextSize=13;SndB.TextColor3=Color3.fromRGB(0,0,0);SndB.Font=Enum.Font.GothamBold
  598. SndB.AutoButtonColor=false;SndB.ZIndex=8;SndB.Parent=IA;rnd(SndB,6)
  599. SndB.MouseEnter:Connect(function() tw(SndB,{BackgroundTransparency=0.2}) end)
  600. SndB.MouseLeave:Connect(function() tw(SndB,{BackgroundTransparency=0}) end)
  601.  
  602. -- ============================================================
  603. -- APLICAR IDIOMA
  604. -- ============================================================
  605. local function applyLang()
  606. L=LANGS[langIdx]
  607. local isGroq=PROVIDER=="groq"
  608. local provCol=isGroq and C.groq or C.cld
  609. -- Proveedor screen
  610. ChooseLbl.Text=L.chooseTitle
  611. GName.Text=L.groqName;GSub.Text=L.groqSub;GBadgeL.Text=L.groqBadge
  612. CName.Text=L.cldName;CSub.Text=L.cldSub;CBadgeL.Text=L.cldBadge
  613. -- Login
  614. LT2.Text=isGroq and L.subtitle_groq or L.subtitle_claude
  615. KLblL.Text=isGroq and L.keyLbl_groq or L.keyLbl_claude
  616. KDescL.Text=isGroq and L.keyDesc_groq or L.keyDesc_claude
  617. KInput.PlaceholderText=isGroq and L.keyPH_groq or L.keyPH_claude
  618. ConBtn.Text=L.conBtn;HelpBtnL.Text=L.helpBtnTxt
  619. BackBtn.Text="< "..L.backBtn
  620. -- Chat
  621. SLbl.Text=L.statusOn;SLbl.TextColor3=provCol
  622. SDot.BackgroundColor3=provCol;HGlow.BackgroundColor3=provCol
  623. WStroke.Color=provCol;ClrB.Text=L.clearBtn;TB.PlaceholderText=L.inputPH;LangB.Text=L.code
  624. -- Panel ayuda
  625. HPTitleL.Text=isGroq and L.helpTitle_groq or L.helpTitle_claude
  626. HPNoteL.Text=isGroq and L.helpNote_groq or L.helpNote_claude
  627. local steps=isGroq and L.helpSteps_groq or L.helpSteps_claude
  628. for i,stl in ipairs(HPStepLabels) do stl.Text=steps[i] or "" end
  629. -- Botones idioma highlight
  630. local function hl(btns)
  631. for i,lb in ipairs(btns) do
  632. local a=i==langIdx
  633. tw(lb,{BackgroundColor3=a and C.acc2 or C.surf2,TextColor3=a and Color3.fromRGB(0,0,0) or C.dim})
  634. lb:FindFirstChildWhichIsA("UIStroke").Color=a and C.acc2 or C.bord
  635. end
  636. end
  637. hl(PSLangBtns);hl(LoginLangBtns)
  638. end
  639.  
  640. -- ============================================================
  641. -- NAVEGACION
  642. -- ============================================================
  643. local function goToLogin(provider)
  644. PROVIDER=provider
  645. mIdx=1
  646. local models=provider=="groq" and GROQ_MODELS or CLAUDE_MODELS
  647. MODEL=models[1];MBtn.Text=(#MODEL>15) and MODEL:sub(1,14).."~" or MODEL
  648. applyLang()
  649. tw(ConBtn,{BackgroundColor3=provider=="groq" and C.groq or C.cld})
  650. tw(ProvScreen,{BackgroundTransparency=1},0.18)
  651. task.delay(0.2,function()
  652. ProvScreen.Visible=false;Login.Visible=true;Login.BackgroundTransparency=1
  653. tw(Login,{BackgroundTransparency=0},0.18)
  654. end)
  655. end
  656.  
  657. local function goToProvider()
  658. Login.Visible=false;ProvScreen.Visible=true;ProvScreen.BackgroundTransparency=1
  659. tw(ProvScreen,{BackgroundTransparency=0},0.18);tw(WStroke,{Color=C.acc})
  660. end
  661.  
  662. GroqCard.MouseButton1Click:Connect(function() goToLogin("groq") end)
  663. CldCard.MouseButton1Click:Connect(function() goToLogin("claude") end)
  664. BackBtn.MouseButton1Click:Connect(goToProvider)
  665.  
  666. for i,lb in ipairs(PSLangBtns) do lb.MouseButton1Click:Connect(function() langIdx=i;applyLang() end) end
  667. for i,lb in ipairs(LoginLangBtns) do lb.MouseButton1Click:Connect(function() langIdx=i;applyLang() end) end
  668. LangB.MouseButton1Click:Connect(function()
  669. langIdx=langIdx%#LANGS+1;applyLang()
  670. tw(LangB,{BackgroundColor3=C.acc2},0.07)
  671. task.delay(0.18,function() if LangB and LangB.Parent then tw(LangB,{BackgroundColor3=C.surf2},0.15) end end)
  672. end)
  673.  
  674. applyLang()
  675.  
  676. -- ============================================================
  677. -- BLOQUES CODIGO
  678. -- ============================================================
  679. local function mkCode(parent,code)
  680. local CF=Instance.new("Frame");CF.Size=UDim2.new(1,0,0,0);CF.AutomaticSize=Enum.AutomaticSize.Y
  681. CF.BackgroundColor3=C.code;CF.BorderSizePixel=0;CF.Parent=parent;rnd(CF,5)
  682. local CFS=strk(CF,C.bord)
  683. task.spawn(function()
  684. while CF and CF.Parent do
  685. tw(CFS,{Color=C.acc2,Transparency=0.35},0.9,Enum.EasingStyle.Sine);task.wait(1)
  686. tw(CFS,{Color=C.bord,Transparency=0},0.9,Enum.EasingStyle.Sine);task.wait(1)
  687. end
  688. end)
  689. vlist(CF,0)
  690. local CH=Instance.new("Frame");CH.Size=UDim2.new(1,0,0,22);CH.BackgroundColor3=C.hdr;CH.BorderSizePixel=0;CH.Parent=CF
  691. local CHSep=Instance.new("Frame");CHSep.Size=UDim2.new(1,0,0,1);CHSep.Position=UDim2.new(0,0,1,-1);CHSep.BackgroundColor3=C.bord;CHSep.BorderSizePixel=0;CHSep.Parent=CH
  692. local CLbl=Instance.new("TextLabel");CLbl.Size=UDim2.new(0,40,0,22);CLbl.Position=UDim2.new(0,6,0,0)
  693. CLbl.BackgroundTransparency=1;CLbl.Text="LUA";CLbl.TextSize=10;CLbl.TextColor3=C.acc2;CLbl.Font=Enum.Font.Code;CLbl.TextXAlignment=Enum.TextXAlignment.Left;CLbl.Parent=CH
  694. local CpB=Instance.new("TextButton");CpB.Size=UDim2.new(0,46,0,16);CpB.Position=UDim2.new(1,-98,0.5,-8)
  695. CpB.BackgroundColor3=C.surf2;CpB.Text=L.copyBtn;CpB.TextSize=9;CpB.TextColor3=C.dim;CpB.Font=Enum.Font.GothamBold
  696. CpB.AutoButtonColor=false;CpB.ZIndex=6;CpB.Parent=CH;rnd(CpB,4);strk(CpB)
  697. CpB.MouseEnter:Connect(function() tw(CpB,{TextColor3=C.acc}) end)
  698. CpB.MouseLeave:Connect(function() tw(CpB,{TextColor3=C.dim}) end)
  699. CpB.MouseButton1Click:Connect(function()
  700. pcall(function() setclipboard(code) end)
  701. CpB.Text=L.copiedBtn;tw(CpB,{TextColor3=C.green})
  702. task.delay(2,function() if CpB and CpB.Parent then CpB.Text=L.copyBtn;tw(CpB,{TextColor3=C.dim}) end end)
  703. end)
  704. local ExB=Instance.new("TextButton");ExB.Size=UDim2.new(0,38,0,16);ExB.Position=UDim2.new(1,-48,0.5,-8)
  705. ExB.BackgroundColor3=Color3.fromRGB(30,14,6);ExB.Text=L.execBtn;ExB.TextSize=9;ExB.TextColor3=C.acc2;ExB.Font=Enum.Font.GothamBold
  706. ExB.AutoButtonColor=false;ExB.ZIndex=6;ExB.Parent=CH;rnd(ExB,4);strk(ExB,C.acc2)
  707. ExB.MouseEnter:Connect(function() tw(ExB,{BackgroundColor3=Color3.fromRGB(55,24,8)}) end)
  708. ExB.MouseLeave:Connect(function() tw(ExB,{BackgroundColor3=Color3.fromRGB(30,14,6)}) end)
  709. ExB.MouseButton1Click:Connect(function()
  710. local ok,_=pcall(function() loadstring(code)() end)
  711. if ok then ExB.Text="OK";tw(ExB,{TextColor3=C.green});task.delay(2,function() if ExB and ExB.Parent then ExB.Text=L.execBtn;tw(ExB,{TextColor3=C.acc2}) end end)
  712. else ExB.Text="ERR";tw(ExB,{TextColor3=C.red});task.delay(3,function() if ExB and ExB.Parent then ExB.Text=L.execBtn;tw(ExB,{TextColor3=C.acc2}) end end) end
  713. end)
  714. local CC=Instance.new("TextLabel");CC.Size=UDim2.new(1,0,0,0);CC.AutomaticSize=Enum.AutomaticSize.Y;CC.BackgroundTransparency=1
  715. CC.Text=code;CC.TextSize=11;CC.TextColor3=Color3.fromRGB(155,205,235);CC.Font=Enum.Font.Code
  716. CC.TextXAlignment=Enum.TextXAlignment.Left;CC.TextYAlignment=Enum.TextYAlignment.Top;CC.TextWrapped=true;CC.Parent=CF;padV(CC,6,6,6,6)
  717. end
  718.  
  719. local function render(parent,text)
  720. local rem=text
  721. while true do
  722. local s,e,_,code=rem:find("```([a-zA-Z]*)\n?(.-)\n?```")
  723. if not s then
  724. local t=rem:match("^%s*(.-)%s*$")
  725. if t and #t>0 then
  726. local l=Instance.new("TextLabel");l.Size=UDim2.new(1,0,0,0);l.AutomaticSize=Enum.AutomaticSize.Y
  727. l.BackgroundTransparency=1;l.Text=t;l.TextSize=12;l.TextColor3=C.txt;l.Font=Enum.Font.Gotham
  728. l.TextXAlignment=Enum.TextXAlignment.Left;l.TextYAlignment=Enum.TextYAlignment.Top;l.TextWrapped=true;l.Parent=parent
  729. end;break
  730. end
  731. local bef=rem:sub(1,s-1):match("^%s*(.-)%s*$")
  732. if bef and #bef>0 then
  733. local l=Instance.new("TextLabel");l.Size=UDim2.new(1,0,0,0);l.AutomaticSize=Enum.AutomaticSize.Y
  734. l.BackgroundTransparency=1;l.Text=bef;l.TextSize=12;l.TextColor3=C.txt;l.Font=Enum.Font.Gotham
  735. l.TextXAlignment=Enum.TextXAlignment.Left;l.TextYAlignment=Enum.TextYAlignment.Top;l.TextWrapped=true;l.Parent=parent
  736. end
  737. mkCode(parent,code);rem=rem:sub(e+1)
  738. end
  739. end
  740.  
  741. local function addMsg(role,text)
  742. local isU=role=="user"
  743. local Row=Instance.new("Frame");Row.Size=UDim2.new(1,0,0,0);Row.AutomaticSize=Enum.AutomaticSize.Y;Row.BackgroundTransparency=1;Row.Parent=SF;vlist(Row,3)
  744. local WL=Instance.new("TextLabel");WL.Size=UDim2.new(1,0,0,11);WL.BackgroundTransparency=1
  745. WL.Text=isU and "TU" or "AI";WL.TextSize=9;WL.TextColor3=isU and C.acc or C.dim
  746. WL.Font=Enum.Font.GothamBold;WL.TextXAlignment=isU and Enum.TextXAlignment.Right or Enum.TextXAlignment.Left;WL.Parent=Row
  747. local Bub=Instance.new("Frame");Bub.Size=UDim2.new(isU and 0.88 or 0.97,0,0,0);Bub.AutomaticSize=Enum.AutomaticSize.Y
  748. Bub.AnchorPoint=isU and Vector2.new(1,0) or Vector2.new(0,0);Bub.Position=isU and UDim2.new(1,0,0,0) or UDim2.new(0,0,0,0)
  749. Bub.BackgroundColor3=isU and C.usrB or C.aiB;Bub.BorderSizePixel=0;Bub.Parent=Row
  750. rnd(Bub,7);strk(Bub,isU and Color3.fromRGB(0,80,115) or C.bord);pad(Bub,7);vlist(Bub,5)
  751. if isU then
  752. local l=Instance.new("TextLabel");l.Size=UDim2.new(1,0,0,0);l.AutomaticSize=Enum.AutomaticSize.Y
  753. l.BackgroundTransparency=1;l.Text=text;l.TextSize=12;l.TextColor3=C.txt;l.Font=Enum.Font.Gotham
  754. l.TextXAlignment=Enum.TextXAlignment.Left;l.TextYAlignment=Enum.TextYAlignment.Top;l.TextWrapped=true;l.Parent=Bub
  755. else render(Bub,text) end
  756. scrollBot()
  757. end
  758.  
  759. local TRow=nil
  760. local function showTyp()
  761. TRow=Instance.new("Frame");TRow.Size=UDim2.new(0,52,0,26);TRow.BackgroundColor3=C.aiB
  762. TRow.BorderSizePixel=0;TRow.ZIndex=3;TRow.Parent=SF;rnd(TRow,7);strk(TRow,C.bord)
  763. local inner=Instance.new("Frame");inner.Size=UDim2.new(1,0,1,0);inner.BackgroundTransparency=1;inner.Parent=TRow
  764. local il=Instance.new("UIListLayout");il.FillDirection=Enum.FillDirection.Horizontal
  765. il.HorizontalAlignment=Enum.HorizontalAlignment.Center;il.VerticalAlignment=Enum.VerticalAlignment.Center;il.Padding=UDim.new(0,4);il.Parent=inner
  766. for i=1,3 do
  767. local d=Instance.new("Frame");d.Size=UDim2.new(0,5,0,5);d.BackgroundColor3=C.acc;d.BorderSizePixel=0;d.Parent=inner;rnd(d,3)
  768. task.spawn(function()
  769. local dl=(i-1)*0.2
  770. while TRow and TRow.Parent do
  771. task.wait(dl);if not(TRow and TRow.Parent) then break end
  772. tw(d,{BackgroundTransparency=0.05},0.28);task.wait(0.32)
  773. if not(TRow and TRow.Parent) then break end
  774. tw(d,{BackgroundTransparency=0.85},0.28);task.wait(0.52)
  775. end
  776. end)
  777. end;scrollBot()
  778. end
  779. local function hideTyp() if TRow then TRow:Destroy();TRow=nil end end
  780.  
  781. -- ============================================================
  782. -- API CALL UNIFICADO
  783. -- ============================================================
  784. local function callAI(msg)
  785. table.insert(history,{role="user",content=msg})
  786. local msgs={{role="system",content=L.sys}}
  787. for _,m in ipairs(history) do table.insert(msgs,m) end
  788. local ok,res,dec,reply
  789. if PROVIDER=="groq" then
  790. local payload=HttpService:JSONEncode({model=MODEL,messages=msgs,max_tokens=MAX_TOKENS,temperature=0.7})
  791. ok,res=pcall(function() return httpRequest({Url="https://api.groq.com/openai/v1/chat/completions",Method="POST",Headers={["Content-Type"]="application/json",["Authorization"]="Bearer "..API_KEY},Body=payload}) end)
  792. if not ok then table.remove(history);return nil,"Red: "..tostring(res) end
  793. local ok2,e2=pcall(function() dec=HttpService:JSONDecode(res.Body) end)
  794. if not ok2 then table.remove(history);return nil,"JSON: "..tostring(e2) end
  795. if dec.error then table.remove(history);return nil,"Groq: "..(dec.error.message or "?") end
  796. reply=dec.choices and dec.choices[1] and dec.choices[1].message and dec.choices[1].message.content
  797. else
  798. local payload=HttpService:JSONEncode({model=MODEL,max_tokens=MAX_TOKENS,system=L.sys,messages=msgs})
  799. ok,res=pcall(function() return httpRequest({Url="https://api.anthropic.com/v1/messages",Method="POST",Headers={["Content-Type"]="application/json",["x-api-key"]=API_KEY,["anthropic-version"]="2023-06-01"},Body=payload}) end)
  800. if not ok then table.remove(history);return nil,"Red: "..tostring(res) end
  801. local ok2,e2=pcall(function() dec=HttpService:JSONDecode(res.Body) end)
  802. if not ok2 then table.remove(history);return nil,"JSON: "..tostring(e2) end
  803. if dec.error then table.remove(history);return nil,"Claude: "..(dec.error.message or "?") end
  804. reply=dec.content and dec.content[1] and dec.content[1].text
  805. end
  806. if not reply then table.remove(history);return nil,"Respuesta vacia" end
  807. table.insert(history,{role="assistant",content=reply})
  808. if #history>18 then local h={};for i=#history-14,#history do h[#h+1]=history[i] end;history=h end
  809. return reply,nil
  810. end
  811.  
  812. -- ============================================================
  813. -- SEND
  814. -- ============================================================
  815. local function doSend()
  816. if waiting then return end
  817. local t=TB.Text:match("^%s*(.-)%s*$");if #t==0 then return end
  818. TB.Text="";waiting=true;SndB.Text="..";tw(SndB,{BackgroundColor3=C.surf2})
  819. tw(SDot,{BackgroundColor3=C.acc2});SLbl.Text=L.statusWait;SLbl.TextColor3=C.acc2
  820. addMsg("user",t);showTyp()
  821. task.spawn(function()
  822. local rep,err=callAI(t);hideTyp()
  823. addMsg("ai",err and (L.errPfx..err) or rep)
  824. waiting=false;SndB.Text=">>";tw(SndB,{BackgroundColor3=C.acc})
  825. local provCol=PROVIDER=="groq" and C.groq or C.cld
  826. tw(SDot,{BackgroundColor3=provCol});SLbl.Text=L.statusOn;SLbl.TextColor3=provCol
  827. end)
  828. end
  829. SndB.MouseButton1Click:Connect(doSend)
  830. TB.FocusLost:Connect(function(enter) if enter then doSend() end end)
  831. ClrB.MouseButton1Click:Connect(function()
  832. history={};for _,v in pairs(SF:GetChildren()) do if v:IsA("Frame") then v:Destroy() end end
  833. addMsg("ai",L.clearMsg)
  834. end)
  835.  
  836. -- ============================================================
  837. -- DRAG
  838. -- ============================================================
  839. local drag,dragSt,winSt=false
  840. Hdr.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=true;dragSt=i.Position;winSt=Win.Position end end)
  841. Hdr.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=false end end)
  842. for _,b in pairs({MinB,ClsB,SndB}) do b.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=false end end) end
  843. UserInputService.InputChanged:Connect(function(i) if drag and i.UserInputType==Enum.UserInputType.MouseMovement and dragSt then local d=i.Position-dragSt;Win.Position=UDim2.new(winSt.X.Scale,winSt.X.Offset+d.X,winSt.Y.Scale,winSt.Y.Offset+d.Y) end end)
  844. UserInputService.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=false end end)
  845.  
  846. -- ============================================================
  847. -- MIN / CLOSE
  848. -- ============================================================
  849. local FBtn=Instance.new("TextButton")
  850. FBtn.Size=UDim2.new(0,38,0,38);FBtn.Position=UDim2.new(1,-50,1,-50);FBtn.BackgroundColor3=C.acc
  851. FBtn.Text="AI";FBtn.TextSize=12;FBtn.TextColor3=Color3.fromRGB(0,0,0);FBtn.Font=Enum.Font.GothamBold
  852. FBtn.AutoButtonColor=false;FBtn.Visible=false;FBtn.ZIndex=100;FBtn.Parent=SG;rnd(FBtn,19);strk(FBtn,C.acc,2)
  853. task.spawn(function()
  854. while FBtn and FBtn.Parent do
  855. if FBtn.Visible then tw(FBtn,{BackgroundTransparency=0.1},0.7,Enum.EasingStyle.Sine);task.wait(0.8);tw(FBtn,{BackgroundTransparency=0.35},0.7,Enum.EasingStyle.Sine);task.wait(0.8) else task.wait(0.4) end
  856. end
  857. end)
  858. FBtn.MouseEnter:Connect(function() tw(FBtn,{BackgroundTransparency=0}) end)
  859. FBtn.MouseLeave:Connect(function() tw(FBtn,{BackgroundTransparency=0.1}) end)
  860.  
  861. local function openWin() opened=true;Win.Visible=true;Win.Size=UDim2.new(0,280,0,0);tw(Win,{Size=UDim2.new(0,280,0,380)},0.22,Enum.EasingStyle.Back,Enum.EasingDirection.Out);FBtn.Visible=false end
  862. local function closeWin() opened=false;tw(Win,{Size=UDim2.new(0,280,0,0)},0.16);task.delay(0.18,function() Win.Visible=false;FBtn.Visible=true end) end
  863. MinB.MouseButton1Click:Connect(function() if opened then closeWin() else openWin() end end)
  864. FBtn.MouseButton1Click:Connect(openWin)
  865. ClsB.MouseButton1Click:Connect(function() tw(Win,{Size=UDim2.new(0,280,0,0),BackgroundTransparency=1},0.16);task.delay(0.18,function() SG:Destroy() end) end)
  866.  
  867. -- ============================================================
  868. -- INICIO
  869. -- ============================================================
  870. local function abrirChat()
  871. Login.Visible=false;Chat.Visible=true
  872. addMsg("ai",PROVIDER=="groq" and L.startMsg_groq or L.startMsg_claude)
  873. end
  874.  
  875. ConBtn.MouseButton1Click:Connect(function()
  876. local k=KInput.Text:match("^%s*(.-)%s*$")
  877. if #k<10 then ELbl.Text=L.errMsg;return end
  878. API_KEY=k;ELbl.Text="";tw(Login,{BackgroundTransparency=1},0.18);task.delay(0.2,abrirChat)
  879. end)
  880.  
  881. ProvScreen.Visible=true;Login.Visible=false;Chat.Visible=false
  882. print("[DeltaAI v8] by:zyren | Groq + Claude")
  883.  
Advertisement
Add Comment
Please, Sign In to add comment