Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script made by BoredScripter on yt
- _G.Toggle = true
- _G.chosenType = "Low Health" -- only 'Low Health' type works atm
- local farmTypes = {"Nearest", "Low Health", "High Health"}
- local workspace = game:GetService("Workspace")
- local chestsF = workspace.Fight.Chests
- local clientChestsF = workspace.Fight.ClientChests
- local swordModelsF = workspace.Fight.Pets
- local plr = game.Players.LocalPlayer
- local userID = plr.UserId
- local character = plr.character
- local root = character.HumanoidRootPart
- local startPosition = root.CFrame
- local rs = game:GetService("RunService")
- local function Teleport(Root, Part)
- Root.CFrame = Part.CFrame * CFrame.new(0,-15,0)
- end
- local function findChest(chosenType)
- local num = math.huge
- local currentChest
- for i,v in pairs(clientChestsF:GetChildren()) do
- v = chestsF:FindFirstChild(v.Name).ChestHpMax
- if v.Value < num then
- num = v.Value
- currentChest = clientChestsF:FindFirstChild(v.Parent.Name)
- elseif v.Value == num then
- print(v.Parent.Name)
- local secondChest = clientChestsF:FindFirstChild(v.Parent.Name)
- local currentMagnitude = (currentChest.Root.Position - root.Position).Magnitude
- local newMagnitude = (secondChest.Root.Position - root.Position).Magnitude
- if newMagnitude < currentMagnitude then
- num = v.Value
- currentChest = clientChestsF:FindFirstChild(v.Parent.Name)
- end
- end
- end
- return currentChest
- end
- print(findChest(_G.chosenType))
- while _G.Toggle do
- local chest = findChest(_G.chosenType)
- local events = workspace.Fight.Events
- local chHP = chestsF:FindFirstChild(chest.Name).ChestHp
- local args = {[1] = 0, [2] = chest.Name}
- repeat
- Teleport(root, chest.Root)
- print(chest.Root)
- local currentSwordTarget = swordModelsF:FindFirstChild(userID.."_pets"):FindFirstChildWhichIsA("Model").PetTarget
- if currentSwordTarget.Value ~= chest.Name then
- events.FightAttack:InvokeServer(unpack(args))
- print("fired invoke", unpack(args))
- end
- for _,pr in pairs(game:GetService("Workspace").Rewards:GetChildren()) do
- pr.CFrame = root.CFrame
- end
- rs.Heartbeat:Wait()
- until not _G.Toggle or chest.Parent ~= clientChestsF
- print("Dead")
- end
- root.CFrame = startPosition
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement