Roblox Script - Dungeon Quest [AUTOFARM]

 


pro guide on how to use: basically you load into a dungeon with your starter/whatever spells equipped and then click start dungeon button and then u execute this script.

if enough people want it, i'll update the code to be used with a ui, a full dungeon starting autofarm, and make it actually work better, or someone else can do it.


how it works: bad 4 year old game uses server side custom hitbox for calculating attacks/getting damaged, however the enemies agro onto the client's character which leads to some easy farming methods. 


some warnings:

idfk if it works on any other dungeon other than the first dungeon since i didnt test it on those, but yeah it should. 

also dont turn on shift lock or first person cuz it will sucking break

script definitely doesnt work with all spells cause this game is structured like a wet ballsack, but it works for the starter fireball spells at least lol


local Players = game:GetService("Players")

local localPlayer = Players.LocalPlayer


local function getAttackRemotes()

    local remotes = {}

    for _,tool in next, localPlayer.Backpack:GetChildren() do

        table.insert(remotes, tool:FindFirstChildOfClass("RemoteEvent"))

    end

    for _,v in next, localPlayer.Character:GetDescendants() do

        if v.Name == "swing" and v:IsA("RemoteEvent") then

            table.insert(remotes, v)

        end

    end

    return remotes

end


local attackRemotes = getAttackRemotes()


local function enemyFolder()

    for _,v in next, workspace.dungeon:GetDescendants() do

        if v.Parent.Name == "enemyFolder" and v:IsA("Model") then

            return v.Parent

        end

    end

end


local function killCluster()

    local rootPart = game.Players.LocalPlayer.Character.HumanoidRootPart

    local old_cframe = rootPart.CFrame

    local enemyF = enemyFolder()

    local enemyRootPart = enemyF:FindFirstChildOfClass("Model").HumanoidRootPart

    local safeDis = enemyF.Parent.Name == "bossRoom" and 50 or 20

    

    rootPart.CFrame = CFrame.lookAt(

        Vector3.new(

            enemyRootPart.Position.X + safeDis,

            enemyRootPart.Position.Y,

            enemyRootPart.Position.Z

            ), enemyRootPart.Position)

        

    rootPart.Anchored = false

    task.wait(.2)

    rootPart.Anchored = true

    rootPart.CFrame = enemyRootPart.CFrame --+ Vector3.new(0,8,0)

    

    print("Waiting three seconds.")

    task.wait(3) 

    print("Starting attack.")

    repeat

        for _,remote in next, attackRemotes do

            remote:FireServer()

        end

        task.wait(.2)

    until enemyRootPart.Parent == nil or enemyRootPart.Parent.Humanoid.Health == 0

    print("Target enemy killed.")

    task.wait(1.5)

    killCluster()

end


killCluster()


-- yoinked l0l

local PlayerModule = localPlayer.PlayerScripts:WaitForChild("PlayerModule")

local Cameras = require(PlayerModule):GetCameras()

local CameraController = Cameras.activeCameraController

local MouseLockController = Cameras.activeMouseLockController



game:GetService("UserInputService").InputBegan:Connect(function(Input)

if Input.KeyCode == Enum.KeyCode.LeftShift or Input.KeyCode == Enum.KeyCode.RightShift then

MouseLockController:OnMouseLockToggled()

CameraController:SetIsMouseLocked(false)

end

end)


created by barbungus#8853 

Previous Post Next Post