WAPP Legitfarmv2.lua
WAPP Legitfarmv2.lua
-- no filtergc LOL!
local EventHandler
return function()
repeat wait() Humanoid:MoveTo(TargetPoint) until
(LocalPlayer.Character.HumanoidRootPart.Position * Vector3.new(1,0,1) - TargetPoint
* Vector3.new(1,0,1)).Magnitude < 2
end
end
game:GetService("ReplicatedStorage"):WaitForChild("PlayerChannel"):FireServer(unpac
k(args))
end
for i,v in pairs(getconnections(workspace.Main.GivePaycheck.OnClientEvent)) do
v:Disable()
end
workspace:WaitForChild("Main"):WaitForChild("GivePaycheck"):FireServer("Paycheck",
false)
end
local MainClass = {}
MainClass.CharacterAddedConnections = {}
function MainClass:Init(HideOtherCharacters)
if HideOtherCharacters then
for _, Player in next, game.Players:GetPlayers() do
if Player ~= LocalPlayer then
Player.Character.Parent = nil
local CharacterConnection
CharacterConnection =
Player.CharacterAdded:Connect(function(Character)
wait(0.1)
Character.Parent = nil
end)
self.CharacterAddedConnections[Player] = CharacterConnection
end
end
game.Players.PlayerAdded:Connect(function(Player)
if Player ~= LocalPlayer then
local CharacterConnection
CharacterConnection =
Player.CharacterAdded:Connect(function(Character)
wait(0.1)
Character.Parent = nil
end)
self.CharacterAddedConnections[Player] = CharacterConnection
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
local Connection = self.CharacterAddedConnections[Player]
if Connection then
Connection:Disconnect()
self.CharacterAddedConnections[Player] = nil
end
end)
workspace.Main.GivePaycheck.OnClientEvent:Connect(ClaimPaycheck)
end
end
local CashierClass = {}
CashierClass.Timeout = 10
CashierClass.Registers = {workspace.Register1, workspace.Register2,
workspace.Register3}
function CashierClass:GetCustomers()
local ValidCustomers = {}
for _,Customer in next, workspace.Customers:GetChildren() do
local InUse = FindChildByIndexSequence(Customer, {"Head", "InUse"})
if InUse and InUse.Value == false and Customer:FindFirstChild("Torso") and
(Customer.Torso.Velocity.Magnitude < 1 or math.round(Customer.Torso.Velocity.Z) ==
-15) and (Customer.HumanoidRootPart.Position -
self:GetRegisterFromCustomer(Customer).Screen.Position).Magnitude < 22 and not
Customer:GetAttribute("AlreadyHandled") then
table.insert(ValidCustomers, Customer)
end
end
return ValidCustomers
end
function CashierClass:GetRegisterFromCustomer(Customer)
local BestRegister, BestDistance = nil, math.huge
for _, Register in next, self.Registers do
if Customer:FindFirstChild("HumanoidRootPart") and
(Customer.HumanoidRootPart.Position - Register.Screen.Position).Magnitude <
BestDistance then
BestDistance = (Customer.HumanoidRootPart.Position -
Register.Screen.Position).Magnitude
BestRegister = Register
end
end
return BestRegister
end
function CashierClass:GetClosestValidCustomer()
local Customers = CashierClass:GetCustomers()
return BestCustomer
end
CashierClass.OrderConnection =
workspace.GameService.RecivedCustomerOrder.OnClientEvent
local OrderString
local ClientOrderConnection
ClientOrderConnection = self.OrderConnection:Connect(function(Order, ...)
OrderString = Order
ClientOrderConnection:Disconnect()
end)
local TimeTaken = 0
function CashierClass:CustomerHasVisibleBubble(Customer)
local Head = Customer:FindFirstChild("Head")
local IsVisible = false
for i,v in pairs(LocalPlayer.PlayerGui.CustomerBubbles:GetChildren()) do
if v.Adornee == Head and v.Enabled == true then
IsVisible = true
end
end
if Customer.Head.SimpleDialogBillboard.Enabled == true then
return false
end
return IsVisible
end
function CashierClass:IsInUse(Customer)
return FindChildByIndexSequence(Customer, {"Head", "InUse"}).Value and not
CashierClass:CustomerHasVisibleBubble(Customer)
end
coroutine.resume(CashierCoroutine)
MainClass:Init(true)