Advertisement
Porry

Ro Ghoul Script - Auto Farm - Touka Farm/Better Auto Save/Credits to z4gs

Sep 29th, 2024 (edited)
7,148
1
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.06 KB | None | 3 2
  1. _G.Team = "Ghoul"
  2. repeat wait() until game:IsLoaded()
  3.  pcall(function()
  4.     game:WaitForChild("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Race"):WaitForChild("Chose"):InvokeServer(_G.Team)
  5.  end)
  6. repeat
  7.         wait()
  8.     until game.Workspace:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild("Humanoid").Health ~= 0
  9.  
  10. local gui = loadstring(game:HttpGetAsync("https://raw.githubusercontent.com/z4gs/scripts/master/testtttt.lua"))():AddWindow("Ro-Ghoul", {
  11.     main_color = Color3.fromRGB(0,0,0),
  12.     min_size = Vector2.new(373, 340),
  13.     can_resize = false
  14. })
  15.  
  16. local get = setmetatable({}, {
  17.     __index = function(a, b)
  18.         return game:GetService(b) or game[b]
  19.     end
  20. })
  21.  
  22. local tab1, tab2, tab3, tab4 = gui:AddTab("Main"), gui:AddTab("Farm Options"), gui:AddTab("Trainer"), gui:AddTab("Misc")
  23. local btn, btn2, btn3, key, nmc, trainers, labels
  24. local findobj, findobjofclass, waitforobj, fire, invoke = get.FindFirstChild, get.FindFirstChildOfClass, get.WaitForChild, Instance.new("RemoteEvent").FireServer, Instance.new("RemoteFunction").InvokeServer
  25. local player = get.Players.LocalPlayer
  26.  
  27. repeat wait() until player:FindFirstChild("PlayerFolder")
  28.  
  29. local team, remotes, stat = player.PlayerFolder.Customization.Team.Value, get.ReplicatedStorage.Remotes, player.PlayerFolder.StatsFunction
  30. local oldtick, farmtick = 0, 0
  31. local camera = workspace.CurrentCamera
  32. local myData = (isfolder("Porry") and isfile("Porry/data.json")) and game:GetService("HttpService"):JSONDecode(readfile("Porry/data.json")) or {
  33.     Skills = {
  34.         E = false,
  35.         F = false,
  36.         C = false,
  37.         R = false
  38.     },
  39.     Boss = {
  40.         ["Gyakusatsu"] = false,
  41.         ["Eto Yoshimura"] = false,
  42.         ["Koutarou Amon"] = false,
  43.         ["Nishiki Nishio"] = false,
  44.         ["Touka Kirishima"] = false
  45.     },
  46.     DistanceFromNpc = 5,
  47.     DistanceFromBoss = 8,
  48.     TeleportSpeed = 150,
  49.     ReputationFarm = false,
  50.     ReputationCashout = false,
  51.     AutoKickWhitelist = "",
  52.     Start = false,
  53.     Trainer = false
  54. }
  55.  
  56. if not isfolder("Porry") then
  57.     makefolder("Porry")
  58. end
  59.  
  60.  
  61.  
  62. function UpdateSave()
  63.    
  64.     writefile("Porry/data.json", game:GetService("HttpService"):JSONEncode(myData))
  65. end
  66. function print_table(node)
  67.     local cache, stack, output = {},{},{}
  68.     local depth = 1
  69.     local output_str = "{\n"
  70.  
  71.     while true do
  72.         local size = 0
  73.         for k,v in pairs(node) do
  74.             size = size + 1
  75.         end
  76.  
  77.         local cur_index = 1
  78.         for k,v in pairs(node) do
  79.             if (cache[node] == nil) or (cur_index >= cache[node]) then
  80.  
  81.                 if (string.find(output_str,"}",output_str:len())) then
  82.                     output_str = output_str .. ",\n"
  83.                 elseif not (string.find(output_str,"\n",output_str:len())) then
  84.                     output_str = output_str .. "\n"
  85.                 end
  86.  
  87.                 -- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
  88.                 table.insert(output,output_str)
  89.                 output_str = ""
  90.  
  91.                 local key
  92.                 if (type(k) == "number" or type(k) == "boolean") then
  93.                     key = "["..tostring(k).."]"
  94.                 else
  95.                     key = "['"..tostring(k).."']"
  96.                 end
  97.  
  98.                 if (type(v) == "number" or type(v) == "boolean") then
  99.                     output_str = output_str .. string.rep('\t',depth) .. key .. " = "..tostring(v)
  100.                 elseif (type(v) == "table") then
  101.                     output_str = output_str .. string.rep('\t',depth) .. key .. " = {\n"
  102.                     table.insert(stack,node)
  103.                     table.insert(stack,v)
  104.                     cache[node] = cur_index+1
  105.                     break
  106.                 else
  107.                     output_str = output_str .. string.rep('\t',depth) .. key .. " = '"..tostring(v).."'"
  108.                 end
  109.  
  110.                 if (cur_index == size) then
  111.                     output_str = output_str .. "\n" .. string.rep('\t',depth-1) .. "}"
  112.                 else
  113.                     output_str = output_str .. ","
  114.                 end
  115.             else
  116.                 -- close the table
  117.                 if (cur_index == size) then
  118.                     output_str = output_str .. "\n" .. string.rep('\t',depth-1) .. "}"
  119.                 end
  120.             end
  121.  
  122.             cur_index = cur_index + 1
  123.         end
  124.  
  125.         if (size == 0) then
  126.             output_str = output_str .. "\n" .. string.rep('\t',depth-1) .. "}"
  127.         end
  128.  
  129.         if (#stack > 0) then
  130.             node = stack[#stack]
  131.             stack[#stack] = nil
  132.             depth = cache[node] == nil and depth + 1 or depth - 1
  133.         else
  134.             break
  135.         end
  136.     end
  137.  
  138.     -- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
  139.     table.insert(output,output_str)
  140.     output_str = table.concat(output)
  141.  
  142.     print(output_str)
  143. end
  144. print_table(myData)
  145.  
  146.  
  147. local array = {
  148.     boss = {
  149.         ["Gyakusatsu"] = 1250,
  150.         ["Eto Yoshimura"] = 1250,
  151.         ["Koutarou Amon"] = 750,
  152.         ["Nishiki Nishio"] = 250,
  153.         ["Touka Kirishima"] = 250
  154.     },
  155.  
  156.     npcs = {["Aogiri Members"] = "GhoulSpawns", Investigators = "CCGSpawns", Humans = "HumanSpawns"},
  157.  
  158.     stages = {"One", "Two", "Three", "Four", "Five", "Six"},
  159.  
  160.     skills = {
  161.         E = player.PlayerFolder.Special1CD,
  162.         F = player.PlayerFolder.Special3CD,
  163.         C = player.PlayerFolder.SpecialBonusCD,
  164.         R = player.PlayerFolder.Special2CD
  165.     }
  166. }
  167.  
  168. tab1:AddLabel("Target")
  169.  
  170. if myData.targ then
  171.     array.targ = myData.targ
  172. end
  173.  
  174. local drop = tab1:AddDropdown("Select", function(opt)
  175.     array.targ = array.npcs[opt]
  176.     myData.targ = array.npcs[opt]
  177.     UpdateSave()
  178. end)
  179.  
  180.  
  181. if myData.Start then
  182.     array.autofarm = myData.Start
  183. end
  184.  
  185. btn = tab1:AddButton("Start", function()
  186.     if not array.autofarm then
  187.         if key then
  188.             btn.Text, array.autofarm = "Stop", true
  189.             myData.Start = array.autofarm
  190.             UpdateSave()
  191.             local farmtick = tick()
  192.             while array.autofarm do
  193.                 labels("tfarm", "Time elapsed: "..os.date("!%H:%M:%S", tick() - farmtick))
  194.                 wait(1)
  195.             end
  196.         else
  197.             player:Kick("Failed to get the Remote key, please try to execute the script again")
  198.         end
  199.     else
  200.         btn.Text, array.autofarm, array.died = "Start", false, false
  201.         myData.Start = array.autofarm
  202.         UpdateSave()
  203.     end
  204. end)
  205.  
  206.  
  207.  
  208. local function format(number)
  209.     local i, k, j = tostring(number):match("(%-?%d?)(%d*)(%.?.*)")
  210.     return i..k:reverse():gsub("(%d%d%d)", "%1,"):reverse()..j
  211. end
  212.  
  213. labels = setmetatable({
  214.     text = {label = tab1:AddLabel("")},
  215.     tfarm = {label = tab1:AddLabel("")},
  216.     space = {label = tab1:AddLabel("")},
  217.     Quest = {prefix = "Current Quest: ", label = tab1:AddLabel("Current Quest: None")},
  218.     Yen = {prefix = "Yen: ", label = tab1:AddLabel("Yen: 0"), value = 0, oldval = player.PlayerFolder.Stats.Yen.Value},
  219.     RC = {prefix = "RC: ", label = tab1:AddLabel("RC: 0"), value = 0, oldval = player.PlayerFolder.Stats.RC.Value},
  220.     Kills = {prefix = "Kills: ", label = tab1:AddLabel("Kills: 0"), value = 0}
  221. }, {
  222.     __call = function (self, typ, newv, oldv)
  223.         if typ and newv then
  224.             local object = self[typ]
  225.             if type(newv) == "number" then
  226.                 object.value = object.value + newv
  227.                 object.label.Text = object.prefix..format(object.value)
  228.                 if oldv then
  229.                     object.oldval = oldv
  230.                 end
  231.             elseif object.prefix then
  232.                 object.label.Text = object.prefix..newv
  233.             else
  234.                 object.label.Text = newv
  235.             end
  236.             return
  237.         end
  238.         for i,v in pairs(labels) do
  239.             v.value = 0
  240.             v.label.Text = v.prefix.."0"
  241.         end
  242.     end
  243. })
  244.  
  245. local function getLabel(la)
  246.     return labels[la].value and labels[la].value or labels[la].label.Text
  247. end
  248.  
  249. btn3 = tab1:AddButton("Reset", function() labels() end)
  250.  
  251. if team == "CCG" then tab2:AddLabel("Quinque Stage") else tab2:AddLabel("Kagune Stage") end
  252.  
  253. local drop2 = tab2:AddDropdown("[ 1 ]", function(opt)
  254.     array.stage = array.stages[tonumber(opt)]
  255. end)
  256.  
  257. array.stage = "One"
  258.  
  259. tab2:AddSwitch("Reputation Farm", function(bool)
  260.     myData.ReputationFarm = bool
  261.     UpdateSave()
  262. end):Set(myData.ReputationFarm)
  263.  
  264. tab2:AddSwitch("Auto Reputation Cashout", function(bool)
  265.     myData.ReputationCashout = bool
  266.     UpdateSave()
  267. end):Set(myData.ReputationCashout)
  268.  
  269. for i,v in pairs(array.boss) do
  270.     tab2:AddSwitch(i.." Boss Farm ".."(".."lvl "..v.."+)", function(bool)
  271.         myData.Boss[i] = bool
  272.         UpdateSave()
  273.     end):Set(myData.Boss[i])
  274. end
  275.  
  276. function ConvertToNewValue(sel_value, min, max)
  277.     local maxv = max
  278.     local minv = min
  279.     local diff = maxv - minv
  280.     local p = ((sel_value - minv) / diff) * 100
  281.     return p
  282. end
  283.  
  284. local oldtpspeed, olddisboss, oldfromnpc = myData.TeleportSpeed, myData.DistanceFromBoss, myData.DistanceFromNpc
  285. tab2:AddSlider("TP Speed", function(x)
  286.     myData.TeleportSpeed = x
  287.     UpdateSave()
  288. end, {min = 90, max = 250}):Set(tonumber(ConvertToNewValue(oldtpspeed, 90, 250)))
  289.  
  290. tab2:AddSlider("Distance from NPC", function(x)
  291.     myData.DistanceFromNpc = x * -1
  292.     UpdateSave()
  293. end, {min = 0, max = 8}):Set(ConvertToNewValue(oldfromnpc * -1, 0, 8))
  294.  
  295. tab2:AddSlider("Distance from Bosses", function(x)
  296.     myData.DistanceFromBoss = x * -1
  297.     UpdateSave()
  298. end, {min = 0, max = 15}):Set(ConvertToNewValue(olddisboss * -1, 0, 15))
  299.  
  300. labels.p = {label = tab3:AddLabel("Current trainer: "..player.PlayerFolder.Trainers[team.."Trainer"].Value)}
  301.  
  302. local progress = tab3:AddSlider("Progress", nil, {min = 0, max = 100, readonly = true})
  303.  
  304. progress:Set(player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Value)
  305.  
  306. player.PlayerFolder.Trainers[team.."Trainer"].Changed:connect(function()
  307.     labels("p", "Current trainer: "..player.PlayerFolder.Trainers[team.."Trainer"].Value)
  308.     progress:Set(player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Value)
  309. end)
  310.  
  311. if myData.Trainer then
  312.     array.trainer = myData.Trainer
  313. end
  314.  
  315. btn2 = tab3:AddButton("Start", function()
  316.     if not array.trainer then
  317.         array.trainer, btn2.Text = true, "Stop"
  318.         myData.Trainer = array.trainer
  319.         UpdateSave()
  320.         local connection, time
  321.  
  322.         while array.trainer do
  323.             if connection and connection.Connected then
  324.                 connection:Disconnect()
  325.             end
  326.            
  327.             local tkey, result
  328.  
  329.             connection = player.Backpack.DescendantAdded:Connect(function(obj)
  330.                 if tostring(obj) == "TSCodeVal" and obj:IsA("StringValue") then
  331.                     tkey = obj.Value
  332.                 end
  333.             end)
  334.            
  335.             result = invoke(remotes.Trainers.RequestTraining)
  336.  
  337.             if result == "TRAINING" then
  338.                 for i,v in pairs(workspace.TrainingSessions:GetChildren()) do
  339.                     if waitforobj(v, "Player").Value == player then
  340.                         fire(waitforobj(v, "Comm"), "Finished", tkey, false)
  341.                         break
  342.                     end
  343.                 end
  344.             elseif result == "TRAINING COMPLETE" then
  345.                 labels("time", "Switching to other trainer...")
  346.                 for i,v in pairs(player.PlayerFolder.Trainers:GetDescendants()) do
  347.                     if table.find(trainers, v.Name) and findobj(v, "Progress") and tonumber(v.Progress.Value) < 100 and tonumber(player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Value) == 100 then
  348.                         invoke(remotes.Trainers.ChangeTrainer, v.Name)
  349.                         wait(1.5)
  350.                     end
  351.                 end
  352.             else
  353.                 labels("time", "Time until the next training: "..result)
  354.             end
  355.             wait(1)
  356.         end
  357.         labels("time", "")
  358.     else
  359.         array.trainer, btn2.Text = false, "Start"
  360.         myData.Trainer = array.trainer
  361.         UpdateSave()
  362.     end
  363. end)
  364.  
  365.  
  366.  
  367. labels.time = {label = tab3:AddLabel("")}
  368.  
  369. tab4:AddSwitch("Auto add kagune/quinque stats", function(bool) array.weapon = bool end)
  370. tab4:AddSwitch("Auto add durability stats", function(bool) array.dura = bool end)
  371. tab4:AddSwitch("Auto kick", function(bool) array.kick = bool end)
  372. tab4:AddLabel("Auto kick whitelist (type 1 name per line)")
  373.  
  374. local console = tab4:AddConsole({
  375.     ["y"] = 50,
  376.     ["source"] = "Text",
  377. })
  378.  
  379. console:Set(myData.AutoKickWhitelist)
  380.  
  381. console:OnChange(function(newtext)
  382.     myData.AutoKickWhitelist = newtext
  383.     UpdateSave()
  384. end)
  385.  
  386. for i,v in pairs(array.skills) do
  387.     tab4:AddSwitch("Auto use "..i.." skill (on bosses)", function(bool)
  388.         myData.Skills[i] = bool
  389.         UpdateSave()
  390.     end):Set(myData.Skills[i])
  391. end
  392.  
  393. do
  394.     local count = 0
  395.     for i,v in pairs(player.PlayerGui.HUD.StagesFrame.InfoScroll:GetChildren()) do
  396.         if v.ClassName == "Frame" and v.Name ~= "Example" then
  397.             count = count + 1
  398.             drop2:Add(count)
  399.         end
  400.     end
  401. end
  402.  
  403. for i,v in pairs(array.npcs) do drop:Add(i) end
  404.  
  405. tab1:Show()
  406.  
  407. local function tp(pos)
  408.     if array.died then
  409.         player.Character.HumanoidRootPart.CFrame = pos
  410.         array.died = false
  411.         return
  412.     end
  413.  
  414.     local val = Instance.new("CFrameValue")
  415.     val.Value = player.Character.HumanoidRootPart.CFrame
  416.  
  417.     local tween = game:GetService("TweenService"):Create(
  418.         val,
  419.         TweenInfo.new((player.Character.HumanoidRootPart.Position - pos.p).magnitude / myData.TeleportSpeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0),
  420.         {Value = pos}
  421.     )
  422.  
  423.     tween:Play()
  424.  
  425.     local completed
  426.     tween.Completed:Connect(function()
  427.         completed = true
  428.     end)
  429.  
  430.     while not completed do
  431.         if array.found or not array.autofarm or player.Character.Humanoid.Health <= 0 then tween:Cancel() break end
  432.         player.Character.HumanoidRootPart.CFrame = val.Value
  433.         task.wait()
  434.     end
  435.  
  436.     val:Destroy()
  437. end
  438.  
  439. local function getNPC()
  440.     local nearestnpc, nearest = nil, math.huge
  441.  
  442.     if myData.Boss.Gyakusatsu and tonumber(player.PlayerFolder.Stats.Level.Value) > array.boss["Gyakusatsu"] and findobj(workspace.NPCSpawns["GyakusatsuSpawn"], "Gyakusatsu") then
  443.         local lowesthealth, lowestNpcModel = math.huge, nil
  444.  
  445.         for i,v in pairs(workspace.NPCSpawns["GyakusatsuSpawn"]:GetChildren()) do
  446.             if v.Name ~= "Mob" and findobj(v, "Humanoid") and v.Humanoid.Health < lowesthealth then
  447.                 lowesthealth = v.Humanoid.Health
  448.                 lowestNpcModel = v
  449.             end
  450.         end
  451.  
  452.         if not lowestNpcModel then
  453.             return workspace.NPCSpawns.GyakusatsuSpawn.Gyakusatsu
  454.         end
  455.        
  456.         return lowestNpcModel
  457.     end
  458.  
  459.     for i,v in pairs(workspace.NPCSpawns:GetChildren()) do
  460.         local npc = findobjofclass(v, "Model")
  461.  
  462.         if npc and findobj(npc, "Head") and not findobj(npc, "AC") then
  463.             if npc.Parent.Name == array.targ then
  464.                 local magnitude = (npc.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude
  465.  
  466.                 if magnitude < nearest then
  467.                     nearestnpc, nearest = npc, magnitude
  468.                 end
  469.             elseif myData.Boss[npc.Name] and tonumber(player.PlayerFolder.Stats.Level.Value) >= array.boss[npc.Name] then
  470.                 return npc
  471.             end
  472.         end
  473.     end
  474.     return nearestnpc
  475. end
  476.  
  477. local function getQuest(typ)
  478.     labels("text", "Moving to quest NPC")
  479.  
  480.     local npc = team == "Ghoul" and workspace.Anteiku.Yoshimura or workspace.CCGBuilding.Yoshitoki
  481.  
  482.     tp(npc.HumanoidRootPart.CFrame)
  483.     invoke(game:GetService("ReplicatedStorage").Remotes.Ally.AllyInfo)
  484.     wait()
  485.     fireclickdetector(npc.TaskIndicator.ClickDetector)
  486.  
  487.     if array.autofarm and not array.died and (npc.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude <= 20 then
  488.         if typ then
  489.             labels("text", "Getting quest...")
  490.             invoke(remotes[npc.Name].Task)
  491.             invoke(remotes[npc.Name].Task)
  492.             local quest = waitforobj(player.PlayerFolder.CurrentQuest.Complete, "Aogiri Member")
  493.             labels("Quest", ("%c/%c"):format("0", quest:WaitForChild("Max").Value))
  494.             quest.Changed:Connect(function(change)
  495.                 labels("Quest", ("%c/%c"):format(change, quest.Max.Value))
  496.             end)
  497.         else
  498.             labels("text", "Withdrawing reputation")
  499.             invoke(remotes.ReputationCashOut)
  500.             oldtick = tick()
  501.         end
  502.     end
  503. end
  504.  
  505. local function collect(npc)
  506.     local timer = tick()
  507.     local model = waitforobj(npc, npc.Name.." Corpse", 2)
  508.     local clickpart = waitforobj(model, "ClickPart", 2)
  509.  
  510.     player.Character.HumanoidRootPart.CFrame = clickpart.CFrame * CFrame.new(0,1.7,0)
  511.  
  512.     waitforobj(clickpart, "")
  513.     repeat
  514.         if tick() - timer > 4 then
  515.             break
  516.         end
  517.         player.Character.Humanoid:MoveTo(clickpart.Position)
  518.         wait()
  519.         fireclickdetector(clickpart[""], 1)
  520.     until not model.Parent.Parent or not findobj(model, "ClickPart") or not array.autofarm or player.Character.Humanoid.Health <= 0
  521. end
  522.  
  523. local function pressKey(topress)
  524.     fire(player.Character.Remotes.KeyEvent, key, topress, "Down", player:GetMouse().Hit, nil, workspace.Camera.CFrame)
  525. end
  526.  
  527. player.PlayerFolder.Stats.RC.Changed:Connect(function(value)
  528.     if array.autofarm then
  529.         labels("RC", value - labels.RC.oldval, value)
  530.     end
  531. end)
  532.  
  533. player.PlayerFolder.Stats.Yen.Changed:Connect(function(value)
  534.     if array.autofarm then
  535.         labels("Yen", value - labels.Yen.oldval, value)
  536.     end
  537. end)
  538.  
  539. getconnections(player.Idled)[1]:Disable()
  540.  
  541. get.Players.PlayerAdded:Connect(function(plr)
  542.     if array.kick then
  543.         local splittedarray = console:Get():split("\n")
  544.  
  545.         if not table.find(splittedarray, plr.Name) then
  546.             player:Kick("Player joined, name: "..plr.Name)
  547.         end
  548.     end
  549. end)
  550.  
  551. player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Changed:Connect(function(c)
  552.     progress:Set(tonumber(c))
  553. end)
  554.  
  555. coroutine.wrap(function()
  556.     while wait() do
  557.         if tonumber(player.PlayerFolder.Stats.Focus.Value) > 0 then
  558.             if array.weapon then
  559.                 invoke(stat, "Focus", "WeaponAddButton", 1)
  560.             end
  561.             if array.dura then
  562.                 invoke(stat, "Focus", "DurabilityAddButton", 1)
  563.             end
  564.         end
  565.     end
  566. end)()
  567.  
  568. -- remote Key grabber + grab updated trainers table
  569. do
  570.     fireclickdetector(workspace.TrainerModel.ClickIndicator.ClickDetector)
  571.     waitforobj(waitforobj(player.PlayerGui, "TrainersGui"), "TrainersGuiScript")
  572.     player.PlayerGui.TrainersGui:Destroy()
  573.  
  574.     repeat
  575.         for i,v in pairs(getgc(true)) do
  576.             if not key and type(v) == "function" and getinfo(v).source:find(".ClientControl") then
  577.                 for i2,v2 in pairs(getconstants(v)) do
  578.                     if v2 == "KeyEvent" then
  579.                         local keyfound = getconstant(v, i2 + 1)
  580.                         if #keyfound >= 100 then
  581.                             key = keyfound
  582.                             break
  583.                         end
  584.                     end
  585.                 end
  586.             elseif type(v) == "table" and ((table.find(v, "(S1) Kureo Mado") and team == "CCG") or (table.find(v, "(S1) Ken Kaneki"))) then
  587.                 trainers = v
  588.             end
  589.         end
  590.         wait()
  591.     until key
  592. end
  593.  
  594. -- auto farm
  595. while true do
  596.     if array.autofarm then
  597.         pcall(function()
  598.             if player.Character.Humanoid.Health > 0 and player.Character.HumanoidRootPart and player.Character.Remotes.KeyEvent then
  599.                 if not findobj(player.Character, "Kagune") and not findobj(player.Character, "Quinque")  then
  600.                     pressKey(array.stage)
  601.                 end
  602.                 if myData.ReputationFarm and (not findobj(player.PlayerFolder.CurrentQuest.Complete, "Aogiri Member") or player.PlayerFolder.CurrentQuest.Complete["Aogiri Member"].Value == player.PlayerFolder.CurrentQuest.Complete["Aogiri Member"].Max.Value) then
  603.                     getQuest(true)
  604.                     return
  605.                 elseif myData.ReputationCashout and tick() - oldtick > 7200 then
  606.                     getQuest()
  607.                 end
  608.  
  609.                 local npc = getNPC()
  610.  
  611.                 if npc then
  612.                     array.found = false
  613.                     local reached = false
  614.  
  615.                     coroutine.wrap(function()
  616.                         while not reached do
  617.                             if npc ~= getNPC() then
  618.                                 array.found = true
  619.                                 break
  620.                             end
  621.                             wait()
  622.                         end
  623.                     end)()
  624.  
  625.                     labels("text", "Moving to: "..npc.Name)
  626.  
  627.                     if myData.Boss[npc.Name] or npc.Parent.Name == "GyakusatsuSpawn" then
  628.                         tp(npc.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(90),0,0) + Vector3.new(0,myData.DistanceFromBoss,0))
  629.                     else
  630.                         tp(npc.HumanoidRootPart.CFrame + npc.HumanoidRootPart.CFrame.lookVector * myData.DistanceFromNpc)
  631.                     end
  632.  
  633.                     labels("text", "Killing: "..npc.Name)
  634.                    
  635.                     reached = true
  636.  
  637.                     if not array.found then
  638.                         while findobj(findobj(npc.Parent, npc.Name), "Head") and player.Character.Humanoid.Health > 0 and array.autofarm do
  639.                             if not findobj(player.Character, "Kagune") and not findobj(player.Character, "Quinque")  then
  640.                                 pressKey(array.stage)
  641.                             end
  642.                             if myData.Boss[npc.Name] or npc.Parent.Name == "GyakusatsuSpawn" then
  643.                                 for x,y in pairs(myData.Skills) do
  644.                                     if player.PlayerFolder.CanAct.Value and y and array.skills[x].Value ~= "DownTime" then
  645.                                         pressKey(x)
  646.                                     end
  647.                                 end
  648.                                 player.Character.HumanoidRootPart.CFrame = npc.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(90),0,0) + Vector3.new(0,myData.DistanceFromBoss ,0)
  649.                             else
  650.                                 player.Character.HumanoidRootPart.CFrame = npc.HumanoidRootPart.CFrame + npc.HumanoidRootPart.CFrame.lookVector * myData.DistanceFromNpc
  651.                             end
  652.                             if player.PlayerFolder.CanAct.Value then
  653.                                 pressKey("Mouse1")
  654.                             end
  655.                             task.wait()
  656.                         end
  657.  
  658.                         if npc.Name == "Gyakusatsu" then
  659.                             player.Character.Humanoid.Health = 0
  660.                         end
  661.  
  662.                         if array.autofarm and player.Character.Humanoid.Health > 0 then
  663.                             labels("Kills", 1)
  664.                             if npc.Name ~= "Eto Yoshimura" and not findobj(npc.Parent, "Gyakusatsu") and npc.Name ~= "Gyakusatsu" then  
  665.                                 labels("text", "Collecting corpse...")
  666.                                 collect(npc)
  667.                             end
  668.                         end
  669.                     end
  670.                 else
  671.                     labels("text", "Target not found, waiting...")
  672.                 end
  673.             else
  674.                 labels("text", "Waiting for character to respawn")
  675.                 array.died = true
  676.             end
  677.         end)
  678.     else
  679.         labels("text", "")
  680.     end
  681.     wait()
  682. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement