Advertisement
vtrvsted

autobuy armor

Jul 27th, 2021
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. local PERCENT_TO_BUY_ARMOR = 30 --\\ percent of armor left that u want to buy
  2. local COMMAND_TO_STOP_BUYING = ('/e stop') --\\ message to stop buying
  3.  
  4. ------------------------
  5. ------------------------
  6.  
  7. function announce(title,text,time)
  8. game.StarterGui:SetCore("SendNotification", {
  9. Title = title;
  10. Text = text;
  11. Duration = time;
  12. })
  13. end
  14. announce('Autobuying armor at %' .. tostring(PERCENT_TO_BUY_ARMOR), 'chat ' .. COMMAND_TO_STOP_BUYING .. ' to stop', 8)
  15.  
  16. local Stopped = false
  17. local Player = game.Players.LocalPlayer
  18. function Main1()
  19. while wait() do
  20. local function AutoArmor()
  21. local Origin = Player.Character.HumanoidRootPart.CFrame
  22. local Armor = Player.Character.BodyEffects.Armor
  23. if Armor.Value <= PERCENT_TO_BUY_ARMOR and Stopped == false then
  24. repeat
  25. wait()
  26. Player.Character.HumanoidRootPart.CFrame = game:GetService("Workspace").Ignored.Shop["[Medium Armor] - $1000"].Head.CFrame
  27. fireclickdetector(game:GetService("Workspace").Ignored.Shop["[Medium Armor] - $1000"].ClickDetector)
  28. until Armor.Value == 100 or Player.DataFolder.Currency.Value < 1000
  29. Player.Character.HumanoidRootPart.CFrame = Origin
  30. end
  31. end
  32. local s,e = pcall(AutoArmor)
  33. end
  34. end
  35. function Main2()
  36. Player.Chatted:Connect(function(msg)
  37. if msg == COMMAND_TO_STOP_BUYING and Stopped == false then
  38. Stopped = true
  39. announce('stopped buying', '',5)
  40. end
  41. end)
  42. end
  43. coroutine.resume(coroutine.create(Main1))
  44. coroutine.resume(coroutine.create(Main2))
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement