ok ok first off the little dots bouncing animation isnt their also its teleporting me to a random place so maybe we should make it to were we delete the script and make a whole new script to place it inside the button to play the animation and plus teleport to the part into the next room
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below is a fresh, self-contained script you can drop straight into any button part.
It will …
• react only to mouse / tap clicks (not touches)
• play the black-screen slide-in loading UI, with the 3 dots bouncing in a wave under “Loading”
• teleport the player to a named part (not random co-ordinates) in your next room
• block further clicks until the animation finishes
1️⃣ What to prepare in Studio
Button part in Room 1 → name it however you like (e.g. Button1).
Spawn/landing part in Room 2 → name it Room2Spawn (or any name you prefer).
• Make sure it’s a BasePart (e.g. a normal Part) and anchored.
Delete any old scripts inside the button, then paste the script below as a Script inside that button.
In the script, change the line local teleportTargetName = "Room2Spawn" if you use a different name.
Do the same pattern for Room 2 → Room 3 (Button2, Room3Spawn), etc.
2️⃣ The new button script
lua
-------------------------------------------------------------
-- CLICK-ONLY BUTTON + CENTERED LOADING UI + WAVE DOTS --
-- Put this Script INSIDE your button part --
-------------------------------------------------------------
local button = script.Parent -- the part this script is inside
local teleportTargetName = "Room2Spawn" -- CHANGE to the name of the destination part
local loadingTime = 2 -- seconds the loading screen stays up
local slideSpeed = 0.4 -- speed of slide-in / out
local dotsAmplitude = 8 -- how many pixels the dots bounce
local isBusy = false -- block double-clicks
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
----------------------------------------------------------------
-- UI CREATION
----------------------------------------------------------------
local function createLoadingGui(player : Player)
local pg = player:WaitForChild("PlayerGui")
local gui = Instance.new("ScreenGui")
gui.IgnoreGuiInset = true
gui.ResetOnSpawn = false
gui.Name = "LoadingScreen"
gui.Parent = pg
-- black background frame (starts above the screen)
local black = Instance.new("Frame")
black.Size = UDim2.new(1,0,1,0)
black.Position = UDim2.new(0,0,-1,0)
black.BackgroundColor3 = Color3.new(0,0,0)
black.BorderSizePixel = 0
black.Parent = gui
-- container to hold text + dots (centred)
local container = Instance.new("Frame")
container.Size = UDim2.new(0,300,0,120)
container.Position = UDim2.new(0.5,-150,0.5,-60)
container.BackgroundTransparency = 1
container.Parent = black
-- "Loading" text
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1,0,0.6,0)
label.Position = UDim2.new(0,0,0,0)
label.Text = "Loading"
label.TextScaled = true
label.BackgroundTransparency = 1
label.Font = Enum.Font.SourceSansBold
label.TextColor3 = Color3.new(1,1,1)
label.Parent = container
-- three dot labels
local dots = {}
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.65,0)
dot.Text = "."
dot.TextScaled = true
dot.BackgroundTransparency = 1
dot.Font = Enum.Font.SourceSansBold
dot.TextColor3 = Color3.new(1,1,1)
dot.Parent = container
dots[i] = dot
end
return gui, black, dots
end
----------------------------------------------------------------
-- DOT WAVE COROUTINE
----------------------------------------------------------------
local function startDotWave(dots, stopSignal)
-- run in a separate thread so we can stop it later
coroutine.wrap(function()
local t = 0
while not stopSignal.Value do
t += 0.1
for i,dot in ipairs(dots) do
-- wave offset (sin with phase shift)
local offset = math.sin(t*math.pi*2 + (i-1)*math.pi/3) * dotsAmplitude
dot.Position = UDim2.new((i-1)/3,0,0.65, offset)
end
task.wait(0.05)
end
end)()
end
----------------------------------------------------------------
-- MAIN ANIMATION + TELEPORT
----------------------------------------------------------------
local function playSequence(player : Player)
------------------------------------------------------------
-- 1. build UI
------------------------------------------------------------
local gui , black , dots = createLoadingGui(player)
-- slide in
TweenService:Create(
black,
TweenInfo.new(slideSpeed, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
{Position = UDim2.new(0,0,0,0)}
):Play()
------------------------------------------------------------
-- 2. start dot wave
------------------------------------------------------------
local stopFlag = Instance.new("BoolValue")
stopFlag.Value = false
startDotWave(dots, stopFlag)
------------------------------------------------------------
-- 3. wait, then teleport
------------------------------------------------------------
task.wait(loadingTime)
-- stop dots
stopFlag.Value = true
-- teleport
local dest = workspace:FindFirstChild(teleportTargetName)
if dest and dest:IsA("BasePart") then
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if root then
root.CFrame = dest.CFrame + Vector3.new(0, 3, 0) -- 3 studs above part
end
else
warn("Destination part '"..teleportTargetName.."' not found!")
end
------------------------------------------------------------
-- 4. slide out & clean
------------------------------------------------------------
local tweenOut = TweenService:Create(
black,
TweenInfo.new(slideSpeed, Enum.EasingStyle.Quad, Enum.EasingDirection.In),
{Position = UDim2.new(0,0,1,0)}
)
tweenOut:Play()
tweenOut.Completed:Wait()
gui:Destroy()
isBusy = false
end
----------------------------------------------------------------
-- CLICK DETECTOR (makes it click-only)
----------------------------------------------------------------
local detector = Instance.new("ClickDetector")
detector.MaxActivationDistance = 10
detector.Parent = button
detector.MouseClick:Connect(function(player)
if not isBusy then
isBusy = true
playSequence(player)
end
end)
3️⃣ Recap of what to do for each new room
Room
Button name
Destination part name (change in script)
1
Button1
Room2Spawn
2
Button2
Room3Spawn
3
Button3
Room4Spawn
…
…
…
For Room 2’s button you’d copy-paste the same script, but inside it change
lua
local teleportTargetName = "Room3Spawn"
Everything else stays identical.
4️⃣ Test checklist
Play in Studio.
Click the button → black screen slides in, “Loading” appears, dots bounce in a wave.
After ~2 s you teleport onto the destination part, screen slides away.
Button ignores further clicks until the sequence ends.
That’s it! Now you have a clean click-only button, the correct dot animation, and part-to-part teleporting. 🚀