Lost Kingdom Tycoon GUI Script Code

Photo of author
Published by
_G.isRunningFarm = true;

local vim = game:GetService("VirtualInputManager");
local plr = game:GetService("Players").LocalPlayer;
local gameRegion = game:GetService("Workspace").Regions;

local function click() -- Unsure if different resolutions affect this, good luck!
   vim:SendMouseButtonEvent(0, 0, 0, true, game, 0);
   vim:SendMouseButtonEvent(0, 0, 0, false, game, 0);
end;

local function startFarm(reg)
   pcall(function() -- Couldn't be bothered to find out why the game was randomly causing the script to throw an error for no reason.
       for i,v in pairs(gameRegion[reg].Entities:GetChildren()) do
           if v.Name ~= plr and v.Humanoid.Health > 0 then
               plr.Character.HumanoidRootPart.CFrame = CFrame.new(v.PrimaryPart.CFrame.Position);
               click();
           end;
       end;
   end);
end;


local function startCollect()
    for i, v in pairs(game:GetService("Workspace").Items:GetDescendants()) do
        if v:FindFirstChild("ProximityPrompt") then
            fireproximityprompt(v.ProximityPrompt);
        end;
    end;
end;


if plr.Character.Hitbox:FindFirstChild("HitboxTop") then
   for i,v in pairs(plr.Character.Hitbox:GetChildren()) do
       v:Remove(); --This is all it takes for god mode, you can also delete the folder instead of a for loop.
   end;
end;

while _G.isRunningFarm do
   task.wait(1);--Changing this will modify the teleport speed
   startCollect();
   if plr.Character.State.region.Value == "KnightsDungeonRegion" then
       startFarm("KnightsDungeon");
   else
       plr.Character.HumanoidRootPart.CFrame = CFrame.new(356, 29, -136);
       repeat
           task.wait(1);
           --print'debug';
           startCollect();
           if string.match(game:GetService("Workspace").Dungeons.DungeonEntrances.KnightsDungeon.CountdownUiHolder.CountdownHolder.ActionLabel.Text, "COOLDOWN") then
               startFarm("Lava");
           end;
       until game:GetService("Workspace").Dungeons.DungeonEntrances.KnightsDungeon.CountdownUiHolder.CountdownHolder.ActionLabel.Text == "WAITING FOR PLAYERS ..." or plr.Character.State.region.Value == "KnightsDungeonRegion" or _G.isRunningFarm == false;
   end;
end;

To apply a Roblox script, follow these straightforward steps:

  1. Copy the Script Code: Begin by selecting and copying the script code provided above. Click the copy button to copy the script
  2. Use a Code Executor: Open a Roblox compatible code executor. These are programs designed to run scripts on Roblox. Make sure you are using a safe and reliable executor, as using unauthorized tools can lead to account suspension.
  3. Paste the Code in the Executor: In the code executor, find the area where scripts are entered. Right-click in this area and choose ‘Paste’ or press Ctrl+V to paste the copied script code.
  4. Apply the Script: Look for a button or command within the executor that says ‘Execute’, ‘Run’, or something similar. Click this button to apply the script to your current Roblox environment.
  5. Confirm the Script Has Been Applied: Check the effects in the game or environment to ensure that the script is working as intended. You might see changes immediately, or specific actions might now be enabled or enhanced.
  6. Enjoy: Once the script is confirmed to be working, you can continue playing. Enjoy the new features or modifications that the script has introduced to your Roblox experience.

Leave a Comment