ADVERTISEMENTREMOVE ADS
Auto Farm Script
47,896 views
Script Preview
Description
Script to auto farm case points by joining the winning team every round (if possible)
ADVERTISEMENTREMOVE ADS
106 Lines • 3.08 KiB
Verified
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local VirtualUser = game:GetService("VirtualUser")
local LocalPlayer = Players.LocalPlayer
local running = false
local forcedTeleportPosition = Vector3.new(99999, 99999, 99999)
local postJoinAction = "Auto Kill" -- "Auto Kill" or "Teleport"
local selectedAction = "Auto Kill" -- "Auto Kill" or "Teleport"
LocalPlayer.Idled:Connect(function()
VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
task.wait(1)
VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
end)
function moveSpawnPoints()
local function moveFolder(folder)
for _, spawn in pairs(folder:GetChildren()) do
if spawn:IsA("Part") or spawn:IsA("BasePart") then
spawn.Position = Vector3.new(99999, 99999, 99999)
end
end
end
local map = workspace:FindFirstChild("Map")
if map then
local folders = {"TSpawns", "CTSpawns", "SpawnPoints", "AllSpawns"}
for _, folderName in ipairs(folders) do
local folder = map:FindFirstChild(folderName)
if folder then
moveFolder(folder)
end
end
end
end
function forceKill()
local character = LocalPlayer.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid.Health = 0
end
end
end
function forceTeleport()
local character = LocalPlayer.Character
if character then
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp then
hrp.CFrame = CFrame.new(forcedTeleportPosition)
hrp.Anchored = true
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
end
end
end
function postJoinDo()
if postJoinAction == "Auto Kill" then
wait(7)
forceKill()
elseif postJoinAction == "Teleport" then
forceTeleport()
end
end
function joinTeam(teamName)
ReplicatedStorage:WaitForChild("Events"):WaitForChild("JoinTeam"):FireServer(teamName)
wait(1)
postJoinDo()
end
function autoJoinLoop()
postJoinAction = selectedAction
running = true
while running do
moveSpawnPoints()
local tWins = workspace.Status.TWins.Value
local ctWins = workspace.Status.CTWins.Value
local currentTeam = LocalPlayer.Team and tostring(LocalPlayer.Team.Name) or "None"
if (tWins > ctWins and currentTeam == "T") or (ctWins > tWins and currentTeam == "CT") then
wait(5)
else
if tWins > ctWins then
joinTeam("T")
elseif ctWins > tWins then
joinTeam("CT")
else
joinTeam("CT")
end
wait(2)
end
end
end
spawn(autoJoinLoop)
ADVERTISEMENTREMOVE ADS
ADVERTISEMENTREMOVE ADS


Comments