Roblox Script Bubble Gum Simulator auto trick or treat open sourced

-- Locals
local Plr = game.Players.LocalPlayer
local Char = Plr.Character

-- Services
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")

-- Get Closest
local function GetNextTarget()
   local Target, Closest = nil, math.huge
       
   for i,v in pairs(workspace.HalloweenWorld.Houses:GetChildren()) do
       if (v.Name == "House") then
           for i2,v2 in pairs(v:GetChildren()) do
               if (v2.Name == "Activation") then
                   if (v2.Active and Char.HumanoidRootPart.Anchored ~= true and v2.Tag.BillboardGui.Tag.Text == "Trick Or Treat!") then
                           local Distance = (Char.HumanoidRootPart.Position - v2.Root.Position).Magnitude
                               
                       if (Distance < Closest) then
                           Closest = Distance
                           Target = v2
                       end
                   end
               end
           end
       end
   end
   return Target
end

RunService.Stepped:Connect(function()
   -- No-clip
   if (Char.HumanoidRootPart ~= nil) then
       for i,v in pairs(Char:GetChildren()) do
           if (v:IsA("BasePart") or v:IsA("MeshPart")) then
               if (v.CanCollide == true) then
                   v.CanCollide = false
               end
           end
       end
   end
   
   local Target = GetNextTarget()
   
   local Tweeninfo = TweenInfo.new((Char.HumanoidRootPart.Position - Target.Root.Position).Magnitude / 75)
   local Tp = TweenService:Create(Char.HumanoidRootPart, Tweeninfo, {
       CFrame = CFrame.new(Target.Root.Position.X, Target.Root.Position.Y + 2.5, Target.Root.Position.Z)
   })
   
   if (Target and Char.HumanoidRootPart ~= nil) then
       Tp:Play()
   end
end)