Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Settings ]]--
- local SpecificTargets = true -- Set true/false whether you want it to farm specific targets
- local Targets = { -- Keep adding mobs you want to farm. You can toggle them on/off by changing to true/false
- ["Green Patrolman"] = true,
- ["Patrolman Elite"] = true,
- ["Centurian Defender"] = true,
- }
- local MaxSeconds = 5 -- Set this to the number of seconds before moving on to the next mob (prevents from forever fighting broken/disappearing mobs)
- local ToggleKey = "L" -- Set which key to toggle the farm on/off
- local Enabled = true -- Set whether to default to on/off
- --[[ Variables ]]--
- local Player = game.Players.LocalPlayer
- local UserInputService = game:GetService("UserInputService")
- local Mobs = game.Workspace.Mobs
- --[[ Toggle ]]--
- UserInputService.InputBegan:Connect(function(Input, GPE)
- if not GPE then
- if Input.KeyCode == Enum.KeyCode[ToggleKey] then
- Enabled = not Enabled
- print("Toggle " ..(Enabled and "ON" or "OFF"))
- end
- end
- end)
- --[[ Main Framework ]]--
- while wait(1) do -- Wait 1 to prevent fast inf loops while disabled
- if Enabled then
- for _, v in pairs(Mobs:GetChildren()) do
- if SpecificTargets and Targets[v.Name] then
- if v.PrimaryPart and v:FindFirstChild("Entity") and v:FindFirstChild("Nameplate") then
- local start = tick()
- repeat
- Player.Character:SetPrimaryPartCFrame(v:GetPrimaryPartCFrame() * CFrame.new(0, 0, 3))
- Input.LeftClick()
- wait()
- until
- v.Entity.Health.Value <= 0 or (tick() - start) >= MaxSeconds or not Enabled
- end
- end
- end
- end
- end
- -- By Xzeni (ProtoSmasher)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement