Roblox GUI Maker logoRoblox GUI Maker
Unofficial third-party tool · Not affiliated with Roblox Corporation

Obby Start Screen Roblox GUI Template with Start / Rules / Shop

A colorful obby start screen with start button, rules panel, shop link, and best-time display. Designed with a vibrant cartoon aesthetic optimized for mobile devices. Features animated UI elements, player statistics, level selection preview, and social features like friend invites. Perfect for obstacle course (obby) games, parkour experiences, and timed challenge games on Roblox.

MenuFree
Obby Start Screen Roblox GUI template — Start / Rules / Shop, cartoon menu layout, screenshot 1
Obby Start Screen Roblox GUI template — screenshot 1 of 1, showing start / rules / shop on a cartoon menu layout for mobile.
Open in Web EditorJoin Studio plugin waitlist

Live preview

Obby Start Screen

1920×1080
Zoom100%
Desktop (FHD)
ScreenGui
Frame
OBBY ADVENTURE
Best Time: 02:34
▶ Start
📜 Rules
🛒 Shop
A colorful obby start screen with start button, rules panel, shop link, and best-time display. Designed with a vibrant cartoon aesthetic optimized for mobile devices. Features animated UI elements, player statistics, level selection preview, and social features like friend invites. Perfect for obstacle course (obby) games, parkour experiences, and timed challenge games on Roblox.

Includes real, production-ready Luau logic — not a static mockup.

What's inside

How to use this template

The Obby Start Screen template is the entry point for obstacle course games. Paste the client Luau into StarterGui and a start screen appears with a big Play button, rules panel, and shop link. The Play button fires a RemoteEvent to the server to teleport the player to the first stage. The layout uses Scale-based sizing with large, tappable buttons sized for mobile. The title uses a rounded font for a kid-friendly feel. To customize, change the title text and button colors. Wire the Play button to your stage-teleport logic. The best-time display shows the player's fastest clear time for the current stage, pulled from a DataStore. Test in Studio by clicking Play and confirming the teleport fires.

Add it to your game in 3 steps

  1. 1

    Copy the Luau

    Open the template in the web editor and click Export. Choose LocalScript to copy the full client Luau to your clipboard.

  2. 2

    Paste into StarterGui

    In Roblox Studio, right-click StarterGui in the Explorer, insert a LocalScript, and paste the copied Luau. Rename it to match the template.

  3. 3

    Press Play to verify

    Click Play in Studio. The GUI should appear exactly as designed. Tweak any Size or Position values in the script if you want to adjust the layout.

obby-start-screen.lua
lua
1--[[
2 Obby Start Screen - Client LocalScript
3 A colorful obby start screen with start button, rules panel, shop, and stats.
4 Optimized for mobile layout with cartoon aesthetic.
5 Place in: StarterPlayer > StarterPlayerScripts
6--]]
7
8local Players = game:GetService("Players")
9local TweenService = game:GetService("TweenService")
10local UserInputService = game:GetService("UserInputService")
11local ReplicatedStorage = game:GetService("ReplicatedStorage")
12local TeleportService = game:GetService("TeleportService")
13
14local player = Players.LocalPlayer
15local playerGui = player:WaitForChild("PlayerGui")
16
17-- ============================================================
18-- REMOTE EVENTS
19-- ============================================================
20local remotes = ReplicatedStorage:WaitForChild("Obby_StartScreen_Remotes")
21local requestPlayerDataEvent = remotes:WaitForChild("RequestPlayerData")
22local playerDataEvent = remotes:WaitForChild("PlayerData")
23local startGameEvent = remotes:WaitForChild("StartGame")
24local openShopEvent = remotes:WaitForChild("OpenShop")
25local purchaseItemEvent = remotes:WaitForChild("PurchaseItem")
26local openRulesEvent = remotes:WaitForChild("OpenRules")
27local updateSettingsEvent = remotes:WaitForChild("UpdateSettings")
28local inviteFriendEvent = remotes:WaitForChild("InviteFriend")
29
30-- ============================================================
31-- CONFIGURATION
32-- ============================================================
33local CONFIG = {
34 -- Colors - vibrant cartoon palette
35 BG_GRADIENT_TOP = Color3.fromRGB(100, 180, 255),
36 BG_GRADIENT_BOTTOM = Color3.fromRGB(180, 100, 255),
37 PRIMARY = Color3.fromRGB(255, 200, 50),
38 PRIMARY_LIGHT = Color3.fromRGB(255, 230, 120),
39 SUCCESS = Color3.fromRGB(80, 220, 120),
40 DANGER = Color3.fromRGB(255, 100, 100),
41 INFO = Color3.fromRGB(80, 180, 255),
42 CARD_BG = Color3.fromRGB(255, 255, 255),
43 CARD_BORDER = Color3.fromRGB(230, 230, 240),
44 TEXT_DARK = Color3.fromRGB(50, 55, 70),
45 TEXT_GRAY = Color3.fromRGB(130, 140, 160),
46 TEXT_WHITE = Color3.fromRGB(255, 255, 255),
47 PANEL_BG = Color3.fromRGB(40, 45, 60),
48 PANEL_BG_LIGHT = Color3.fromRGB(55, 60, 80),
49 BEST_TIME_GOLD = Color3.fromRGB(255, 200, 50),
50 LEVEL_BLUE = Color3.fromRGB(80, 160, 255),
51 ATTEMPTS_RED = Color3.fromRGB(255, 120, 120),
52 SHINE_WHITE = Color3.fromRGB(255, 255, 255),
53
54 -- Animation
55 TWEEN_BOUNCE = TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
56 TWEEN_FAST = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
57 TWEEN_NORMAL = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
58 TWEEN_SLOW = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
59 TWEEN_ELASTIC = TweenInfo.new(0.7, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out),
60 PANEL_SLIDE_TIME = 0.4,
61 BUTTON_PULSE_SPEED = 1.8,
62 LOADING_DURATION = 2,
63
64 -- Layout
65 START_BUTTON_WIDTH = 220,
66 START_BUTTON_HEIGHT = 60,
67 BOTTOM_BAR_HEIGHT = 70,
68 CARD_CORNER = 16,
69 STAT_CARD_WIDTH = 100,
70}
71
72-- ============================================================
73-- STATE
74-- ============================================================
75local state = {
76 currentPanel = nil, -- "rules", "shop", "leaderboard", "settings", "friends", nil
77 bestTime = 0,
78 currentLevel = 1,
79 totalAttempts = 0,
80 isLoading = true,
81 musicEnabled = true,
82 sfxEnabled = true,
83 difficulty = "normal",
84 friendsList = {},
85 shopItems = {},
86 leaderboardData = {},
87}
88
89-- ============================================================
90-- HELPER FUNCTIONS
91-- ============================================================
92
93local function createInstance(className, props)
94 local instance = Instance.new(className)
95 for key, value in pairs(props) do
96 instance[key] = value
97 end
98 return instance
99end
100
101local function createCorner(parent, radius)
102 local corner = Instance.new("UICorner")
103 corner.CornerRadius = UDim.new(0, radius or CONFIG.CARD_CORNER)
104 corner.Parent = parent
105 return corner
106end
107
108local function createStroke(parent, color, thickness)
109 local stroke = Instance.new("UIStroke")
110 stroke.Color = color or CONFIG.CARD_BORDER
111 stroke.Thickness = thickness or 2
112 stroke.Parent = parent
113 return stroke
114end
115
116local function createGradient(parent, color1, color2, rotation)
117 local gradient = Instance.new("UIGradient")
118 gradient.Color = ColorSequence.new({
119 ColorSequenceKeypoint.new(0, color1 or CONFIG.PRIMARY),
120 ColorSequenceKeypoint.new(1, color2 or CONFIG.PRIMARY_LIGHT),
121 })
122 gradient.Rotation = rotation or 0
123 gradient.Parent = parent
124 return gradient
125end
126
127local function formatTime(seconds)
128 if seconds <= 0 then
129 return "--:--"
130 end
131 local mins = math.floor(seconds / 60)
132 local secs = math.floor(seconds % 60)
133 local ms = math.floor((seconds % 1) * 100)
134 return string.format("%02d:%02d.%02d", mins, secs, ms)
135end
136
137-- ============================================================
138-- UI CONSTRUCTION
139-- ============================================================
140
141local screenGui = createInstance("ScreenGui", {
142 Name = "Obby_StartScreen",
143 ResetOnSpawn = false,
144 ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
145 Parent = playerGui,
146})
147
148-- --------------------------------------------------------
149-- BACKGROUND
150-- --------------------------------------------------------
151local background = createInstance("Frame", {
152 Name = "Background",
153 Size = UDim2.fromScale(1, 1),
154 BackgroundColor3 = CONFIG.BG_GRADIENT_TOP,
155 BorderSizePixel = 0,
156 ZIndex = 1,
157 Parent = screenGui,
158})
159
160local bgGradient = createGradient(background, CONFIG.BG_GRADIENT_TOP, CONFIG.BG_GRADIENT_BOTTOM, 135)
161
162-- Decorative floating shapes
163local shapes = {}
164for i = 1, 6 do
165 local shape = createInstance("Frame", {
166 Name = "Shape_" .. i,
167 Size = UDim2.fromOffset(math.random(40, 80), math.random(40, 80)),
168 Position = UDim2.new(math.random() * 0.8, 0, math.random() * 0.8, 0),
169 BackgroundColor3 = Color3.fromRGB(255, 255, 255),
170 BackgroundTransparency = 0.85,
171 BorderSizePixel = 0,
172 Rotation = math.random(0, 45),
173 ZIndex = 2,
174 Parent = background,
175 })
176 createCorner(shape, math.random(8, 40))
177 table.insert(shapes, shape)
178end
179
180-- Animate shapes
181for i, shape in ipairs(shapes) do
182 local driftX = math.random(-30, 30)
183 local driftY = math.random(-20, 20)
184 TweenService:Create(shape, TweenInfo.new(3 + i * 0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), {
185 Position = UDim2.new(shape.Position.X.Scale, driftX, shape.Position.Y.Scale, driftY),
186 Rotation = shape.Rotation + 10,
187 }):Play()
188end
189
190-- --------------------------------------------------------
191-- MAIN CONTAINER
192-- --------------------------------------------------------
193local mainContainer = createInstance("Frame", {
194 Name = "MainContainer",
195 Size = UDim2.fromScale(1, 1),
196 BackgroundTransparency = 1,
197 ZIndex = 10,
198 Parent = screenGui,
199})
200
201-- --------------------------------------------------------
202-- TITLE CONTAINER
203-- --------------------------------------------------------
204local titleContainer = createInstance("Frame", {
205 Name = "TitleContainer",
206 Size = UDim2.new(1, 0, 0, 100),
207 Position = UDim2.fromOffset(0, 40),
208 BackgroundTransparency = 1,
209 ZIndex = 11,
210 Parent = mainContainer,
211})
212
213local gameTitle = createInstance("TextLabel", {
214 Name = "GameTitle",
215 Size = UDim2.new(1, 0, 0, 50),
216 Position = UDim2.fromOffset(0, 0),
217 BackgroundTransparency = 1,
218 Text = "OBBY CHALLENGE",
219 TextColor3 = CONFIG.TEXT_WHITE,
220 TextSize = 38,
221 Font = Enum.Font.GothamBlack,
222 ZIndex = 12,
223 Parent = titleContainer,
224})
225
226local titleShadow = createInstance("TextLabel", {
227 Name = "TitleShadow",
228 Size = UDim2.new(1, 0, 0, 50),
229 Position = UDim2.fromOffset(2, 2),
230 BackgroundTransparency = 1,
231 Text = "OBBY CHALLENGE",
232 TextColor3 = Color3.fromRGB(0, 0, 0),
233 TextTransparency = 0.6,
234 TextSize = 38,
235 Font = Enum.Font.GothamBlack,
236 ZIndex = 11,
237 Parent = titleContainer,
238})
239
240local subtitle = createInstance("TextLabel", {
241 Name = "Subtitle",
242 Size = UDim2.new(1, 0, 0, 24),
243 Position = UDim2.fromOffset(0, 52),
244 BackgroundTransparency = 1,
245 Text = "Can you beat the tower?",
246 TextColor3 = CONFIG.PRIMARY_LIGHT,
247 TextSize = 16,
248 Font = Enum.Font.GothamBold,
249 ZIndex = 12,
250 Parent = titleContainer,
251})
252
253local titleUnderline = createInstance("Frame", {
254 Name = "TitleUnderline",
255 Size = UDim2.fromOffset(200, 4),
256 Position = UDim2.new(0.5, -100, 0, 82),
257 BackgroundColor3 = CONFIG.PRIMARY,
258 BorderSizePixel = 0,
259 ZIndex = 12,
260 Parent = titleContainer,
261})
262createCorner(titleUnderline, 2)
263createGradient(titleUnderline, CONFIG.PRIMARY, CONFIG.PRIMARY_LIGHT, 0)
264
265-- --------------------------------------------------------
266-- CHARACTER SHOWCASE
267-- --------------------------------------------------------
268local characterShowcase = createInstance("Frame", {
269 Name = "CharacterShowcase",
270 Size = UDim2.fromOffset(140, 160),
271 Position = UDim2.new(0.5, 0, 0, 160),
272 AnchorPoint = Vector2.new(0.5, 0),
273 BackgroundTransparency = 1,
274 ZIndex = 11,
275 Parent = mainContainer,
276})
277
278local characterBg = createInstance("Frame", {
279 Name = "CharacterBg",
280 Size = UDim2.fromOffset(120, 120),
281 Position = UDim2.new(0.5, 0, 0, 0),
282 AnchorPoint = Vector2.new(0.5, 0),
283 BackgroundColor3 = CONFIG.CARD_BG,
284 BackgroundTransparency = 0.3,
285 BorderSizePixel = 0,
286 ZIndex = 11,
287 Parent = characterShowcase,
288})
289createCorner(characterBg, 20)
290createStroke(characterBg, CONFIG.CARD_BORDER, 2)
291
292local characterImage = createInstance("ImageLabel", {
293 Name = "CharacterImage",
294 Size = UDim2.fromOffset(100, 100),
295 Position = UDim2.fromScale(0.5, 0.5),
296 AnchorPoint = Vector2.new(0.5, 0.5),
297 BackgroundTransparency = 1,
298 Image = "",
299 ZIndex = 12,
300 Parent = characterBg,
301})
302
303-- Character placeholder (smiley face)
304local characterPlaceholder = createInstance("TextLabel", {
305 Name = "CharacterPlaceholder",
306 Size = UDim2.fromScale(1, 1),
307 BackgroundTransparency = 1,
308 Text = ":D",
309 TextColor3 = CONFIG.TEXT_DARK,
310 TextSize = 48,
311 Font = Enum.Font.GothamBlack,
312 ZIndex = 13,
313 Parent = characterImage,
314})
315
316-- Floating animation for character
317TweenService:Create(characterBg, TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), {
318 Position = UDim2.new(0.5, 0, 0, -10),
319}):Play()
320
321local characterPlatform = createInstance("Frame", {
322 Name = "CharacterPlatform",
323 Size = UDim2.fromOffset(100, 12),
324 Position = UDim2.new(0.5, 0, 0, 130),
325 AnchorPoint = Vector2.new(0.5, 0),
326 BackgroundColor3 = CONFIG.PRIMARY,
327 BorderSizePixel = 0,
328 ZIndex = 10,
329 Parent = characterShowcase,
330})
331createCorner(characterPlatform, 6)
332
333-- --------------------------------------------------------
334-- STATS ROW
335-- --------------------------------------------------------
336local statsRow = createInstance("Frame", {
337 Name = "StatsRow",
338 Size = UDim2.new(1, -40, 0, 60),
339 Position = UDim2.new(0.5, 0, 0, 340),
340 AnchorPoint = Vector2.new(0.5, 0),
341 BackgroundTransparency = 1,
342 ZIndex = 11,
343 Parent = mainContainer,
344})
345
346local statsLayout = createInstance("UIListLayout", {
347 FillDirection = Enum.FillDirection.Horizontal,
348 HorizontalAlignment = Enum.HorizontalAlignment.Center,
349 VerticalAlignment = Enum.VerticalAlignment.Center,
350 Padding = UDim.new(0, 12),
351 Parent = statsRow,
352})
353
354-- Stat card factory
355local function createStatCard(name, label, color, parent)
356 local card = createInstance("Frame", {
357 Name = name .. "Card",
358 Size = UDim2.fromOffset(100, 56),
359 BackgroundColor3 = CONFIG.CARD_BG,
360 BackgroundTransparency = 0.2,
361 BorderSizePixel = 0,
362 ZIndex = 11,
363 Parent = parent,
364 })
365 createCorner(card, 12)
366 createStroke(card, CONFIG.CARD_BORDER, 1)
367
368 local labelText = createInstance("TextLabel", {
369 Name = "Label",
370 Size = UDim2.new(1, 0, 0, 16),
371 Position = UDim2.fromOffset(0, 4),
372 BackgroundTransparency = 1,
373 Text = label,
374 TextColor3 = CONFIG.TEXT_GRAY,
375 TextSize = 9,
376 Font = Enum.Font.GothamBold,
377 ZIndex = 12,
378 Parent = card,
379 })
380
381 local valueText = createInstance("TextLabel", {
382 Name = "Value",
383 Size = UDim2.new(1, 0, 0, 32),
384 Position = UDim2.fromOffset(0, 20),
385 BackgroundTransparency = 1,
386 Text = "--",
387 TextColor3 = color,
388 TextSize = 22,
389 Font = Enum.Font.GothamBlack,
390 ZIndex = 12,
391 Parent = card,
392 })
393
394 return card, valueText
395end
396
397local bestTimeCard, bestTimeValue = createStatCard("BestTime", "BEST TIME", CONFIG.BEST_TIME_GOLD, statsRow)
398local levelCard, levelValue = createStatCard("Level", "LEVEL", CONFIG.LEVEL_BLUE, statsRow)
399local attemptsCard, attemptsValue = createStatCard("Attempts", "ATTEMPTS", CONFIG.ATTEMPTS_RED, statsRow)
400
401-- --------------------------------------------------------
402-- START BUTTON
403-- --------------------------------------------------------
404local startButton = createInstance("TextButton", {
405 Name = "StartButton",
406 Size = UDim2.fromOffset(CONFIG.START_BUTTON_WIDTH, CONFIG.START_BUTTON_HEIGHT),
407 Position = UDim2.new(0.5, 0, 0, 420),
408 AnchorPoint = Vector2.new(0.5, 0),
409 BackgroundColor3 = CONFIG.SUCCESS,
410 Text = "",
411 BorderSizePixel = 0,
412 ZIndex = 12,
413 Parent = mainContainer,
414})
415createCorner(startButton, 30)
416createStroke(startButton, Color3.fromRGB(60, 180, 100), 3)
417createGradient(startButton, CONFIG.SUCCESS, Color3.fromRGB(120, 240, 160), 90)
418
419local startButtonText = createInstance("TextLabel", {
420 Name = "ButtonText",
421 Size = UDim2.fromScale(1, 1),
422 BackgroundTransparency = 1,
423 Text = "START GAME",
424 TextColor3 = CONFIG.TEXT_WHITE,
425 TextSize = 22,
426 Font = Enum.Font.GothamBlack,
427 ZIndex = 13,
428 Parent = startButton,
429})
430
431-- Button shine effect
432local buttonShine = createInstance("Frame", {
433 Name = "ButtonShine",
434 Size = UDim2.fromOffset(60, CONFIG.START_BUTTON_HEIGHT),
435 Position = UDim2.fromOffset(-60, 0),
436 BackgroundColor3 = CONFIG.SHINE_WHITE,
437 BackgroundTransparency = 0.7,
438 BorderSizePixel = 0,
439 ZIndex = 13,
440 Parent = startButton,
441})
442createGradient(buttonShine, CONFIG.SHINE_WHITE, Color3.fromRGB(255, 255, 255), 0)
443
444-- Animate shine
445local function animateShine()
446 while startButton and startButton.Parent do
447 buttonShine.Position = UDim2.fromOffset(-60, 0)
448 buttonShine.BackgroundTransparency = 0.7
449 local shine = TweenService:Create(buttonShine, TweenInfo.new(1.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
450 Position = UDim2.fromOffset(CONFIG.START_BUTTON_WIDTH + 20, 0),
451 BackgroundTransparency = 1,
452 })
453 shine:Play()
454 shine.Completed:Wait()
455 task.wait(2)
456 end
457end
458task.spawn(animateShine)
459
460-- Button hover
461startButton.MouseEnter:Connect(function()
462 TweenService:Create(startButton, CONFIG.TWEEN_FAST, { Size = UDim2.fromOffset(CONFIG.START_BUTTON_WIDTH + 10, CONFIG.START_BUTTON_HEIGHT + 6) }):Play()
463end)
464
465startButton.MouseLeave:Connect(function()
466 TweenService:Create(startButton, CONFIG.TWEEN_FAST, { Size = UDim2.fromOffset(CONFIG.START_BUTTON_WIDTH, CONFIG.START_BUTTON_HEIGHT) }):Play()
467end)
468
469-- Button click
470startButton.Activated:Connect(function()
471 -- Press animation
472 TweenService:Create(startButton, CONFIG.TWEEN_FAST, { Size = UDim2.fromOffset(CONFIG.START_BUTTON_WIDTH - 10, CONFIG.START_BUTTON_HEIGHT - 6) }):Play()
473 task.delay(0.1, function()
474 TweenService:Create(startButton, CONFIG.TWEEN_BOUNCE, { Size = UDim2.fromOffset(CONFIG.START_BUTTON_WIDTH, CONFIG.START_BUTTON_HEIGHT) }):Play()
475 end)
476
477 -- Start game
478 startGameEvent:FireServer()
479end)
480
481-- --------------------------------------------------------
482-- SECONDARY BUTTONS
483-- --------------------------------------------------------
484local secondaryButtons = createInstance("Frame", {
485 Name = "SecondaryButtons",
486 Size = UDim2.new(1, 0, 0, 40),
487 Position = UDim2.new(0.5, 0, 0, 492),
488 AnchorPoint = Vector2.new(0.5, 0),
489 BackgroundTransparency = 1,
490 ZIndex = 11,
491 Parent = mainContainer,
492})
493
494local secondaryLayout = createInstance("UIListLayout", {
495 FillDirection = Enum.FillDirection.Horizontal,
496 HorizontalAlignment = Enum.HorizontalAlignment.Center,
497 VerticalAlignment = Enum.VerticalAlignment.Center,
498 Padding = UDim.new(0, 12),
499 Parent = secondaryButtons,
500})
501
502local continueButton = createInstance("TextButton", {
503 Name = "ContinueButton",
504 Size = UDim2.fromOffset(130, 36),
505 BackgroundColor3 = CONFIG.INFO,
506 Text = "Continue",
507 TextColor3 = CONFIG.TEXT_WHITE,
508 TextSize = 14,
509 Font = Enum.Font.GothamBold,
510 BorderSizePixel = 0,
511 ZIndex = 12,
512 Parent = secondaryButtons,
513 Visible = false,
514})
515createCorner(continueButton, 18)
516
517local levelsButton = createInstance("TextButton", {
518 Name = "LevelsButton",
519 Size = UDim2.fromOffset(130, 36),
520 BackgroundColor3 = CONFIG.PANEL_BG_LIGHT,
521 Text = "Levels",
522 TextColor3 = CONFIG.TEXT_WHITE,
523 TextSize = 14,
524 Font = Enum.Font.GothamBold,
525 BorderSizePixel = 0,
526 ZIndex = 12,
527 Parent = secondaryButtons,
528})
529createCorner(levelsButton, 18)
530
531-- --------------------------------------------------------
532-- BOTTOM BAR
533-- --------------------------------------------------------
534local bottomBar = createInstance("Frame", {
535 Name = "BottomBar",
536 Size = UDim2.new(1, 0, 0, CONFIG.BOTTOM_BAR_HEIGHT),
537 Position = UDim2.new(0, 0, 1, 0),
538 AnchorPoint = Vector2.new(0, 1),
539 BackgroundColor3 = CONFIG.PANEL_BG,
540 BackgroundTransparency = 0.1,
541 BorderSizePixel = 0,
542 ZIndex = 12,
543 Parent = mainContainer,
544})
545createCorner(bottomBar, 20)
546
547local bottomLayout = createInstance("UIListLayout", {
548 FillDirection = Enum.FillDirection.Horizontal,
549 HorizontalAlignment = Enum.HorizontalAlignment.Center,
550 VerticalAlignment = Enum.VerticalAlignment.Center,
551 Padding = UDim.new(0, 20),
552 Parent = bottomBar,
553})
554
555local bottomButtonConfigs = {
556 { name = "RulesButton", icon = "RULES", label = "Rules" },
557 { name = "ShopButton", icon = "SHOP", label = "Shop" },
558 { name = "LeaderboardButton", icon = "RANK", label = "Rank" },
559 { name = "SettingsButton", icon = "SET", label = "Settings" },
560 { name = "FriendsButton", icon = "FRIENDS", label = "Friends" },
561}
562
563local bottomButtons = {}
564
565for _, cfg in ipairs(bottomButtonConfigs) do
566 local btn = createInstance("TextButton", {
567 Name = cfg.name,
568 Size = UDim2.fromOffset(56, 56),
569 BackgroundColor3 = CONFIG.PANEL_BG_LIGHT,
570 Text = cfg.icon,
571 TextColor3 = CONFIG.TEXT_WHITE,
572 TextSize = 9,
573 Font = Enum.Font.GothamBlack,
574 BorderSizePixel = 0,
575 ZIndex = 13,
576 Parent = bottomBar,
577 })
578 createCorner(btn, 14)
579
580 local btnLabel = createInstance("TextLabel", {
581 Name = "Label",
582 Size = UDim2.new(1, 0, 0, 14),
583 Position = UDim2.fromOffset(0, 42),
584 BackgroundTransparency = 1,
585 Text = cfg.label,
586 TextColor3 = CONFIG.TEXT_GRAY,
587 TextSize = 8,
588 Font = Enum.Font.GothamBold,
589 ZIndex = 14,
590 Parent = btn,
591 })
592
593 btn.MouseEnter:Connect(function()
594 TweenService:Create(btn, CONFIG.TWEEN_FAST, { BackgroundColor3 = CONFIG.INFO }):Play()
595 end)
596 btn.MouseLeave:Connect(function()
597 TweenService:Create(btn, CONFIG.TWEEN_FAST, { BackgroundColor3 = CONFIG.PANEL_BG_LIGHT }):Play()
598 end)
599
600 bottomButtons[cfg.name] = btn
601end
602
603-- --------------------------------------------------------
604-- PANELS (Rules, Shop, Leaderboard, Settings, Friends)
605-- --------------------------------------------------------
606
607local panels = {}
608
609local function createPanel(name, title, width, height)
610 local panel = createInstance("Frame", {
611 Name = name .. "Panel",
612 Size = UDim2.fromOffset(width, height),
613 Position = UDim2.new(0.5, 0, 1, 50),
614 AnchorPoint = Vector2.new(0.5, 1),
615 BackgroundTransparency = 1,
616 ZIndex = 20,
617 Parent = mainContainer,
618 Visible = false,
619 })
620
621 local bg = createInstance("Frame", {
622 Name = "Bg",
623 Size = UDim2.fromScale(1, 1),
624 BackgroundColor3 = CONFIG.PANEL_BG,
625 BackgroundTransparency = 0.1,
626 BorderSizePixel = 0,
627 ZIndex = 20,
628 Parent = panel,
629 })
630 createCorner(bg, 20)
631 createStroke(bg, CONFIG.PANEL_BG_LIGHT, 2)
632
633 local titleLabel = createInstance("TextLabel", {
634 Name = "Title",
635 Size = UDim2.new(1, 0, 0, 36),
636 Position = UDim2.fromOffset(0, 8),
637 BackgroundTransparency = 1,
638 Text = title,
639 TextColor3 = CONFIG.PRIMARY,
640 TextSize = 20,
641 Font = Enum.Font.GothamBlack,
642 ZIndex = 21,
643 Parent = panel,
644 })
645
646 local closeBtn = createInstance("TextButton", {
647 Name = "Close",
648 Size = UDim2.fromOffset(36, 36),
649 Position = UDim2.new(1, -42, 0, 8),
650 BackgroundColor3 = CONFIG.DANGER,
651 Text = "X",
652 TextColor3 = CONFIG.TEXT_WHITE,
653 TextSize = 16,
654 Font = Enum.Font.GothamBlack,
655 BorderSizePixel = 0,
656 ZIndex = 22,
657 Parent = panel,
658 })
659 createCorner(closeBtn, 10)
660
661 closeBtn.Activated:Connect(function()
662 closePanel(name:lower())
663 end)
664
665 panels[name:lower()] = panel
666 return panel, bg
667end
668
669-- Rules Panel
670local rulesPanel, rulesBg = createPanel("Rules", "HOW TO PLAY", 340, 420)
671local rulesContent = createInstance("ScrollingFrame", {
672 Name = "RulesContent",
673 Size = UDim2.new(1, -24, 1, -80),
674 Position = UDim2.fromOffset(12, 50),
675 BackgroundTransparency = 1,
676 ScrollBarThickness = 4,
677 ScrollBarImageColor3 = CONFIG.PANEL_BG_LIGHT,
678 ZIndex = 21,
679 Parent = rulesBg,
680})
681
682local rulesText = createInstance("TextLabel", {
683 Name = "RulesText",
684 Size = UDim2.new(1, -8, 0, 600),
685 Position = UDim2.fromOffset(4, 0),
686 BackgroundTransparency = 1,
687 Text = [[
6881. Reach the top of the tower!
689 Jump across platforms and avoid falling into the void.
690
6912. Don't touch the red blocks!
692 Red blocks will send you back to the last checkpoint.
693
6943. Collect stars along the way!
695 Stars give you bonus points at the end of each level.
696
6974. Beat the clock!
698 Each level has a time limit. Try to beat your best time!
699
7005. Use checkpoints wisely!
701 Blue pads are checkpoints. Stand on them to save progress.
702
7036. Watch out for moving platforms!
704 Some platforms move or disappear after you step on them.
705
7067. Power-ups help you!
707 Look for speed boosts and jump boosts scattered around.
708
7098. Compete with friends!
710 Check the leaderboard to see who's the fastest climber.
711 ]],
712 TextColor3 = CONFIG.TEXT_WHITE,
713 TextSize = 13,
714 Font = Enum.Font.GothamBold,
715 TextWrapped = true,
716 TextXAlignment = Enum.TextXAlignment.Left,
717 TextYAlignment = Enum.TextYAlignment.Top,
718 LineHeight = 1.6,
719 ZIndex = 22,
720 Parent = rulesContent,
721})
722
723-- Shop Panel
724local shopPanel, shopBg = createPanel("Shop", "ITEM SHOP", 360, 460)
725local shopItemsScrolling = createInstance("ScrollingFrame", {
726 Name = "ShopItems",
727 Size = UDim2.new(1, -24, 1, -80),
728 Position = UDim2.fromOffset(12, 50),
729 BackgroundTransparency = 1,
730 ScrollBarThickness = 4,
731 ScrollBarImageColor3 = CONFIG.PANEL_BG_LIGHT,
732 ZIndex = 21,
733 Parent = shopBg,
734})
735
736local shopGrid = createInstance("UIGridLayout", {
737 CellSize = UDim2.fromOffset(100, 130),
738 CellPadding = UDim2.fromOffset(10, 10),
739 HorizontalAlignment = Enum.HorizontalAlignment.Center,
740 VerticalAlignment = Enum.VerticalAlignment.Top,
741 Parent = shopItemsScrolling,
742})
743
744-- Shop item template
745local function createShopItemCard(name, price, color)
746 local card = createInstance("Frame", {
747 Name = "ShopItem_" .. name,
748 Size = UDim2.fromOffset(100, 130),
749 BackgroundColor3 = CONFIG.PANEL_BG_LIGHT,
750 BorderSizePixel = 0,
751 ZIndex = 22,
752 Parent = shopItemsScrolling,
753 })
754 createCorner(card, 12)
755
756 local img = createInstance("Frame", {
757 Name = "Image",
758 Size = UDim2.new(1, -8, 0, 60),
759 Position = UDim2.fromOffset(4, 4),
760 BackgroundColor3 = color,
761 BorderSizePixel = 0,
762 ZIndex = 23,
763 Parent = card,
764 })
765 createCorner(img, 8)
766
767 local nameLabel = createInstance("TextLabel", {
768 Name = "Name",
769 Size = UDim2.new(1, 0, 0, 20),
770 Position = UDim2.fromOffset(0, 68),
771 BackgroundTransparency = 1,
772 Text = name,
773 TextColor3 = CONFIG.TEXT_WHITE,
774 TextSize = 11,
775 Font = Enum.Font.GothamBold,
776 ZIndex = 23,
777 Parent = card,
778 })
779
780 local priceLabel = createInstance("TextLabel", {
781 Name = "Price",
782 Size = UDim2.new(1, 0, 0, 16),
783 Position = UDim2.fromOffset(0, 88),
784 BackgroundTransparency = 1,
785 Text = tostring(price) .. " Coins",
786 TextColor3 = CONFIG.PRIMARY,
787 TextSize = 10,
788 Font = Enum.Font.GothamBold,
789 ZIndex = 23,
790 Parent = card,
791 })
792
793 local buyBtn = createInstance("TextButton", {
794 Name = "Buy",
795 Size = UDim2.new(1, -8, 0, 24),
796 Position = UDim2.fromOffset(4, 104),
797 BackgroundColor3 = CONFIG.SUCCESS,
798 Text = "Buy",
799 TextColor3 = CONFIG.TEXT_WHITE,
800 TextSize = 11,
801 Font = Enum.Font.GothamBlack,
802 BorderSizePixel = 0,
803 ZIndex = 23,
804 Parent = card,
805 })
806 createCorner(buyBtn, 6)
807
808 buyBtn.Activated:Connect(function()
809 purchaseItemEvent:FireServer(name)
810 end)
811
812 return card
813end
814
815-- Create shop items
816local shopItems = {
817 { name = "Speed Boost", price = 150, color = Color3.fromRGB(80, 180, 255) },
818 { name = "Jump Boost", price = 200, color = Color3.fromRGB(120, 220, 100) },
819 { name = "Shield", price = 300, color = Color3.fromRGB(255, 200, 80) },
820 { name = "Checkpoint", price = 100, color = Color3.fromRGB(180, 120, 255) },
821 { name = "Magnet", price = 250, color = Color3.fromRGB(255, 120, 120) },
822 { name = "Gravity", price = 400, color = Color3.fromRGB(120, 200, 200) },
823}
824
825for _, item in ipairs(shopItems) do
826 createShopItemCard(item.name, item.price, item.color)
827end
828
829-- Leaderboard Panel
830local leaderboardPanel, lbBg = createPanel("Leaderboard", "LEADERBOARD", 340, 420)
831local lbScrolling = createInstance("ScrollingFrame", {
832 Name = "LeaderboardList",
833 Size = UDim2.new(1, -24, 1, -80),
834 Position = UDim2.fromOffset(12, 50),
835 BackgroundTransparency = 1,
836 ScrollBarThickness = 4,
837 ScrollBarImageColor3 = CONFIG.PANEL_BG_LIGHT,
838 ZIndex = 21,
839 Parent = lbBg,
840})
841
842local lbLayout = createInstance("UIListLayout", {
843 SortOrder = Enum.SortOrder.LayoutOrder,
844 Padding = UDim.new(0, 4),
845 Parent = lbScrolling,
846})
847
848local function createLeaderboardRow(rank, playerName, time, isPlayer)
849 local row = createInstance("Frame", {
850 Name = "Row_" .. rank,
851 Size = UDim2.new(1, -8, 0, 36),
852 BackgroundColor3 = isPlayer and CONFIG.INFO or CONFIG.PANEL_BG_LIGHT,
853 BackgroundTransparency = isPlayer and 0.5 or 0,
854 BorderSizePixel = 0,
855 LayoutOrder = rank,
856 ZIndex = 22,
857 Parent = lbScrolling,
858 })
859 createCorner(row, 8)
860
861 local rankColors = {
862 [1] = CONFIG.BEST_TIME_GOLD,
863 [2] = Color3.fromRGB(200, 200, 200),
864 [3] = Color3.fromRGB(200, 150, 100),
865 }
866
867 local rankLabel = createInstance("TextLabel", {
868 Name = "Rank",
869 Size = UDim2.fromOffset(30, 36),
870 BackgroundTransparency = 1,
871 Text = "#" .. rank,
872 TextColor3 = rankColors[rank] or CONFIG.TEXT_GRAY,
873 TextSize = 14,
874 Font = Enum.Font.GothamBlack,
875 ZIndex = 23,
876 Parent = row,
877 })
878
879 local nameLabel = createInstance("TextLabel", {
880 Name = "PlayerName",
881 Size = UDim2.new(0, 160, 1, 0),
882 Position = UDim2.fromOffset(36, 0),
883 BackgroundTransparency = 1,
884 Text = playerName,
885 TextColor3 = CONFIG.TEXT_WHITE,
886 TextSize = 12,
887 Font = Enum.Font.GothamBold,
888 TextXAlignment = Enum.TextXAlignment.Left,
889 ZIndex = 23,
890 Parent = row,
891 })
892
893 local timeLabel = createInstance("TextLabel", {
894 Name = "Time",
895 Size = UDim2.new(0, 80, 1, 0),
896 Position = UDim2.new(1, -85, 0, 0),
897 BackgroundTransparency = 1,
898 Text = formatTime(time),
899 TextColor3 = CONFIG.PRIMARY,
900 TextSize = 12,
901 Font = Enum.Font.GothamBlack,
902 TextXAlignment = Enum.TextXAlignment.Right,
903 ZIndex = 23,
904 Parent = row,
905 })
906
907 return row
908end
909
910-- Demo leaderboard data
911task.delay(1, function()
912 createLeaderboardRow(1, "SpeedKing", 42.5, false)
913 createLeaderboardRow(2, "JumpMaster", 58.2, false)
914 createLeaderboardRow(3, "ClimberPro", 65.0, false)
915 createLeaderboardRow(4, "PlayerOne", 72.3, false)
916 createLeaderboardRow(5, "You", 89.1, true)
917 createLeaderboardRow(6, "Newbie", 120.5, false)
918end)
919
920-- Settings Panel
921local settingsPanel, settingsBg = createPanel("Settings", "SETTINGS", 320, 360)
922
923local function createToggle(parent, yPos, label, initialValue, onChange)
924 local container = createInstance("Frame", {
925 Name = label .. "Toggle",
926 Size = UDim2.new(1, -24, 0, 40),
927 Position = UDim2.fromOffset(12, yPos),
928 BackgroundColor3 = CONFIG.PANEL_BG_LIGHT,
929 BorderSizePixel = 0,
930 ZIndex = 21,
931 Parent = settingsBg,
932 })
933 createCorner(container, 10)
934
935 local labelText = createInstance("TextLabel", {
936 Name = "Label",
937 Size = UDim2.new(0, 150, 1, 0),
938 Position = UDim2.fromOffset(12, 0),
939 BackgroundTransparency = 1,
940 Text = label,
941 TextColor3 = CONFIG.TEXT_WHITE,
942 TextSize = 14,
943 Font = Enum.Font.GothamBold,
944 TextXAlignment = Enum.TextXAlignment.Left,
945 ZIndex = 22,
946 Parent = container,
947 })
948
949 local toggleBtn = createInstance("TextButton", {
950 Name = "Toggle",
951 Size = UDim2.fromOffset(50, 26),
952 Position = UDim2.new(1, -62, 0.5, -13),
953 BackgroundColor3 = initialValue and CONFIG.SUCCESS or CONFIG.DANGER,
954 Text = initialValue and "ON" or "OFF",
955 TextColor3 = CONFIG.TEXT_WHITE,
956 TextSize = 11,
957 Font = Enum.Font.GothamBlack,
958 BorderSizePixel = 0,
959 ZIndex = 22,
960 Parent = container,
961 })
962 createCorner(toggleBtn, 13)
963
964 local isOn = initialValue
965 toggleBtn.Activated:Connect(function()
966 isOn = not isOn
967 TweenService:Create(toggleBtn, CONFIG.TWEEN_FAST, {
968 BackgroundColor3 = isOn and CONFIG.SUCCESS or CONFIG.DANGER,
969 }):Play()
970 toggleBtn.Text = isOn and "ON" or "OFF"
971 onChange(isOn)
972 end)
973
974 return container
975end
976
977createToggle(settingsBg, 52, "Music", state.musicEnabled, function(value)
978 state.musicEnabled = value
979 updateSettingsEvent:FireServer("music", value)
980end)
981
982createToggle(settingsBg, 98, "Sound Effects", state.sfxEnabled, function(value)
983 state.sfxEnabled = value
984 updateSettingsEvent:FireServer("sfx", value)
985end)
986
987-- Difficulty selector
988local diffContainer = createInstance("Frame", {
989 Name = "DifficultySelector",
990 Size = UDim2.new(1, -24, 0, 50),
991 Position = UDim2.fromOffset(12, 150),
992 BackgroundColor3 = CONFIG.PANEL_BG_LIGHT,
993 BorderSizePixel = 0,
994 ZIndex = 21,
995 Parent = settingsBg,
996})
997createCorner(diffContainer, 10)
998
999local diffLabel = createInstance("TextLabel", {
1000 Name = "Label",
1001 Size = UDim2.new(0, 100, 1, 0),
1002 Position = UDim2.fromOffset(12, 0),
1003 BackgroundTransparency = 1,
1004 Text = "Difficulty",
1005 TextColor3 = CONFIG.TEXT_WHITE,
1006 TextSize = 14,
1007 Font = Enum.Font.GothamBold,
1008 TextXAlignment = Enum.TextXAlignment.Left,
1009 ZIndex = 22,
1010 Parent = diffContainer,
1011})
1012
1013local difficulties = {"Easy", "Normal", "Hard"}
1014local diffColors = {
1015 Easy = CONFIG.SUCCESS,
1016 Normal = CONFIG.INFO,
1017 Hard = CONFIG.DANGER,
1018}
1019
1020local diffButtons = {}
1021for i, diff in ipairs(difficulties) do
1022 local btn = createInstance("TextButton", {
1023 Name = "Diff_" .. diff,
1024 Size = UDim2.fromOffset(60, 28),
1025 Position = UDim2.fromOffset(110 + (i - 1) * 66, 11),
1026 BackgroundColor3 = diffColors[diff],
1027 BackgroundTransparency = diff == state.difficulty and 0 or 0.7,
1028 Text = diff,
1029 TextColor3 = CONFIG.TEXT_WHITE,
1030 TextSize = 11,
1031 Font = Enum.Font.GothamBold,
1032 BorderSizePixel = 0,
1033 ZIndex = 22,
1034 Parent = diffContainer,
1035 })
1036 createCorner(btn, 8)
1037 table.insert(diffButtons, btn)
1038
1039 btn.Activated:Connect(function()
1040 state.difficulty = diff:lower()
1041 for _, b in ipairs(diffButtons) do
1042 TweenService:Create(b, CONFIG.TWEEN_FAST, { BackgroundTransparency = 0.7 }):Play()
1043 end
1044 TweenService:Create(btn, CONFIG.TWEEN_FAST, { BackgroundTransparency = 0 }):Play()
1045 updateSettingsEvent:FireServer("difficulty", diff:lower())
1046 end)
1047end
1048
1049-- Friends Panel
1050local friendsPanel, friendsBg = createPanel("Friends", "FRIENDS", 340, 400)
1051local friendsScrolling = createInstance("ScrollingFrame", {
1052 Name = "FriendsList",
1053 Size = UDim2.new(1, -24, 1, -130),
1054 Position = UDim2.fromOffset(12, 50),
1055 BackgroundTransparency = 1,
1056 ScrollBarThickness = 4,
1057 ScrollBarImageColor3 = CONFIG.PANEL_BG_LIGHT,
1058 ZIndex = 21,
1059 Parent = friendsBg,
1060})
1061
1062local friendsLayout = createInstance("UIListLayout", {
1063 SortOrder = Enum.SortOrder.LayoutOrder,
1064 Padding = UDim.new(0, 6),
1065 Parent = friendsScrolling,
1066})
1067
1068local inviteBtn = createInstance("TextButton", {
1069 Name = "InviteButton",
1070 Size = UDim2.new(1, -24, 0, 40),
1071 Position = UDim2.fromOffset(12, 350),
1072 BackgroundColor3 = CONFIG.INFO,
1073 Text = "Invite Friends",
1074 TextColor3 = CONFIG.TEXT_WHITE,
1075 TextSize = 14,
1076 Font = Enum.Font.GothamBlack,
1077 BorderSizePixel = 0,
1078 ZIndex = 21,
1079 Parent = friendsBg,
1080})
1081createCorner(inviteBtn, 10)
1082
1083inviteBtn.Activated:Connect(function()
1084 inviteFriendEvent:FireServer()
1085end)
1086
1087-- ============================================================
1088-- PANEL MANAGEMENT
1089-- ============================================================
1090
1091local function openPanel(panelName)
1092 -- Close any open panel
1093 if state.currentPanel and panels[state.currentPanel] then
1094 closePanel(state.currentPanel)
1095 if state.currentPanel == panelName then
1096 state.currentPanel = nil
1097 return
1098 end
1099 end
1100
1101 state.currentPanel = panelName
1102 local panel = panels[panelName]
1103 if not panel then return end
1104
1105 panel.Visible = true
1106
1107 -- Slide up animation
1108 TweenService:Create(panel, TweenInfo.new(CONFIG.PANEL_SLIDE_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
1109 Position = UDim2.new(0.5, 0, 1, -CONFIG.BOTTOM_BAR_HEIGHT - 10),
1110 }):Play()
1111end
1112
1113function closePanel(panelName)
1114 local panel = panels[panelName]
1115 if not panel then return end
1116
1117 TweenService:Create(panel, TweenInfo.new(CONFIG.PANEL_SLIDE_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
1118 Position = UDim2.new(0.5, 0, 1, panel.AbsoluteSize.Y + 50),
1119 }):Play()
1120
1121 task.delay(CONFIG.PANEL_SLIDE_TIME, function()
1122 if state.currentPanel ~= panelName then
1123 panel.Visible = false
1124 end
1125 end)
1126end
1127
1128-- Bottom bar button connections
1129bottomButtons["RulesButton"].Activated:Connect(function() openPanel("rules") end)
1130bottomButtons["ShopButton"].Activated:Connect(function() openPanel("shop") end)
1131bottomButtons["LeaderboardButton"].Activated:Connect(function() openPanel("leaderboard") end)
1132bottomButtons["SettingsButton"].Activated:Connect(function() openPanel("settings") end)
1133bottomButtons["FriendsButton"].Activated:Connect(function() openPanel("friends") end)
1134
1135-- --------------------------------------------------------
1136-- LOADING SCREEN
1137-- --------------------------------------------------------
1138local loadingScreen = createInstance("Frame", {
1139 Name = "LoadingScreen",
1140 Size = UDim2.fromScale(1, 1),
1141 BackgroundColor3 = CONFIG.BG_GRADIENT_TOP,
1142 BorderSizePixel = 0,
1143 ZIndex = 30,
1144 Parent = screenGui,
1145})
1146
1147local loadingBgGradient = createGradient(loadingScreen, CONFIG.BG_GRADIENT_TOP, CONFIG.BG_GRADIENT_BOTTOM, 135)
1148
1149local loadingText = createInstance("TextLabel", {
1150 Name = "LoadingText",
1151 Size = UDim2.new(1, 0, 0, 40),
1152 Position = UDim2.fromScale(0, 0.45),
1153 BackgroundTransparency = 1,
1154 Text = "Loading...",
1155 TextColor3 = CONFIG.TEXT_WHITE,
1156 TextSize = 28,
1157 Font = Enum.Font.GothamBlack,
1158 ZIndex = 31,
1159 Parent = loadingScreen,
1160})
1161
1162local loadingBar = createInstance("Frame", {
1163 Name = "LoadingBar",
1164 Size = UDim2.fromOffset(200, 8),
1165 Position = UDim2.new(0.5, -100, 0, 0.55),
1166 AnchorPoint = Vector2.new(0, 0.5),
1167 BackgroundColor3 = CONFIG.PANEL_BG,
1168 BorderSizePixel = 0,
1169 ZIndex = 31,
1170 Parent = loadingScreen,
1171})
1172createCorner(loadingBar, 4)
1173
1174local loadingFill = createInstance("Frame", {
1175 Name = "LoadingFill",
1176 Size = UDim2.fromScale(0, 1),
1177 BackgroundColor3 = CONFIG.PRIMARY,
1178 BorderSizePixel = 0,
1179 ZIndex = 32,
1180 Parent = loadingBar,
1181})
1182createCorner(loadingFill, 4)
1183createGradient(loadingFill, CONFIG.PRIMARY, CONFIG.PRIMARY_LIGHT, 0)
1184
1185-- Loading animation
1186local function runLoading()
1187 TweenService:Create(loadingFill, TweenInfo.new(CONFIG.LOADING_DURATION, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
1188 Size = UDim2.fromScale(1, 1),
1189 }):Play()
1190
1191 task.delay(CONFIG.LOADING_DURATION, function()
1192 TweenService:Create(loadingScreen, CONFIG.TWEEN_SLOW, {
1193 BackgroundTransparency = 1,
1194 }):Play()
1195 loadingText.Visible = false
1196 loadingBar.Visible = false
1197
1198 task.delay(0.5, function()
1199 loadingScreen.Visible = false
1200 state.isLoading = false
1201 end)
1202 end)
1203end
1204runLoading()
1205
1206-- ============================================================
1207-- REMOTE EVENT CONNECTIONS
1208-- ============================================================
1209
1210playerDataEvent.OnClientEvent:Connect(function(data)
1211 state.bestTime = data.bestTime or 0
1212 state.currentLevel = data.currentLevel or 1
1213 state.totalAttempts = data.totalAttempts or 0
1214 state.musicEnabled = data.musicEnabled ~= false
1215 state.sfxEnabled = data.sfxEnabled ~= false
1216 state.difficulty = data.difficulty or "normal"
1217
1218 bestTimeValue.Text = formatTime(state.bestTime)
1219 levelValue.Text = tostring(state.currentLevel)
1220 attemptsValue.Text = tostring(state.totalAttempts)
1221
1222 if data.hasContinue then
1223 continueButton.Visible = true
1224 end
1225end)
1226
1227openShopEvent.OnClientEvent:Connect(function(items)
1228 state.shopItems = items
1229 openPanel("shop")
1230end)
1231
1232-- ============================================================
1233-- INITIALIZATION
1234-- ============================================================
1235
1236-- Request player data from server
1237task.delay(CONFIG.LOADING_DURATION + 0.3, function()
1238 requestPlayerDataEvent:FireServer()
1239end)
1240
1241-- Title bounce animation
1242TweenService:Create(gameTitle, CONFIG.TWEEN_ELASTIC, {
1243 Position = UDim2.new(0, 0, 0, 0),
1244}):Play()
1245
1246print("[Obby Start Screen] Initialized successfully")

Code preview

Obby Start Screen

Luau
Interactive visual preview is shown in the Live preview section above.Switch tabs to inspect the generated Luau client/server code.
Visual preview of the templateRoblox GUI Maker

Frequently asked questions

Keep going

Similar templates