Advertisement
timmie140

Auto Sticker collector bee swarm sim

Aug 28th, 2024 (edited)
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.62 KB | None | 0 0
  1. local hiddenStickersFolder = game.Workspace:FindFirstChild("HiddenStickers")
  2. local tweenDuration = 10  -- Duration for the tween to complete
  3. local minRandomWait = 10   -- Minimum wait time before moving to a sticker
  4. local maxRandomWait = 120  -- Maximum wait time before moving to a sticker
  5. local clickWait = 0.5     -- Wait time between clicks while tweening
  6.  
  7. local function randomWait(minSeconds, maxSeconds)
  8.     wait(math.random(minSeconds, maxSeconds))
  9. end
  10.  
  11. local function toggleClickDetectors(enabled)
  12.     for _, part in ipairs(hiddenStickersFolder:GetChildren()) do
  13.         local clickDetector = part:FindFirstChild("ClickDetector")
  14.         if clickDetector and clickDetector:IsA("ClickDetector") then
  15.             clickDetector.MaxActivationDistance = enabled and 5 or 0
  16.         end
  17.     end
  18. end
  19.  
  20. local function toggleNoclip(enabled)
  21.     local player = game.Players.LocalPlayer
  22.     local character = player.Character or player.CharacterAdded:Wait()
  23.     for _, part in ipairs(character:GetDescendants()) do
  24.         if part:IsA("BasePart") then
  25.             part.CanCollide = not enabled
  26.         end
  27.     end
  28. end
  29.  
  30. local function tweenToPositionAndClick(player, part, clickDetector)
  31.     local tweenService = game:GetService("TweenService")
  32.     local humanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
  33.  
  34.     local tweenInfo = TweenInfo.new(tweenDuration, Enum.EasingStyle.Linear)
  35.     local goal = { CFrame = CFrame.new(part.Position) }
  36.  
  37.     local tween = tweenService:Create(humanoidRootPart, tweenInfo, goal)
  38.     tween:Play()
  39.  
  40.     tween.Completed:Wait()
  41.     toggleNoclip(false)
  42.     fireclickdetector(clickDetector)
  43. end
  44.  
  45. local function collectStickers()
  46.     local hiddenStickers = hiddenStickersFolder:GetChildren()
  47.  
  48.     if #hiddenStickers > 0 then
  49.         for _, part in ipairs(hiddenStickers) do
  50.             local clickDetector = part:FindFirstChild("ClickDetector")
  51.  
  52.             if clickDetector and clickDetector:IsA("ClickDetector") then
  53.                 randomWait(minRandomWait, maxRandomWait)
  54.                 toggleNoclip(true)
  55.                 local player = game.Players.LocalPlayer
  56.                 tweenToPositionAndClick(player, part, clickDetector)
  57.                 randomWait(3, 7)
  58.             end
  59.         end
  60.     else
  61.         warn("No parts found in HiddenStickers folder.")
  62.     end
  63. end
  64.  
  65. local function startCollecting()
  66.     while true do
  67.         if hiddenStickersFolder then
  68.             collectStickers()
  69.         else
  70.             warn("HiddenStickers folder not found in Workspace.")
  71.             break
  72.         end
  73.         randomWait(60, 120)
  74.     end
  75. end
  76.  
  77. startCollecting()
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement