Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local KickSelfOnPlayerJoin = false; -- Kicks you from the game if another player joins
- local AutoSell = {
- true, -- Should it autosell
- 10000, -- How many items before selling
- 50 -- Amount to sell per batch
- };
- local Attempts = 20; -- How many attempts it should try collecting before giving up
- -- Script
- local Player, VirtualUser = game:GetService'Players'.LocalPlayer, game:GetService'VirtualUser';
- local function SellItems()
- if AutoSell[1] then
- for _, Item in ipairs(Player.Data.Resources:GetChildren()) do
- if Item.Value >= AutoSell[2] then
- repeat wait() Player.Remote:FireServer('SellResource', {[1]=Item.Name; [2]=AutoSell[3]});
- until Item.Value <= AutoSell[2] - AutoSell[3];
- end;
- end;
- end;
- end;
- local function KickPlayerOnJoin()
- if KickSelfOnPlayerJoin then
- if #game.Players:GetPlayers() > 1 then
- Player:Kick'Another player joined the game.';
- end;
- end;
- end;
- local function DetermineObject(Object)
- if Object:IsA'Model' and Object:FindFirstChildOfClass'MeshPart' then
- return Object:FindFirstChildOfClass'MeshPart';
- elseif not Object:IsA'Model' then
- return Object;
- end;
- end;
- spawn(function()
- local Plateform = Instance.new('Part', workspace);
- Plateform.Size = Vector3.new(12, 1, 12);
- repeat wait() until Player.Character;
- while wait() do
- pcall(function()
- Plateform.Anchored, Plateform.CFrame = true Player.Character:WaitForChild'HumanoidRootPart'.CFrame + Vector3.new(0, -5.2, 0);
- end);
- end;
- end)
- Player.Idled:Connect(function()
- VirtualUser:CaptureController();
- VirtualUser:ClickButton2(Vector2.new());
- end);
- while true do
- local Object = nil;
- repeat wait()
- local Resource = workspace.CollectionZones.Resources:GetChildren();
- Object = Resource[math.random(1, #Resource)];
- until Object ~= nil;
- SellItems()
- local CurrentAttempts, ToUse = Attempts, DetermineObject(Object);
- repeat
- pcall(function()
- Player.Character.HumanoidRootPart.CFrame = ToUse.CFrame + Vector3.new(0,-15,0);
- end);
- wait(.1) Player.Remote:FireServer('PickResourceObj', Object);
- CurrentAttempts = CurrentAttempts - 1;
- until Object == nil or Object.Parent == nil or CurrentAttempts <= 0;
- wait(.25) KickPlayerOnJoin();
- end;
- None
- hi
- Email PM FindReply Quote Report
- Enter Keywords
- « Next Oldest | Next Newest »
- New Reply
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement