Guest User

Ro-ghoul Auto farm

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