-- LocalScript: Teletransporte manual con soporte para ceros a la izquierda (01 a 09) local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") -- 1. CREACIÓN DE LA INTERFAZ local screenGui = Instance.new("ScreenGui") screenGui.Name = "EventoCandyGui" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size = UDim2.new(0, 240, 0, 130) mainFrame.Position = UDim2.new(0.02, 0, 0.4, 0) mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40) mainFrame.BorderSizePixel = 0 mainFrame.Parent = screenGui local frameCorner = Instance.new("UICorner") frameCorner.CornerRadius = UDim.new(0, 10) frameCorner.Parent = mainFrame local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, 0, 0, 30) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "🍬 Evento CandyCorn" titleLabel.TextColor3 = Color3.fromRGB(255, 200, 50) titleLabel.TextSize = 14 titleLabel.Font = Enum.Font.GothamBold titleLabel.Parent = mainFrame -- Botón Principal (Siguiente / Iniciar) local nextButton = Instance.new("TextButton") nextButton.Name = "NextBtn" nextButton.Size = UDim2.new(0.9, 0, 0, 40) nextButton.Position = UDim2.new(0.05, 0, 0.28, 0) nextButton.BackgroundColor3 = Color3.fromRGB(230, 126, 34) nextButton.Text = "Iniciar Evento 🚀" nextButton.TextColor3 = Color3.fromRGB(255, 255, 255) nextButton.TextSize = 14 nextButton.Font = Enum.Font.GothamBold nextButton.Parent = mainFrame local btnCorner1 = Instance.new("UICorner") btnCorner1.CornerRadius = UDim.new(0, 8) btnCorner1.Parent = nextButton -- Botón de Reiniciar local resetBtn = Instance.new("TextButton") resetBtn.Name = "ResetBtn" resetBtn.Size = UDim2.new(0.9, 0, 0, 30) resetBtn.Position = UDim2.new(0.05, 0, 0.68, 0) resetBtn.BackgroundColor3 = Color3.fromRGB(192, 57, 43) resetBtn.Text = "Reiniciar a 1 🔄" resetBtn.TextColor3 = Color3.fromRGB(255, 255, 255) resetBtn.TextSize = 12 resetBtn.Font = Enum.Font.GothamMedium resetBtn.Parent = mainFrame local btnCorner2 = Instance.new("UICorner") btnCorner2.CornerRadius = UDim.new(0, 6) btnCorner2.Parent = resetBtn -- 2. LÓGICA DE CONTROL local currentIndex = 0 local function findObjectDeep(name) for _, object in ipairs(Workspace:GetDescendants()) do if object.Name == name then return object end end return nil end local function teleportToNext() currentIndex = currentIndex + 1 if currentIndex > 60 then nextButton.Text = "¡Evento Completado! 🎉" nextButton.BackgroundColor3 = Color3.fromRGB(46, 204, 113) return end local character = player.Character or player.CharacterAdded:Wait() local hrp = character:FindFirstChild("HumanoidRootPart") if not hrp then return end -- Formateamos el número: Si es menor a 10, le agrega el '0' adelante (01, 02... 09) local formattedNumber = tostring(currentIndex) if currentIndex < 10 then formattedNumber = "0" .. tostring(currentIndex) end local targetName = "CandyCorn26_" .. formattedNumber local targetObject = findObjectDeep(targetName) if targetObject then local targetCFrame = nil if targetObject:IsA("BasePart") then targetCFrame = targetObject.CFrame elseif targetObject:IsA("Model") then targetCFrame = targetObject:GetPivot() end if targetCFrame then hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0) character:PivotTo(targetCFrame + Vector3.new(0, 3, 0)) print("✅ Teletransportado a [" .. currentIndex .. "/60]: " .. targetName) end else warn("⚠️ No encontrado: " .. targetName) end -- Actualizar texto del botón para el siguiente paso if currentIndex < 60 then nextButton.Text = "Siguiente ⏭️ (" .. (currentIndex + 1) .. "/60)" nextButton.BackgroundColor3 = Color3.fromRGB(41, 128, 185) else nextButton.Text = "Finalizar 🏁 (60/60)" end end nextButton.MouseButton1Click:Connect(function() teleportToNext() end) resetBtn.MouseButton1Click:Connect(function() currentIndex = 0 nextButton.Text = "Iniciar Evento 🚀" nextButton.BackgroundColor3 = Color3.fromRGB(230, 126, 34) print("🔄 Recorrido reiniciado al número 1") end)