Absolutely! To make the three dots bounce in a wave motion below the "Loading" text, we'll use three separate TextLabel dots and animate their Position's Y offset up and down in a wave pattern.
Here's a ready-to-use script that does exactly that:
-- Click-only Loading Animation with Bouncing Dots (Wave Motion)
-- Place this script inside your button part
local button = script.Parent
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
-- Configuration
local teleportTargetName = "NextRoomPart" -- Name of part to teleport to
local loadingTime = 2 -- Seconds to show loading screen
local isClickable = true -- Track if button is clickable
-- Create UI elements
local function createLoadingUI(player)
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "LoadingScreen"
screenGui.Parent = playerGui
-- Black background
local blackFrame = Instance.new("Frame")
blackFrame.Name = "BlackFrame"
blackFrame.Size = UDim2.new(1, 0, 1, 0)
blackFrame.Position = UDim2.new(0, 0, -1, 0)
blackFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
blackFrame.BorderSizePixel = 0
blackFrame.Parent = screenGui
-- Centered loading text container
local loadingContainer = Instance.new("Frame")
loadingContainer.Size = UDim2.new(0, 300, 0, 120)
loadingContainer.Position = UDim2.new(0.5, -150, 0.5, -60)
loadingContainer.BackgroundTransparency = 1
loadingContainer.Parent = blackFrame
-- Loading text
local loadingText = Instance.new("TextLabel")
loadingText.Size = UDim2.new(1, 0, 0.6, 0)
loadingText.Position = UDim2.new(0, 0, 0, 0)
loadingText.BackgroundTransparency = 1
loadingText.Text = "Loading"
loadingText.TextColor3 = Color3.fromRGB(255, 255, 255)
loadingText.TextScaled = true
loadingText.Font = Enum.Font.SourceSansBold
loadingText.Parent = loadingContainer
-- Dots container
local dotsContainer = Instance.new("Frame")
dotsContainer.Size = UDim2.new(0, 60, 0, 30)
dotsContainer.Position = UDim2.new(0.5, -30, 0.7, 0)
dotsContainer.BackgroundTransparency = 1
dotsContainer.Parent = loadingContainer
-- Create three dots
local dotLabels = {}
for i = 1, 3 do
local dot = Instance.new("TextLabel")
dot.Size = UDim2.new(0, 20, 0, 30)
dot.Position = UDim2.new((i-1)/3, 0, 0, 0)
dot.BackgroundTransparency = 1
dot.Text = "."
dot.TextColor3 = Color3.fromRGB(255, 255, 255)
dot.TextScaled = true
dot.Font = Enum.Font.SourceSansBold
dot.Parent = dotsContainer
table.insert(dotLabels, dot)
end
return blackFrame, loadingText, dotLabels, screenGui
end
-- Handle teleportation
local function handleTeleport(player)
local targetPart = workspace:FindFirstChild(teleportTargetName)
if targetPart and targetPart:IsA("BasePart") then
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
character.HumanoidRootPart.CFrame = targetPart.CFrame
end
else
warn("Target part not found or not a BasePart")
end
end
-- Animation sequence
local function showLoadingAnimation(player)
local blackFrame, loadingText, dotLabels, screenGui = createLoadingUI(player)
-- Slide in animation
local slideIn = TweenService:Create(
blackFrame,
TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
{Position = UDim2.new(0, 0, 0, 0)}
)
slideIn:Play()
-- Bouncing dots wave animation
local isAnimating = true
spawn(function()
local t = 0
while isAnimating do
t = t + 0.1
for i, dot in ipairs(dotLabels) do
-- Wave motion: each dot is offset in phase
local offset = math.sin(t*math.pi*2 + (i-1)*math.pi/3) * 8 -- 8 pixels up/down
dot.Position = UDim2.new((i-1)/3, 0, 0, offset)
end
wait(0.05)
end
end)
-- Wait and teleport
wait(loadingTime)
isAnimating = false
handleTeleport(player)
-- Slide out animation
local slideOut = TweenService:Create(
blackFrame,
TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In),
{Position = UDim2.new(0, 0, 1, 0)}
)
slideOut:Play()
slideOut.Completed:Connect(function()
screenGui:Destroy()
isClickable = true
end)
end
-- Click detection
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = button
clickDetector.MouseClick:Connect(function(player)
if isClickable then
isClickable = false
showLoadingAnimation(player)
end
end)
How it works:
- The three dots are always at the bottom of the loading text, spaced evenly.
- Each dot bounces up and down in a wave pattern (like a sine wave), creating a smooth "wave" effect.
- The UI is centered and works on all devices.
- Only one loading screen can appear at a time, and only on click.
How to use:
- Place this script in your button part.
- Make sure you have a part named
NextRoomPart in Workspace for teleporting.
Let me know if you want the wave to be faster, slower, or the dots to bounce higher/lower!