yeoyeoyeoyayaya

Untitled

Mar 5th, 2023
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.06 KB | None | 0 0
  1. local services = setmetatable({}, { __index = function(self, key) return game:GetService(key) end })
  2. local client = services.Players.LocalPlayer;
  3.  
  4. local request = request or http_request
  5. if type(syn) == 'table' and type(syn.request) == 'function' then
  6. request = syn.request
  7. end
  8.  
  9. local KickClient, LoadFromGithub do
  10. function KickClient(reason)
  11. return client:Kick(reason)
  12. end
  13.  
  14. local function GetUrl(url)
  15. local response = request({ Url = url, Method = 'GET' })
  16.  
  17. local success = response.Success;
  18. local body = response.Body;
  19.  
  20. if not success then
  21. return false, 'Request failed. StatusCode: ' .. response.StatusCode
  22. end
  23.  
  24. return true, body
  25. end
  26.  
  27. function LoadFromGithub(owner, repo, file)
  28. local url = 'https://raw.githubusercontent.com/' .. owner .. '/' .. repo .. '/main/' .. file
  29. local success, body = GetUrl(url)
  30.  
  31. if not success then
  32. return KickClient('Failed to fetch from github. ' .. table.concat({ 'Url:', url, '\n', 'Error:', tostring(body) }))
  33. end
  34.  
  35. local fn, err = loadstring(body)
  36. if not fn then
  37. return KickClient('Failed to load from github. ' .. table.concat({ 'Url:', url, '\n', 'Error:', tostring(err) }))
  38. end
  39.  
  40. local results = { pcall(fn) }
  41. local success = table.remove(results, 1)
  42.  
  43. if not success then
  44. return KickClient('Failed to execute from github. ' .. table.concat({ 'Url:', url, '\n', 'Error:', tostring(results[1]) }))
  45. end
  46.  
  47. return unpack(results)
  48. end
  49. end
  50.  
  51. local ESP = LoadFromGithub('Kiriot22', 'ESP-lib', 'ESP.lua')
  52. local UI = LoadFromGithub('wally-rblx', 'LinoriaLib', 'Library.lua')
  53.  
  54. local ThemeManager = LoadFromGithub('wally-rblx', 'LinoriaLib', 'addons/ThemeManager.lua')
  55. local SaveManager = LoadFromGithub('wally-rblx', 'LinoriaLib', 'addons/SaveManager.lua')
  56.  
  57. -- Library addons
  58. SaveManager:IgnoreThemeSettings()
  59. ThemeManager:SetLibrary(UI)
  60. ThemeManager:SetFolder('frontlines-cheat')
  61. SaveManager:SetFolder('frontlines-cheat')
  62.  
  63. -- Utility functions
  64. local globals = getrenv()._G.globals;
  65. local utils = getrenv()._G.utils;
  66. local enums = getrenv()._G.enums;
  67.  
  68. local event_enum = utils.gbus.EVENT_ENUM
  69.  
  70. local global_sol_state = globals.gbl_sol_state
  71. local fpv_sol_recoil = globals.fpv_sol_recoil
  72. local fpv_sol_spread = globals.fpv_sol_spread
  73. local fpv_sol_equipment = globals.fpv_sol_equipment
  74. local fpv_sol_multipliers = globals.fpv_sol_multipliers
  75.  
  76. local sol_state_class = enums.sol_state_class;
  77. local sol_firearm_operation = enums.sol_firearm_operation;
  78. local sol_time_sequence_value = enums.sol_time_sequence_value;
  79.  
  80. local getCharacter, getTeam, getHealth, getPlayerFromChar do
  81. local function getPlayerSolId(player)
  82. for idx, plr in next, globals.cli_plrs do
  83. if player == plr then
  84. return idx
  85. end
  86. end
  87. end
  88.  
  89. function getCharacter(player)
  90. local id = getPlayerSolId(player)
  91. if not id then return end
  92.  
  93. return global_sol_state.r15_models[id]
  94. end
  95.  
  96. function getTeam(player)
  97. local id = getPlayerSolId(player)
  98. if not id then return end
  99.  
  100. return globals.cli_teams[id]
  101. end
  102.  
  103. function getHealth(player)
  104. local id = getPlayerSolId(player)
  105. if not id then return 0 end
  106.  
  107. local health = globals.gbl_sol_healths[id]
  108. if not health then return 0 end
  109.  
  110. return health
  111. end
  112.  
  113. function getPlayerFromChar(character)
  114. for id, model in next, global_sol_state.r15_models do
  115. if model == character then
  116. return globals.cli_plrs[id]
  117. end
  118. end
  119. end
  120. end
  121.  
  122. -- Aimbot target selection
  123. local aimbot = {} do
  124. local function isInCircle(point, center, radius)
  125. local rX = point.x - center.x
  126. local rY = point.y - center.y
  127.  
  128. return (rX*rX) + (rY*rY) <= radius*radius
  129. end
  130.  
  131. local circle = Drawing.new('Circle')
  132. circle.Position = Vector2.new()
  133. circle.Color = Color3.new(1, 1, 1)
  134. circle.Thickness = 1;
  135. circle.NumSides = 24;
  136. circle.Transparency = 1;
  137. circle.Visible = false;
  138.  
  139. function aimbot.UpdateCircleState(value)
  140. if type(value) == 'number' then circle.Radius = value end
  141. if type(value) == 'boolean' then circle.Visible = value end
  142. if typeof(value) == 'Color3' then circle.Color = value end
  143. end
  144.  
  145. services.RunService.Heartbeat:Connect(function(dt)
  146. local center = workspace.CurrentCamera.ViewportSize / 2
  147. circle.Position = center
  148.  
  149. local clientCharacter = getCharacter(client)
  150. local clientHealth = getHealth(client)
  151. local clientTeam = getTeam(client)
  152.  
  153. if not clientCharacter then return end
  154. if clientHealth <= 0 then return end
  155.  
  156. local Choices = {}
  157. for _, plr in next, services.Players:GetPlayers() do
  158. if plr == client then continue end
  159.  
  160. local character = getCharacter(plr)
  161. local health = getHealth(plr)
  162. local team = getTeam(plr)
  163.  
  164. local bone = character and character:findFirstChild('Head')
  165. if health > 0 and character and team ~= clientTeam and bone then
  166. local pos, vis = workspace.CurrentCamera:WorldToViewportPoint(bone.Position)
  167. if not vis then continue end
  168.  
  169. local screenPos = Vector2.new(pos.X, pos.Y)
  170. if Toggles.ShowCircle and Toggles.ShowCircle.Value and (not isInCircle(screenPos, center, circle.Radius)) then
  171. continue
  172. end
  173.  
  174. local distance = math.floor((screenPos - center).magnitude)
  175. table.insert(Choices, {
  176. Player = plr,
  177. Distance = distance,
  178. Character = character,
  179. })
  180. end
  181. end
  182.  
  183. table.sort(Choices, function(a, b)
  184. return a.Distance < b.Distance
  185. end)
  186.  
  187. local choice = Choices[1]
  188. if choice then
  189. local plr = choice.Player;
  190.  
  191. aimbot.target = plr;
  192. ESP.Highlighted = choice.Character
  193. else
  194. aimbot.target = nil;
  195. ESP.Highlighted = nil
  196. end
  197. end)
  198. end
  199.  
  200. -- visuals
  201. do
  202. ESP:Toggle(false);
  203.  
  204. ESP.Players = true
  205. ESP.FaceCamera = false;
  206. ESP.TeamMates = false;
  207. ESP.Names = false;
  208. ESP.Tracers = false;
  209. ESP.Boxes = false;
  210.  
  211. ESP.HighlightColor = Color3.new(1, 1, 1)
  212. ESP.Overrides.GetTeam = getTeam
  213. -- ESP.Overrides.GetPlrFromChar = getPlayerFromChar
  214.  
  215. function ESP.Overrides.UpdateAllow(self)
  216. if self.Player then
  217. local clientCharacter = getCharacter(client)
  218. local pHealth = getHealth(self.Player)
  219.  
  220. if not clientCharacter or not clientCharacter.Parent then
  221. return false
  222. end
  223.  
  224. if pHealth <= 0 then
  225. return false
  226. end
  227. end
  228. return true
  229. end
  230.  
  231. local function GetTeamColor(self)
  232. local player = self.Player;
  233. local IsSameTeam = ESP:IsTeamMate(player)
  234.  
  235. if Toggles.HighlightTarget and Toggles.HighlightTarget.Value then
  236. if player == aimbot.target then
  237. return Options.HighlightColor.Value
  238. end
  239. end
  240.  
  241. if IsSameTeam then return Options.AllyColor.Value end
  242. return Options.EnemyColor.Value
  243. end
  244.  
  245. for _, plr in next, services.Players:GetPlayers() do
  246. if plr == client then continue end
  247.  
  248. local character = getCharacter(plr)
  249. if character then
  250. ESP:Add(character, { Name = plr.Name, Player = plr, PrimaryPart = character:WaitForChild('HumanoidRootPart', 10), ColorDynamic = GetTeamColor })
  251. end
  252. end
  253.  
  254. local function onModelAdded(model)
  255. local plr = getPlayerFromChar(model)
  256. if not plr then return end
  257. if plr == client then return end
  258.  
  259. ESP:Add(model, { Name = plr.Name, Player = plr, PrimaryPart = model:WaitForChild('HumanoidRootPart', 10), ColorDynamic = GetTeamColor })
  260. end
  261.  
  262. workspace.ChildAdded:Connect(function(object)
  263. if object.Name == 'r15_rig' then
  264. task.defer(onModelAdded, object)
  265. end
  266. end)
  267. end
  268.  
  269. -- game modifications
  270. do
  271. local spread = fpv_sol_spread.spread
  272. local attitude_delta = fpv_sol_recoil.attitude_delta
  273.  
  274. setmetatable(fpv_sol_spread, {
  275. __index = function(self, key)
  276. if key == 'spread' then
  277. if Toggles.NoSpread and Toggles.NoSpread.Value then return 0 end
  278. return spread
  279. end
  280. return rawget(self, key)
  281. end,
  282. __newindex = function(self, key, value)
  283. if key == 'spread' then spread = value; return end
  284. rawset(self, key, value)
  285. end
  286. })
  287.  
  288. setmetatable(fpv_sol_recoil, {
  289. __index = function(self, key)
  290. if key == 'attitude_delta' then
  291. if Toggles.NoRecoil and Toggles.NoRecoil.Value then return Vector3.new() end
  292. return attitude_delta
  293. end
  294. return rawget(self, key)
  295. end,
  296. __newindex = function(self, key, value)
  297. if key == 'attitude_delta' then attitude_delta = value; return end
  298. rawset(self, key, value)
  299. end
  300. })
  301.  
  302. rawset(fpv_sol_spread, 'spread', nil)
  303. rawset(fpv_sol_recoil, 'attitude_delta', nil)
  304.  
  305. local function ApplyWeaponMods(equipment)
  306. local reload_params = equipment.reload_params
  307. local recoil_params = equipment.recoil_params
  308.  
  309. local aim_sway_params = equipment.aim_sway_params
  310. local time_sequences = equipment.time_sequences
  311.  
  312. if not reload_params or not aim_sway_params then return end
  313.  
  314. local function applyProxyMetatable(tbl, events)
  315. if getmetatable(tbl) then return end
  316.  
  317. local cache = {}
  318. for key in next, events do
  319. cache[key] = tbl[key]
  320. end
  321.  
  322. setmetatable(tbl, {
  323. __index = function(self, key)
  324. local fn = events[key]
  325. if fn and cache[key] then
  326. local result = fn(cache[key])
  327. if result then
  328. return result
  329. end
  330. return cache[key]
  331. end
  332. return rawget(self, key)
  333. end,
  334. __newindex = function(self, key, value)
  335. if events[key] then
  336. cache[key] = value
  337. return
  338. end
  339. rawset(self, key, value)
  340. end
  341. })
  342.  
  343. for key in next, events do
  344. rawset(tbl, key, nil)
  345. end
  346. end
  347.  
  348. local function SpoofReloadTime(old)
  349. if Toggles.NoReload and Toggles.NoReload.Value then
  350. return 0.01
  351. end
  352. end
  353.  
  354. local function SpoofReloadVector(old)
  355. if Toggles.NoReload and Toggles.NoReload.Value then
  356. return { Vector3.new(0, sol_time_sequence_value.AMMO_IN), Vector3.new(0.01, sol_time_sequence_value.END), }
  357. end
  358. end
  359.  
  360. local function SpoofFireRate(old)
  361. if Toggles.FastFire and Toggles.FastFire.Value then
  362. return old * Options.FastFireMult.Value
  363. end
  364. end
  365.  
  366. applyProxyMetatable(reload_params, {
  367. dry_reload_duration = SpoofReloadTime,
  368. tac_reload_duration = SpoofReloadTime,
  369. })
  370.  
  371. applyProxyMetatable(time_sequences, {
  372. [Vector3.new(sol_state_class.FIREARM_OPERATION, sol_firearm_operation.TAC_RELOAD)] = SpoofReloadVector,
  373. [Vector3.new(sol_state_class.FIREARM_OPERATION, sol_firearm_operation.DRY_RELOAD)] = SpoofReloadVector,
  374.  
  375. [Vector3.new(sol_state_class.FIREARM_OPERATION, sol_firearm_operation.TAC_RELOAD_START)] = SpoofReloadVector,
  376. [Vector3.new(sol_state_class.FIREARM_OPERATION, sol_firearm_operation.DRY_RELOAD_START)] = SpoofReloadVector,
  377.  
  378. [Vector3.new(sol_state_class.FIREARM_OPERATION, sol_firearm_operation.RELOAD_INCR)] = SpoofReloadVector,
  379. [Vector3.new(sol_state_class.FIREARM_OPERATION, sol_firearm_operation.RELOAD_END)] = SpoofReloadVector,
  380. })
  381.  
  382. applyProxyMetatable(fpv_sol_multipliers, {
  383. fire_rate = SpoofFireRate,
  384. })
  385. end
  386.  
  387. if fpv_sol_equipment.curr_equipment then
  388. ApplyWeaponMods(fpv_sol_equipment.curr_equipment)
  389. end
  390.  
  391. local friendly_params
  392. local enemy_params
  393.  
  394. local OldTrigEvent = nil
  395. local function TrigEventProxy(event, ...)
  396. local args = { ... }
  397.  
  398. if event == event_enum.FPV_SOL_BULLET_SPAWN then
  399. local stack = debug.getstack(3)
  400.  
  401. local discharge_params = nil
  402. for idx, obj in next, stack do
  403. if type(obj) == 'table' and type(rawget(obj, 'fire_params')) == 'table' then
  404. discharge_params = obj;
  405. break
  406. end
  407. end
  408.  
  409. if Toggles.SilentAim.Value and aimbot.target and discharge_params then
  410. local character = getCharacter(aimbot.target)
  411. local bone = character and character:findFirstChild('Head')
  412.  
  413. if bone then
  414. local fire_params = discharge_params.fire_params
  415. local fire_multipliers = discharge_params.fire_multipliers
  416. local velocity = fire_params.muzzle_velocity * fire_multipliers.muzzle_velocity;
  417. local velocity_mult = Toggles.BulletVelocity.Value and Options.BulletVelocityMult.Value or 1
  418.  
  419. args[4] = CFrame.lookAt(args[3], bone.CFrame.p).lookVector * (velocity * velocity_mult)
  420. end
  421. end
  422.  
  423. if friendly_params and enemy_params then
  424. friendly_params.FilterDescendantsInstances = Toggles.Wallbang.Value and { workspace:findFirstChild('workspace') } or {}
  425. enemy_params.FilterDescendantsInstances = Toggles.Wallbang.Value and { workspace:findFirstChild('workspace') } or {}
  426. end
  427. elseif event == event_enum.FPV_SOL_EQUIP then
  428. ApplyWeaponMods(fpv_sol_equipment.curr_equipment)
  429. end
  430.  
  431. return OldTrigEvent(event, unpack(args))
  432. end
  433.  
  434. OldTrigEvent = hookfunction(utils.gbus.trig_event, function(...)
  435. return TrigEventProxy(...)
  436. end)
  437.  
  438. -- hookfunction didn't work here :(
  439. local OldEvalUdho = utils.math_util.eval_udho
  440. local function EvalUdhoProxy(...)
  441. if Toggles.NoRecoil and Toggles.NoRecoil.Value and debug.info(2, 's'):find('recoil_anim') then
  442. return 0, 0
  443. end
  444. return OldEvalUdho(...)
  445. end
  446. utils.math_util.eval_udho = EvalUdhoProxy
  447.  
  448. local spawn_bullet = nil;
  449.  
  450. for _, fn in next, getgc() do
  451. if type(fn) == 'function' then
  452. if islclosure(fn) and (not is_synapse_function(fn)) then
  453. local upvalues = getupvalues(fn)
  454. for _, upv in next, upvalues do
  455. if upv == OldEvalUdho then
  456. setupvalue(fn, _, EvalUdhoProxy)
  457. end
  458. end
  459.  
  460. if getinfo(fn).name == 'spawn_bullet' then
  461. spawn_bullet = fn
  462. end
  463. end
  464. end
  465. end
  466.  
  467. if spawn_bullet then
  468. friendly_params = getupvalue(spawn_bullet, 5)
  469. enemy_params = getupvalue(spawn_bullet, 7)
  470. end
  471. end
  472.  
  473. local window = UI:CreateWindow('Frontlines') do
  474. local tMain = window:AddTab('Main')
  475.  
  476. local gAimbot = tMain:AddLeftGroupbox('Silent aim')
  477. local gVisuals = tMain:AddRightGroupbox('Visuals')
  478.  
  479. do
  480. gAimbot:AddToggle('SilentAim', { Text = 'Silent aim' })
  481. gAimbot:AddToggle('Wallbang', { Text = 'Wallbang' })
  482.  
  483. gAimbot:AddToggle('ShowCircle', { Text = 'Show circle' }):AddColorPicker('CircleColor', { Default = Color3.new(1, 1, 1) })
  484. gAimbot:AddSlider('CircleRadius', { Text = 'Circle radius', Min = 0, Max = 300, Default = 0, Rounding = 0 })
  485. gAimbot:AddToggle('HighlightTarget', { Text = 'Highlight target' }):AddColorPicker('HighlightColor', { Default = Color3.new(1, 1, 1) })
  486.  
  487. gVisuals:AddToggle('ESPEnabled', { Text = 'Enabled' })
  488. gVisuals:AddDropdown('ESPFlags', { Text = 'ESP Flags', Multi = true, Values = { 'Names', 'Boxes', 'Tracers', } })
  489. gVisuals:AddDropdown('ESPOptions', { Text = 'ESP Options', Multi = true, Values = { 'Show team', 'Face camera' } })
  490.  
  491. gVisuals:AddLabel('Player colors')
  492. :AddColorPicker('AllyColor', { Default = Color3.fromRGB(0, 255, 140), Title = 'Ally color' })
  493. :AddColorPicker('EnemyColor', { Default = Color3.fromRGB(255, 25, 25), Title = 'Enemy color' });
  494.  
  495. Toggles.ShowCircle:OnChanged(function() aimbot.UpdateCircleState(Toggles.ShowCircle.Value) end)
  496. Options.CircleColor:OnChanged(function() aimbot.UpdateCircleState(Options.CircleColor.Value) end)
  497. Options.CircleRadius:OnChanged(function() aimbot.UpdateCircleState(Options.CircleRadius.Value) end)
  498.  
  499. Toggles.ESPEnabled:OnChanged(function() ESP:Toggle(Toggles.ESPEnabled.Value) end)
  500. Options.ESPFlags:OnChanged(function()
  501. local map = Options.ESPFlags.Value
  502.  
  503. ESP.Names = map.Names or false
  504. ESP.Boxes = map.Boxes or false
  505. ESP.Tracers = map.Tracers or false
  506. end)
  507.  
  508. Options.ESPOptions:OnChanged(function()
  509. local map = Options.ESPOptions.Value
  510.  
  511. ESP.FaceCamera = map['Face camera'] or false
  512. ESP.TeamMates = map['Show team'] or false
  513. end)
  514. end
  515.  
  516. local gModifications = tMain:AddLeftTabbox()
  517. local tWeapons = gModifications:AddTab('Weapons')
  518.  
  519. do
  520. tWeapons:AddToggle('NoSpread', { Text = 'No spread' })
  521. tWeapons:AddToggle('NoRecoil', { Text = 'No recoil' })
  522. tWeapons:AddToggle('NoReload', { Text = 'Instant reload' })
  523. tWeapons:AddToggle('FastFire', { Text = 'Fire rate' })
  524. tWeapons:AddSlider('FastFireMult', { Text = 'Fire rate multiplier', Min = 1, Max = 2, Rounding = 1, Default = 1 })
  525.  
  526. tWeapons:AddToggle('BulletVelocity', { Text = 'Increased bullet velocity' })
  527. tWeapons:AddSlider('BulletVelocityMult', { Text = 'Velocity multiplier', Min = 1, Max = 2, Rounding = 1, Default = 1 })
  528. end
  529.  
  530. local tSettings = window:AddTab('UI Settings') do
  531. ThemeManager:ApplyToTab(tSettings)
  532.  
  533. local tSaveSettings = tSettings:AddRightGroupbox('Save settings')
  534. local tCredits = tSettings:AddRightGroupbox('Credits')
  535.  
  536. tSaveSettings:AddButton('Save settings', function()
  537. if SaveManager:Save('Default') then
  538. UI:Notify('Saved settings!', 2)
  539. else
  540. UI:Notify('Failed to save settings', 2)
  541. end
  542. end)
  543. tSaveSettings:AddButton('Load settings', function()
  544. if SaveManager:Load('Default') then
  545. UI:Notify('Loaded settings!', 2)
  546. else
  547. UI:Notify('Failed to save settings', 2)
  548. end
  549. end)
  550.  
  551. tCredits:AddLabel('wally - Script')
  552. tCredits:AddLabel('Inori - UI library')
  553. tCredits:AddLabel('Kiriot22 - ESP library')
  554.  
  555. tCredits:AddButton('Copy discord invite', function()
  556. if pcall(setclipboard, 'https://wally.cool/discord') then
  557. UI:Notify('Copied discord invite!', 3)
  558. else
  559. UI:Notify('Failed to copy discord invite!', 3)
  560. end
  561. end)
  562. end
  563. end
  564.  
  565. UI:Notify('Frontlines script loaded!', 3)
  566. UI:Notify('Press RightControl to open the menu!', 3)
Add Comment
Please, Sign In to add comment