Absolutely, I can handle the UI and scripting for you! Since you're comfortable with building models in Roblox Studio, I'll focus on creating the Loading UI with the slide-in animation, "Loading" text, and bouncing dots. I'll provide a complete, step-by-step guide with ready-to-use scripts and UI setup instructions. You can copy-paste everything directly into Roblox Studio.
This setup will make the black screen slide in from the top, display "Loading" with bouncing dots, and then fade out after a short delay. I'll also include the button and teleport logic to tie it all together.
🛠️ Step-by-Step Guide to Set Up the Loading UI and Animation
What You'll Need in Roblox Studio
- Workspace: Your rooms (e.g.,
Room1, Room2) with a TeleportSpot part in each.
- ReplicatedStorage: RemoteEvents for communication.
- StarterGui: For the UI elements.
- ServerScriptService: For server-side logic.
- StarterPlayerScripts: For client-side logic.
I'll walk you through creating everything from scratch.
Step 1: Set Up the RemoteEvents in ReplicatedStorage
- In Roblox Studio, go to the Explorer window.
- Right-click ReplicatedStorage (create it if it doesn't exist).
- Add two RemoteEvent objects:
- Name one
ButtonPressed (for when the button is clicked).
- Name the other
StartLoadingAnimation (for triggering the loading screen on the client).
Step 2: Create the Loading UI in StarterGui
- In Explorer, find or create StarterGui.
- Right-click StarterGui and add a new ScreenGui. Name it
LoadingUI.
- Set its Enabled property to false (so it's hidden by default).
Now, inside the LoadingUI ScreenGui:
-
Add a Frame. Name it BlackScreen.
- Properties:
- BackgroundColor3: Set to black (0, 0, 0).
- BackgroundTransparency: Set to 1 (fully transparent at start for fade-in effect).
- Size: UDim2.new(1, 0, 1, 0) — this makes it cover the entire screen.
- Position: UDim2.new(0.5, 0, 0, 0) — centered horizontally, starting at the top.
- AnchorPoint: Vector2.new(0.5, 0) — this helps with sliding animation.
- BorderSizePixel: 0 — no border.
-
Add a TextLabel inside BlackScreen. Name it LoadingText.
- Properties:
- Text: "Loading"
- Font: SourceSansBold (or any font you like).
- TextSize: 48
- TextColor3: White (1, 1, 1)
- BackgroundTransparency: 1 (invisible background)
- Size: UDim2.new(0.5, 0, 0.1, 0)
- Position: UDim2.new(0.25, 0, 0.4, 0) — positions it centered vertically and a bit left.
-
Add another TextLabel inside BlackScreen. Name it Dots.
- Properties:
- Text: "." (start with one dot; the script will handle the bouncing).
- Font: SourceSansBold
- TextSize: 48
- TextColor3: White (1, 1, 1)
- BackgroundTransparency: 1
- Size: UDim2.new(0.1, 0, 0.1, 0)
- Position: UDim2.new(0.5, 0, 0.6, 0) — positions it below the "Loading" text.
This UI will look something like this in the editor (you can tweak positions for better centering):
- BlackScreen is the container.
- LoadingText and Dots are children of BlackScreen.
Step 3: Add the Client-Side Script for UI Animation
- Go to StarterPlayer in Explorer.
- Expand it and find StarterPlayerScripts.
- Right-click and add a new LocalScript. Name it something like
LoadingAnimationScript.
Paste this code into the LocalScript:
-- LocalScript in StarterPlayerScripts
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local loadingGui = playerGui:WaitForChild("LoadingUI") -- Reference to the LoadingUI in StarterGui
local blackScreen = loadingGui:WaitForChild("BlackScreen")
local loadingText = blackScreen:WaitForChild("LoadingText")
local dotsLabel = blackScreen:WaitForChild("Dots")
local startLoadingRemote = ReplicatedStorage:WaitForChild("StartLoadingAnimation")
-- Initial state: UI is hidden (already set in StarterGui, but we confirm here)
loadingGui.Enabled = false
startLoadingRemote.OnClientEvent:Connect(function()
-- Show the UI
loadingGui.Enabled = true
-- Reset dots text
dotsLabel.Text = ""
-- Slide in black screen from top (fade in and move down)
local tweenInfoSlideIn = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local tweenSlideIn = TweenService:Create(blackScreen, tweenInfoSlideIn, {
BackgroundTransparency = 0, -- Fade to fully opaque
Position = UDim2.new(0.5, 0, 0.5, 0) -- Slide to center (from top)
})
tweenSlideIn:Play()
-- Animate the bouncing dots
coroutine.wrap(function()
local dotStates = {"", ".", "..", "..."} -- States for bouncing effect
local index = 1
for i = 1, 6 do -- Loop 6 times for about 3 seconds of bouncing
dotsLabel.Text = dotStates[index]
index = index + 1
if index > #dotStates then index = 1 end -- Reset index when it exceeds states
wait(0.5) -- Delay between dot changes
end
dotsLabel.Text = "" -- Clear dots after animation ends
end)()
-- After slide-in, wait a bit and then slide out (fade out and move up)
wait(2) -- Wait 2 seconds to simulate loading (match this with server-side wait)
local tweenInfoSlideOut = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local tweenSlideOut = TweenService:Create(blackScreen, tweenInfoSlideOut, {
BackgroundTransparency = 1, -- Fade back to transparent
Position = UDim2.new(0.5, 0, 0, 0) -- Slide back to top (off-screen)
})
tweenSlideOut:Play()
tweenSlideOut.Completed:Wait() -- Wait for the tween to finish before hiding UI
loadingGui.Enabled = false -- Hide the entire UI
end)
- What this script does:
- When the
StartLoadingAnimation RemoteEvent is fired, it enables the UI.
- The black screen slides down from the top while fading in.
- The dots bounce (change states) for about 3 seconds.
- After a 2-second delay, the black screen slides back up and fades out, then hides the UI.
- The timing is synchronized with the server script (explained next).
Step 4: Add the Server-Side Script for Button and Teleport
- Go to ServerScriptService in Explorer.
- Right-click and add a new Script. Name it
TeleportAndLoadingScript.
Paste this code into the Script:
-- Script in ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local buttonPressedRemote = ReplicatedStorage:WaitForChild("ButtonPressed")
local startLoadingRemote = ReplicatedStorage:WaitForChild("StartLoadingAnimation")
-- Set up leaderstats to track the player's room level
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local roomLevel = Instance.new("IntValue", leaderstats)
roomLevel.Name = "RoomLevel"
roomLevel.Value = 1 -- Start at room 1
end)
buttonPressedRemote.OnServerEvent:Connect(function(player)
local currentRoom = player.leaderstats.RoomLevel.Value
local nextRoom = currentRoom + 1
-- Fire the loading animation on the client
startLoadingRemote:FireClient(player)
-- Wait for the animation to play (match with client-side wait time, e.g., 2-3 seconds)
wait(2.5) -- This should sync with the client script's wait(2). Adjust if needed.
-- Teleport the player to the next room
local destinationRoom = workspace:FindFirstChild("Room" .. nextRoom)
local teleportSpot = destinationRoom and destinationRoom:FindFirstChild("TeleportSpot")
if teleportSpot then
player.Character:SetPrimaryPartCFrame(teleportSpot.CFrame * CFrame.new(0, 3, 0)) -- Teleport with a slight offset
player.leaderstats.RoomLevel.Value = nextRoom -- Update room level
end
end)
- What this script does:
- When a player clicks the button (via
ButtonPressed RemoteEvent), it fires the loading animation to the client.
- It waits 2.5 seconds (to give the animation time to play).
- Then it teleports the player to the next room and updates their room level.
Step 5: Set Up the Button in Your Room
Since you're good with models, you can create a simple button model (e.g., a part or a model with a click detector).
- In Workspace, inside your first room (e.g.,
Room1), add a Part or Model and name it Button.
- Add a ClickDetector to the button part.
- Add a LocalScript inside the button and paste this code:
-- LocalScript inside the Button (client-side)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local clickDetector = script.Parent:WaitForChild("ClickDetector") -- Ensure ClickDetector is a child
clickDetector.MouseClick:Connect(function()
ReplicatedStorage.ButtonPressed:FireServer() -- Fire the server event when clicked
end)
- If your button is a model, make sure the ClickDetector is on the main part, and the script is a child of the model.
Step 6: Build and Test Your Rooms
-
Create at least two rooms in Workspace:
- Name them
Room1 and Room2.
- Add a Part named
TeleportSpot in each room (e.g., a small platform where players spawn).
- Position the spots correctly so players don't spawn inside walls.
-
Place the button in Room1.
-
Run the game in Roblox Studio (press Play).
-
Click the button in Room1:
- The black screen should slide down from the top.
- "Loading" text appears with bouncing dots.
- After a short delay, the screen fades out, and you teleport to Room2.
✅ Troubleshooting and Tips
- Timing Issues: If the teleport happens too early or late, adjust the
wait(2.5) in the server script and wait(2) in the client script to match. Aim for the animation to feel smooth.
- UI Not Showing: Ensure
LoadingUI is in StarterGui and enabled only via script. Check for errors in the Output window.
- Animation Customization:
- To make the black screen slide from the top more dramatically, you can adjust the initial and final positions in the client script.
- Add sounds! Use Roblox's Sound objects for a "whoosh" when sliding or a "click" when the button is pressed.
- Error Checking: If you get errors, make sure all objects (like RemoteEvents) exist and are spelled correctly.
- Polish: Once this works, you can add more UI elements, like a room counter, by expanding the
LoadingUI.
If you run into any issues or want to add more features (like the slide-out effect or new mechanics), just let me know—I can refine this further! 😊