Advertisement
dumamaychami

Dragon Aventure auto fsrm

Feb 20th, 2020
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. -- Variables
  2. local KickSelfOnPlayerJoin = false; -- Kicks you from the game if another player joins
  3.  
  4. local AutoSell = {
  5. true, -- Should it autosell
  6. 10000, -- How many items before selling
  7. 50 -- Amount to sell per batch
  8. };
  9.  
  10. local Attempts = 20; -- How many attempts it should try collecting before giving up
  11.  
  12. -- Script
  13. local Player, VirtualUser = game:GetService'Players'.LocalPlayer, game:GetService'VirtualUser';
  14.  
  15. local function SellItems()
  16. if AutoSell[1] then
  17. for _, Item in ipairs(Player.Data.Resources:GetChildren()) do
  18. if Item.Value >= AutoSell[2] then
  19. repeat wait() Player.Remote:FireServer('SellResource', {[1]=Item.Name; [2]=AutoSell[3]});
  20. until Item.Value <= AutoSell[2] - AutoSell[3];
  21. end;
  22. end;
  23. end;
  24. end;
  25.  
  26. local function KickPlayerOnJoin()
  27. if KickSelfOnPlayerJoin then
  28. if #game.Players:GetPlayers() > 1 then
  29. Player:Kick'Another player joined the game.';
  30. end;
  31. end;
  32. end;
  33.  
  34. local function DetermineObject(Object)
  35. if Object:IsA'Model' and Object:FindFirstChildOfClass'MeshPart' then
  36. return Object:FindFirstChildOfClass'MeshPart';
  37. elseif not Object:IsA'Model' then
  38. return Object;
  39. end;
  40. end;
  41.  
  42. spawn(function()
  43. local Plateform = Instance.new('Part', workspace);
  44. Plateform.Size = Vector3.new(12, 1, 12);
  45. repeat wait() until Player.Character;
  46. while wait() do
  47. pcall(function()
  48. Plateform.Anchored, Plateform.CFrame = true Player.Character:WaitForChild'HumanoidRootPart'.CFrame + Vector3.new(0, -5.2, 0);
  49. end);
  50. end;
  51. end)
  52.  
  53. Player.Idled:Connect(function()
  54. VirtualUser:CaptureController();
  55. VirtualUser:ClickButton2(Vector2.new());
  56. end);
  57.  
  58. while true do
  59. local Object = nil;
  60. repeat wait()
  61. local Resource = workspace.CollectionZones.Resources:GetChildren();
  62. Object = Resource[math.random(1, #Resource)];
  63. until Object ~= nil;
  64.  
  65. SellItems()
  66.  
  67. local CurrentAttempts, ToUse = Attempts, DetermineObject(Object);
  68. repeat
  69. pcall(function()
  70. Player.Character.HumanoidRootPart.CFrame = ToUse.CFrame + Vector3.new(0,-15,0);
  71. end);
  72. wait(.1) Player.Remote:FireServer('PickResourceObj', Object);
  73. CurrentAttempts = CurrentAttempts - 1;
  74. until Object == nil or Object.Parent == nil or CurrentAttempts <= 0;
  75.  
  76. wait(.25) KickPlayerOnJoin();
  77. end;
  78. None
  79. hi
  80. Email PM FindReply Quote Report
  81. Enter Keywords
  82.  
  83. « Next Oldest | Next Newest »
  84. New Reply
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement