Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Join the discord for suggestions / updates to future versions
- -- https://discord.gg/56Wr5TDM5t
- -- The auto mob is very buggy and doesnt work atm so I recommend not using it.
- -- Some shops will kick you im not sure which tell me in discord which shop kicks you.
- -- // GLOBALS
- getgenv().connections = connections or {}
- -- // VARIABLES
- local player = game.Players.LocalPlayer
- local enemiesWs = workspace.Enemies
- local oresWs = workspace.Harvestables.Ores
- local chestSpawnsWs = workspace.ChestSpawnLocations
- local areaZonesWs = workspace.Area_Hitboxes
- local shrinesWs = workspace.NewStatues
- local shopsWs = workspace.Shops
- local enemiesRs = game:GetService("ReplicatedStorage").Enemy
- local receiveDamageRm = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Damage")
- local combatTriggerRm = workspace:WaitForChild("Enemies"):WaitForChild("Grassy Fields"):WaitForChild("Enemy"):WaitForChild("CombatTrigger")
- local itemSetupRm = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("ItemSetup")
- local healRm = game:GetService("ReplicatedStorage").Remotes.Heal
- -- // FUNCTIONS
- do -- [[ GENERAL HELPERS ]]
- function movePlrToPosition(part, amountOfTime)
- local hrp = player.Character.HumanoidRootPart
- local newVelocity = Instance.new('LinearVelocity')
- local dis = (hrp.Position - part.Position).Magnitude
- newVelocity.MaxForce = math.huge
- newVelocity.Attachment0 = hrp.RootAttachment
- newVelocity.VectorVelocity = (part.Position - hrp.Position).Unit * 70
- newVelocity.Parent = hrp
- repeat
- newVelocity.VectorVelocity = (part.Position - hrp.Position).Unit * 70
- task.wait()
- until part == nil or part.Parent == nil or not Toggles['MOBS_AUTOFARM'].Value
- newVelocity:Destroy()
- end
- end
- do -- [[ FETCHER HELPERS ]]
- function getInventoryData(plr)
- plr = plr or player
- end
- function getAllMobTypes()
- local tbl = {}
- for _, folder in enemiesRs:GetChildren() do
- if not folder:IsA('Folder') then continue end
- for _, mobModel in folder:GetChildren() do
- table.insert(tbl, mobModel.Name)
- end
- end
- return tbl
- end
- function getAllZones(stringArrayBool)
- local t = {}
- for _, areaPart in areaZonesWs:GetChildren() do
- table.insert(t, areaPart.Name)
- end
- if stringArrayBool then
- return t
- else
- return areaZonesWs:GetChildren()
- end
- end
- function getInstanceChildrenAsArray(instance, ofInstanceType, excludedStrArray)
- local t = {}
- for _, child in instance:GetChildren() do
- if ofInstanceType ~= nil then
- if not child:IsA(ofInstanceType) then continue end
- end
- if excludedStrArray ~= nil then
- if table.find(excludedStrArray, child.Name) then continue end
- end
- table.insert(t, child.Name)
- end
- return t
- end
- end
- do -- [[ AUTOFARMS ]]
- function initMobAutoFarm()
- --This will initialize the autofarm, and will listen to a value changed event.
- Toggles['MOBS_AUTOFARM']:OnChanged(function()
- local bool = Toggles['MOBS_AUTOFARM'].Value
- print(bool)
- if bool then
- local whitelistedMobs = Options.MOBS_WHITELIST.Value
- for _, enemyModelFolder in enemiesWs:GetChildren() do
- if not enemyModelFolder:IsA('Folder') then continue end
- for _, enemyModel in enemyModelFolder:GetChildren() do
- if not enemyModel:IsA('Model') then continue end
- if not whitelistedMobs[tostring(enemyModel.Model.Value)] then continue end
- local combatFolder = nil
- local orbsFolder = nil
- --warn(enemyModel.Model.Value)
- repeat
- player.Character:PivotTo(enemyModel.WorldPivot)
- task.wait(.05)
- until game.Workspace:FindFirstChild('CombatFolder') ~= nil or not Toggles['MOBS_AUTOFARM'].Value
- --rconsoleprint('Got CombatFolder')
- combatFolder = game.Workspace.CombatFolder
- orbsFolder = combatFolder:WaitForChild(player.Name)
- repeat
- if #orbsFolder:GetChildren() == 0 then
- --player.Character:PivotTo(enemyModel.WorldPivot * CFrame.new(0,20,0))
- end
- for _, orb in orbsFolder:GetChildren() do
- repeat task.wait() until orb.PrimaryPart ~= nil
- movePlrToPosition(orb.PrimaryPart, 2)
- --player.Character:PivotTo(orb.WorldPivot)
- repeat
- task.wait(.1)
- --player.Character:PivotTo(orb.WorldPivot)
- until orb == nil or orb.Parent == nil
- end
- task.wait(.05)
- until enemyModel == nil or enemyModel.Parent == nil or combatFolder == nil or not Toggles['MOBS_AUTOFARM'].Value
- end
- end
- end
- end)
- end
- function initOreAutoFarm()
- --This will initialize the autofarm, and will listen to a value changed event.
- local function getMineableOres()
- local amountMineable = 0
- for _, ore in oresWs:GetChildren() do
- if not Options['ORES_DROPDOWN'].Value[ore.Name] then continue end
- if ore.HasOre.Value == true then amountMineable += 1 end
- end
- return amountMineable
- end
- local function getClosestOre()
- local closestOre, closestDis = nil, math.huge
- for _, ore in oresWs:GetChildren() do
- if not Options['ORES_DROPDOWN'].Value[ore.Name] then continue end
- if ore.HasOre.Value == false then continue end
- local mag = (player.Character.PrimaryPart.Position - ore.Position).Magnitude
- if mag < closestDis then
- closestDis = mag
- closestOre = ore
- end
- end
- return closestOre
- end
- Toggles['ORES_AUTOFARM']:OnChanged(function()
- local bool = Toggles['ORES_AUTOFARM'].Value
- print(bool)
- if bool then
- itemSetupRm:FireServer('Silver Pickaxe')
- itemSetupRm:FireServer('Titanium Pickaxe')
- local lastLoggedCFrame = player.Character.PrimaryPart.CFrame
- repeat
- local closestOre = getClosestOre()
- local proxPrompt = closestOre:FindFirstChildWhichIsA('ProximityPrompt')
- repeat
- player.Character:PivotTo(closestOre.CFrame)
- fireproximityprompt(proxPrompt)
- task.wait(.1)
- until closestOre.HasOre.Value == false or not Toggles['ORES_AUTOFARM'].Value
- task.wait(.05)
- until not Toggles['ORES_AUTOFARM'].Value
- --warn('Finalized Ores Autofarm')
- player.Character:PivotTo(lastLoggedCFrame * CFrame.new(0,5,0))
- else
- end
- end)
- end
- function initChestAutoFarm()
- local function attemptOpenChest(chestModel)
- local lastCFrame = player.Character.PrimaryPart.CFrame
- local proxPrompt = chestModel.Box.ChestPrompt
- repeat
- player.Character:PivotTo(chestModel.Box.CFrame * CFrame.new(0,1,0))
- fireproximityprompt(proxPrompt)
- task.wait(.1)
- until proxPrompt.Enabled == false or not Toggles['CHESTS_AUTOFARM'].Value or chestModel == nil
- player.Character:PivotTo(lastCFrame)
- end
- for i, chestHolder in chestSpawnsWs:GetChildren() do
- connections['chest_' .. i] = chestHolder.ChildAdded:Connect(function(child)
- task.wait(.3)
- if Toggles['CHESTS_AUTOFARM'].Value then
- attemptOpenChest(child)
- end
- end)
- end
- Toggles['CHESTS_AUTOFARM']:OnChanged(function()
- local bool = Toggles['CHESTS_AUTOFARM'].Value
- print(bool)
- if bool then
- for _, chestHolder in chestSpawnsWs:GetChildren() do
- local chestModel = chestHolder:FindFirstChild('Chest')
- if not chestModel then continue end
- if not chestModel.Box.ChestPrompt.Enabled then continue end
- attemptOpenChest(chestModel)
- task.wait(.02)
- end
- else
- end
- end)
- end
- end
- do -- [[ TELEPORTS ]] --
- function initTeleportsGui()
- local types = {
- ['TP_SHRINES'] = function(callback) player.Character:PivotTo(shrinesWs:FindFirstChild(callback).WorldPivot * CFrame.new(0,10,0)) end,
- ['TP_SHOPS'] = function(callback) player.Character:PivotTo(shopsWs:FindFirstChild(callback).WorldPivot) end
- }
- for type, func in types do
- Options[type]:OnChanged(function()
- if Options[type].Value == nil or Options[type].Value == '' then return end
- local s,e = pcall(function()
- types[type](Options[type].Value)
- end)
- if e then warn(e) end
- end)
- end
- end
- end
- do -- [[ SPOOFERS ]]
- function initAntiAdonis()
- if getgenv().adonisACcustom then return end
- local function bypass()
- local isLoaded = false
- for _, v in getgc(true) do
- if typeof(v) ~= 'table' then continue end
- if rawget(v, 'indexInstance') then
- for method, tbl in pairs(v) do
- pcall(function()
- if isexecutorclosure(tbl[2]) then return end
- if iscclosure(tbl[2]) then return end
- isLoaded = true
- tbl[2] = function() return false end
- end)
- end
- end
- end
- if isLoaded then
- return true
- else
- return false
- end
- end
- -- Incase adonis takes some time to load.
- repeat
- local result = bypass()
- task.wait(3)
- until result or getgenv().adonisACcustom
- getgenv().adonisACcustom = true
- warn('Adonis Finalized')
- end
- function initSpoofRemotes()
- local remoteEventAssociations = {
- ['damage'] = function(instance, args)
- return nil
- end,
- }
- local old;old = hookmetamethod(game, "__namecall", function(self, ...)
- local args = {...}
- if self == receiveDamageRm then
- print(getnamecallmethod())
- end
- if getnamecallmethod() == "FireServer" and self == receiveDamageRm then
- print('DAMAGE CALLED')
- if args[1] == player.Character then
- print('DAMAGE PREVENTED')
- return nil
- end
- end
- return old(self, ...)
- end)
- end
- end
- do -- [[ CLEAN UP ]]
- function cleanConnections()
- for key, con in connections do
- con:Disconnect()
- connections[key] = nil
- end
- table.clear(connections)
- end
- end
- -- // GUI
- local repo = 'https://raw.githubusercontent.com/mrchigurh/LinoriaLib/main/'
- local Library = loadstring(game:HttpGet(repo .. 'Library.lua'))()
- local ThemeManager = loadstring(game:HttpGet(repo .. 'addons/ThemeManager.lua'))()
- local SaveManager = loadstring(game:HttpGet(repo .. 'addons/SaveManager.lua'))()
- local Window = Library:CreateWindow({
- Title = 'Critical Revengeance | V1',
- Center = true,
- AutoShow = true,
- })
- local Tabs = {
- ['Main'] = Window:AddTab('Main'),
- ['Settings'] = Window:AddTab('Settings'),
- ['UI Settings'] = Window:AddTab('UI Settings')
- }
- do -- [[ Mobs Autofarm Groupbox ]]
- local Groupbox = Tabs.Main:AddLeftGroupbox('Mobs Autofarm (not finished/buggy)')
- Groupbox:AddToggle('MOBS_AUTOFARM', {
- Text = 'Mobs Autofarm',
- Default = false, -- Default value (true / false)
- Tooltip = 'Will begin autofarming mobs.', -- Information shown when you hover over the toggle
- })
- Groupbox:AddDropdown('MOBS_WHITELIST', {
- Values = getAllMobTypes(),
- Default = 0, -- number index of the value / string
- Multi = true, -- true / false, allows multiple choices to be selected
- Compact = true,
- Text = 'Mobs Whitelist',
- Tooltip = 'Mobs Whitelist. Select none for all.', -- Information shown when you hover over the dropdown
- })
- end
- do -- [[ Ores Autofarm Groupbox ]]
- local Groupbox = Tabs.Main:AddLeftGroupbox('Ores Autofarm')
- Groupbox:AddToggle('ORES_AUTOFARM', {
- Text = 'Ores Autofarm',
- Default = false, -- Default value (true / false)
- Tooltip = 'Will begin autofarming ores.', -- Information shown when you hover over the toggle
- })
- Groupbox:AddDropdown('ORES_DROPDOWN', {
- Values = { 'Copper', 'Gold', 'Silver', 'Titanium', 'Uranium' },
- Default = 1, -- number index of the value / string
- Multi = true, -- true / false, allows multiple choices to be selected
- Text = 'Ores Whitelist',
- Tooltip = 'Select the ores you want to automine.', -- Information shown when you hover over the dropdown
- })
- end
- do -- [[ Chests Autofarm Groupbox ]]
- local Groupbox = Tabs.Main:AddLeftGroupbox('Chests Autofarm')
- Groupbox:AddToggle('CHESTS_AUTOFARM', {
- Text = 'Chests Autofarm',
- Default = false, -- Default value (true / false)
- Tooltip = 'Will begin autofarming chests.', -- Information shown when you hover over the toggle
- })
- end
- do -- [[ Teleports Groupbox ]]
- local Groupbox = Tabs.Main:AddRightGroupbox('Teleports')
- Groupbox:AddDropdown('TP_SHRINES', {
- Values = getInstanceChildrenAsArray(shrinesWs),
- Default = 0, -- number index of the value / string
- Multi = false, -- true / false, allows multiple choices to be selected
- Text = 'Shrines',
- })
- Groupbox:AddDropdown('TP_SHOPS', {
- Values = getInstanceChildrenAsArray(shopsWs, 'Model', {'MM BMarket Shop', 'BMarket Shop'}),
- Default = 0, -- number index of the value / string
- Multi = false, -- true / false, allows multiple choices to be selected
- Text = 'Shops',
- })
- end
- do -- [[ Final Load ]]
- Library:OnUnload(function()
- print('Unloaded!')
- Library.Unloaded = true
- end)
- local MenuGroup = Tabs['UI Settings']:AddLeftGroupbox('Menu')
- MenuGroup:AddButton('Unload', function() Library:Unload() end)
- MenuGroup:AddLabel('Menu bind'):AddKeyPicker('MenuKeybind', { Default = 'LeftAlt', NoUI = true, Text = 'Menu keybind' })
- ThemeManager:SetLibrary(Library)
- SaveManager:SetLibrary(Library)
- SaveManager:IgnoreThemeSettings()
- SaveManager:SetIgnoreIndexes({ 'MenuKeybind' })
- ThemeManager:SetFolder('linoria_lib')
- SaveManager:SetFolder('linoria_lib/Critical_Revengeance')
- SaveManager:BuildConfigSection(Tabs['UI Settings'])
- ThemeManager:ApplyToTab(Tabs['UI Settings'])
- SaveManager:LoadAutoloadConfig()
- Library.ToggleKeybind = Options.MenuKeybind
- end
- -- // MAIN
- task.defer(function()
- initAntiAdonis()
- end)
- cleanConnections()
- initTeleportsGui()
- initMobAutoFarm()
- initOreAutoFarm()
- initChestAutoFarm()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement