Simulator HUD Roblox GUI Template with Clicks / Rebirths / Pets
A simulator-style HUD with click counter, rebirth badge, pet count, and currency tracker. Designed with a bright and readable aesthetic optimized for mobile devices. Perfect for clicker simulators, pet collection games, tycoon-style experiences, and any Roblox game that tracks incremental progress with satisfying visual feedback.

Live preview
Simulator HUD
1920×1080Includes real, production-ready Luau logic — not a static mockup.
What's inside
- • Click / currency counter
- • Rebirth badge
- • Equipped pet icons
- • Mobile thumb-friendly
- • Tweened pop numbers
How to use this template
The Simulator HUD template shows click counters, rebirth badges, pet counts, and currency for simulator games. Paste the client Luau into StarterGui and the HUD appears, with the click counter top-left, rebirth badge top-right, and pet strip along the bottom. The click counter updates optimistically on each tap - the local count increments immediately, and a RemoteEvent syncs to the server. The rebirth badge shows the current tier and pulses when the player can afford the next rebirth. The pet strip uses a horizontal ScrollingFrame with UIGridLayout. The layout uses Scale-based sizing, so it works on phone and desktop. To customize, change the counter colors and pet slot count. Wire the click and rebirth events to your own server logic. Test in Studio by clicking rapidly and confirming the counter updates without lag.
Add it to your game in 3 steps
- 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
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
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.
1--[[2 Simulator HUD - Client LocalScript3 A bright simulator HUD with click counter, rebirth badge, pet count, and currency.4 Optimized for mobile layout with touch-friendly interactions.5 Place in: StarterPlayer > StarterPlayerScripts6--]]78local Players = game:GetService("Players")9local TweenService = game:GetService("TweenService")10local UserInputService = game:GetService("UserInputService")11local RunService = game:GetService("RunService")12local ReplicatedStorage = game:GetService("ReplicatedStorage")1314local player = Players.LocalPlayer15local playerGui = player:WaitForChild("PlayerGui")1617-- ============================================================18-- REMOTE EVENTS19-- ============================================================20local remotes = ReplicatedStorage:WaitForChild("Simulator_HUD_Remotes")21local updateCurrencyEvent = remotes:WaitForChild("UpdateCurrency")22local updateClicksEvent = remotes:WaitForChild("UpdateClicks")23local updateRebirthsEvent = remotes:WaitForChild("UpdateRebirths")24local updatePetsEvent = remotes:WaitForChild("UpdatePets")25local updateMultiplierEvent = remotes:WaitForChild("UpdateMultiplier")26local clickEvent = remotes:WaitForChild("Click")27local showNotificationEvent = remotes:WaitForChild("ShowNotification")28local showFloatingTextEvent = remotes:WaitForChild("ShowFloatingText")29local updateLeaderboardEvent = remotes:WaitForChild("UpdateLeaderboard")30local openMenuEvent = remotes:WaitForChild("OpenMenu")3132-- ============================================================33-- CONFIGURATION34-- ============================================================35local CONFIG = {36 -- Colors - bright and cheerful simulator palette37 PRIMARY = Color3.fromRGB(255, 200, 50),38 PRIMARY_LIGHT = Color3.fromRGB(255, 230, 120),39 SUCCESS = Color3.fromRGB(50, 220, 100),40 INFO = Color3.fromRGB(50, 170, 255),41 WARNING = Color3.fromRGB(255, 150, 50),42 DANGER = Color3.fromRGB(255, 80, 80),43 COIN_GOLD = Color3.fromRGB(255, 215, 0),44 REBIRTH_PURPLE = Color3.fromRGB(180, 100, 255),45 PET_BLUE = Color3.fromRGB(80, 180, 255),46 BG_WHITE = Color3.fromRGB(255, 255, 255),47 BG_LIGHT = Color3.fromRGB(245, 248, 250),48 BG_CARD = Color3.fromRGB(255, 255, 255),49 TEXT_DARK = Color3.fromRGB(50, 55, 60),50 TEXT_GRAY = Color3.fromRGB(130, 140, 150),51 SHADOW = Color3.fromRGB(200, 210, 220),5253 -- Animation54 TWEEN_BOUNCE = TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out),55 TWEEN_FAST = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),56 TWEEN_NORMAL = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),57 TWEEN_SLOW = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),58 FLOAT_DURATION = 1.2,59 NOTIFICATION_DURATION = 3,6061 -- Mobile layout sizes62 TOP_BAR_HEIGHT = 55,63 CLICK_BUTTON_SIZE = 140,64 MENU_BUTTON_SIZE = 50,65 STAT_CARD_WIDTH = 100,66 STAT_CARD_HEIGHT = 50,67 NOTIFICATION_MAX = 4,68}6970-- ============================================================71-- STATE72-- ============================================================73local state = {74 currency = 0,75 currencyDisplay = "0",76 clicks = 0,77 clicksDisplay = "0",78 rebirths = 0,79 pets = 0,80 petCapacity = 100,81 multiplier = 1.0,82 progressPercent = 0,83 leaderboardData = {},84 notifications = {},85 floatingTexts = {},86}8788-- ============================================================89-- HELPER FUNCTIONS90-- ============================================================9192local function createInstance(className, props)93 local instance = Instance.new(className)94 for key, value in pairs(props) do95 instance[key] = value96 end97 return instance98end99100local function createCorner(parent, radius)101 local corner = Instance.new("UICorner")102 corner.CornerRadius = UDim.new(0, radius or 8)103 corner.Parent = parent104 return corner105end106107local function createStroke(parent, color, thickness)108 local stroke = Instance.new("UIStroke")109 stroke.Color = color or CONFIG.SHADOW110 stroke.Thickness = thickness or 1111 stroke.Parent = parent112 return stroke113end114115local function createGradient(parent, color1, color2, rotation)116 local gradient = Instance.new("UIGradient")117 gradient.Color = ColorSequence.new({118 ColorSequenceKeypoint.new(0, color1 or Color3.new(1, 1, 1)),119 ColorSequenceKeypoint.new(1, color2 or Color3.new(0.8, 0.8, 0.8)),120 })121 gradient.Rotation = rotation or 0122 gradient.Parent = parent123 return gradient124end125126local function createShadow(parent)127 local shadow = Instance.new("ImageLabel")128 shadow.Name = "Shadow"129 shadow.Size = UDim2.new(1, 8, 1, 8)130 shadow.Position = UDim2.fromOffset(-4, -4)131 shadow.BackgroundTransparency = 1132 shadow.Image = "rbxassetid://131296291" -- shadow asset133 shadow.ImageColor3 = CONFIG.SHADOW134 shadow.ImageTransparency = 0.7135 shadow.ScaleType = Enum.ScaleType.Slice136 shadow.SliceCenter = Rect.new(10, 10, 118, 118)137 shadow.ZIndex = parent.ZIndex - 1138 shadow.Parent = parent139 return shadow140end141142-- Format large numbers with suffixes (1.5K, 2.3M, etc.)143local function formatNumber(num)144 if num >= 1e15 then145 return string.format("%.1fQa", num / 1e15)146 elseif num >= 1e12 then147 return string.format("%.1fT", num / 1e12)148 elseif num >= 1e9 then149 return string.format("%.1fB", num / 1e9)150 elseif num >= 1e6 then151 return string.format("%.1fM", num / 1e6)152 elseif num >= 1e3 then153 return string.format("%.1fK", num / 1e3)154 else155 return tostring(math.floor(num))156 end157end158159-- Format with commas160local function formatCommas(num)161 local formatted = tostring(math.floor(num))162 local k163 while true do164 formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", "%1,%2")165 if k == 0 then break end166 end167 return formatted168end169170-- ============================================================171-- UI CONSTRUCTION172-- ============================================================173174local screenGui = createInstance("ScreenGui", {175 Name = "Simulator_HUD",176 ResetOnSpawn = false,177 ZIndexBehavior = Enum.ZIndexBehavior.Sibling,178 Parent = playerGui,179})180181-- --------------------------------------------------------182-- TOP BAR (Currency Display)183-- --------------------------------------------------------184local topBar = createInstance("Frame", {185 Name = "TopBar",186 Size = UDim2.new(1, 0, 0, CONFIG.TOP_BAR_HEIGHT),187 Position = UDim2.fromOffset(0, 0),188 BackgroundColor3 = CONFIG.BG_CARD,189 BackgroundTransparency = 0.1,190 BorderSizePixel = 0,191 ZIndex = 5,192 Parent = screenGui,193})194createCorner(topBar, 0)195196local topBarGradient = createGradient(topBar, CONFIG.BG_CARD, CONFIG.BG_LIGHT, 90)197198-- Currency icon (circle placeholder)199local currencyIcon = createInstance("Frame", {200 Name = "CurrencyIcon",201 Size = UDim2.fromOffset(36, 36),202 Position = UDim2.fromOffset(12, 10),203 BackgroundColor3 = CONFIG.COIN_GOLD,204 BorderSizePixel = 0,205 ZIndex = 6,206 Parent = topBar,207})208createCorner(currencyIcon, 18)209210local currencyIconInner = createInstance("Frame", {211 Name = "Inner",212 Size = UDim2.fromOffset(24, 24),213 Position = UDim2.fromScale(0.5, 0.5),214 AnchorPoint = Vector2.new(0.5, 0.5),215 BackgroundColor3 = CONFIG.PRIMARY_LIGHT,216 BorderSizePixel = 0,217 ZIndex = 7,218 Parent = currencyIcon,219})220createCorner(currencyIconInner, 12)221222-- Currency value223local currencyValue = createInstance("TextLabel", {224 Name = "CurrencyValue",225 Size = UDim2.new(0, 150, 0, 28),226 Position = UDim2.fromOffset(56, 6),227 BackgroundTransparency = 1,228 Text = "0",229 TextColor3 = CONFIG.TEXT_DARK,230 TextSize = 24,231 Font = Enum.Font.GothamBlack,232 TextXAlignment = Enum.TextXAlignment.Left,233 ZIndex = 6,234 Parent = topBar,235})236237-- Currency label238local currencyLabel = createInstance("TextLabel", {239 Name = "CurrencyLabel",240 Size = UDim2.new(0, 80, 0, 16),241 Position = UDim2.fromOffset(56, 34),242 BackgroundTransparency = 1,243 Text = "COINS",244 TextColor3 = CONFIG.TEXT_GRAY,245 TextSize = 10,246 Font = Enum.Font.GothamBold,247 TextXAlignment = Enum.TextXAlignment.Left,248 ZIndex = 6,249 Parent = topBar,250})251252-- --------------------------------------------------------253-- CLICK BUTTON (Main interaction)254-- --------------------------------------------------------255local clickButtonContainer = createInstance("Frame", {256 Name = "ClickButtonContainer",257 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE + 40, CONFIG.CLICK_BUTTON_SIZE + 50),258 Position = UDim2.new(0.5, 0, 1, -180),259 AnchorPoint = Vector2.new(0.5, 1),260 BackgroundTransparency = 1,261 ZIndex = 5,262 Parent = screenGui,263})264265local clickButton = createInstance("TextButton", {266 Name = "ClickButton",267 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE, CONFIG.CLICK_BUTTON_SIZE),268 Position = UDim2.fromScale(0.5, 0),269 AnchorPoint = Vector2.new(0.5, 0),270 BackgroundColor3 = CONFIG.PRIMARY,271 Text = "TAP!",272 TextColor3 = CONFIG.TEXT_DARK,273 TextSize = 22,274 Font = Enum.Font.GothamBlack,275 BorderSizePixel = 0,276 ZIndex = 6,277 Parent = clickButtonContainer,278})279createCorner(clickButton, CONFIG.CLICK_BUTTON_SIZE / 2)280281local clickButtonGradient = createGradient(clickButton, CONFIG.PRIMARY_LIGHT, CONFIG.PRIMARY, 90)282283-- Button pulse ring (animated)284local clickPulse = createInstance("Frame", {285 Name = "ClickPulse",286 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE, CONFIG.CLICK_BUTTON_SIZE),287 Position = UDim2.fromScale(0.5, 0),288 AnchorPoint = Vector2.new(0.5, 0),289 BackgroundColor3 = CONFIG.PRIMARY,290 BackgroundTransparency = 0.5,291 BorderSizePixel = 0,292 ZIndex = 5,293 Parent = clickButtonContainer,294})295createCorner(clickPulse, CONFIG.CLICK_BUTTON_SIZE / 2)296297local clickHint = createInstance("TextLabel", {298 Name = "ClickHint",299 Size = UDim2.new(1, 0, 0, 20),300 Position = UDim2.fromOffset(0, CONFIG.CLICK_BUTTON_SIZE + 8),301 BackgroundTransparency = 1,302 Text = "TAP TO EARN!",303 TextColor3 = CONFIG.TEXT_GRAY,304 TextSize = 13,305 Font = Enum.Font.GothamBold,306 TextXAlignment = Enum.TextXAlignment.Center,307 ZIndex = 5,308 Parent = clickButtonContainer,309})310311-- --------------------------------------------------------312-- STATS CONTAINER (Top Right)313-- --------------------------------------------------------314local statsContainer = createInstance("Frame", {315 Name = "StatsContainer",316 Size = UDim2.fromOffset(110, 170),317 Position = UDim2.new(1, -12, 0, 65),318 AnchorPoint = Vector2.new(1, 0),319 BackgroundTransparency = 1,320 ZIndex = 5,321 Parent = screenGui,322})323324local statsLayout = createInstance("UIListLayout", {325 SortOrder = Enum.SortOrder.LayoutOrder,326 VerticalAlignment = Enum.VerticalAlignment.Top,327 HorizontalAlignment = Enum.HorizontalAlignment.Right,328 Padding = UDim.new(0, 6),329 Parent = statsContainer,330})331332-- Click Counter Card333local clickCounter = createInstance("Frame", {334 Name = "ClickCounter",335 Size = UDim2.fromOffset(100, 50),336 BackgroundColor3 = CONFIG.BG_CARD,337 BackgroundTransparency = 0.1,338 BorderSizePixel = 0,339 LayoutOrder = 1,340 ZIndex = 5,341 Parent = statsContainer,342})343createCorner(clickCounter, 10)344createStroke(clickCounter, CONFIG.SHADOW, 1)345346local clicksLabel = createInstance("TextLabel", {347 Name = "ClicksLabel",348 Size = UDim2.new(1, 0, 0, 14),349 Position = UDim2.fromOffset(0, 4),350 BackgroundTransparency = 1,351 Text = "CLICKS",352 TextColor3 = CONFIG.TEXT_GRAY,353 TextSize = 9,354 Font = Enum.Font.GothamBold,355 ZIndex = 6,356 Parent = clickCounter,357})358359local clicksValue = createInstance("TextLabel", {360 Name = "ClicksValue",361 Size = UDim2.new(1, 0, 0, 28),362 Position = UDim2.fromOffset(0, 18),363 BackgroundTransparency = 1,364 Text = "0",365 TextColor3 = CONFIG.TEXT_DARK,366 TextSize = 20,367 Font = Enum.Font.GothamBlack,368 ZIndex = 6,369 Parent = clickCounter,370})371372-- Rebirth Badge Card373local rebirthBadge = createInstance("Frame", {374 Name = "RebirthBadge",375 Size = UDim2.fromOffset(100, 50),376 BackgroundColor3 = CONFIG.REBIRTH_PURPLE,377 BackgroundTransparency = 0.9,378 BorderSizePixel = 0,379 LayoutOrder = 2,380 ZIndex = 5,381 Parent = statsContainer,382})383createCorner(rebirthBadge, 10)384createStroke(rebirthBadge, CONFIG.REBIRTH_PURPLE, 1)385386local rebirthLabel = createInstance("TextLabel", {387 Name = "RebirthLabel",388 Size = UDim2.new(1, 0, 0, 14),389 Position = UDim2.fromOffset(0, 4),390 BackgroundTransparency = 1,391 Text = "REBIRTHS",392 TextColor3 = CONFIG.REBIRTH_PURPLE,393 TextSize = 9,394 Font = Enum.Font.GothamBold,395 ZIndex = 6,396 Parent = rebirthBadge,397})398399local rebirthValue = createInstance("TextLabel", {400 Name = "RebirthValue",401 Size = UDim2.new(1, 0, 0, 28),402 Position = UDim2.fromOffset(0, 18),403 BackgroundTransparency = 1,404 Text = "0",405 TextColor3 = CONFIG.REBIRTH_PURPLE,406 TextSize = 20,407 Font = Enum.Font.GothamBlack,408 ZIndex = 6,409 Parent = rebirthBadge,410})411412-- Pet Counter Card413local petCounter = createInstance("Frame", {414 Name = "PetCounter",415 Size = UDim2.fromOffset(100, 50),416 BackgroundColor3 = CONFIG.PET_BLUE,417 BackgroundTransparency = 0.9,418 BorderSizePixel = 0,419 LayoutOrder = 3,420 ZIndex = 5,421 Parent = statsContainer,422})423createCorner(petCounter, 10)424createStroke(petCounter, CONFIG.PET_BLUE, 1)425426local petsLabel = createInstance("TextLabel", {427 Name = "PetsLabel",428 Size = UDim2.new(1, 0, 0, 14),429 Position = UDim2.fromOffset(0, 4),430 BackgroundTransparency = 1,431 Text = "PETS",432 TextColor3 = CONFIG.PET_BLUE,433 TextSize = 9,434 Font = Enum.Font.GothamBold,435 ZIndex = 6,436 Parent = petCounter,437})438439local petsValue = createInstance("TextLabel", {440 Name = "PetsValue",441 Size = UDim2.new(1, 0, 0, 28),442 Position = UDim2.fromOffset(0, 18),443 BackgroundTransparency = 1,444 Text = "0/100",445 TextColor3 = CONFIG.PET_BLUE,446 TextSize = 16,447 Font = Enum.Font.GothamBlack,448 ZIndex = 6,449 Parent = petCounter,450})451452-- --------------------------------------------------------453-- MULTIPLIER BADGE (Top Left)454-- --------------------------------------------------------455local multiplierContainer = createInstance("Frame", {456 Name = "MultiplierContainer",457 Size = UDim2.fromOffset(70, 50),458 Position = UDim2.fromOffset(12, 65),459 BackgroundColor3 = CONFIG.SUCCESS,460 BackgroundTransparency = 0.9,461 BorderSizePixel = 0,462 ZIndex = 5,463 Parent = screenGui,464})465createCorner(multiplierContainer, 10)466createStroke(multiplierContainer, CONFIG.SUCCESS, 1)467468local multiplierText = createInstance("TextLabel", {469 Name = "MultiplierText",470 Size = UDim2.new(1, 0, 0, 26),471 Position = UDim2.fromOffset(0, 2),472 BackgroundTransparency = 1,473 Text = "1.0x",474 TextColor3 = CONFIG.SUCCESS,475 TextSize = 22,476 Font = Enum.Font.GothamBlack,477 ZIndex = 6,478 Parent = multiplierContainer,479})480481local multiplierLabel = createInstance("TextLabel", {482 Name = "MultiplierLabel",483 Size = UDim2.new(1, 0, 0, 14),484 Position = UDim2.fromOffset(0, 28),485 BackgroundTransparency = 1,486 Text = "BOOST",487 TextColor3 = CONFIG.SUCCESS,488 TextSize = 9,489 Font = Enum.Font.GothamBold,490 ZIndex = 6,491 Parent = multiplierContainer,492})493494-- --------------------------------------------------------495-- FLOATING TEXT CONTAINER496-- --------------------------------------------------------497local floatingTextContainer = createInstance("Frame", {498 Name = "FloatingTextContainer",499 Size = UDim2.fromScale(1, 1),500 BackgroundTransparency = 1,501 ZIndex = 15,502 Parent = screenGui,503 ClipsDescendants = false,504})505506-- --------------------------------------------------------507-- PROGRESS BAR (Below top bar)508-- --------------------------------------------------------509local progressBarContainer = createInstance("Frame", {510 Name = "ProgressBarContainer",511 Size = UDim2.new(1, -24, 0, 36),512 Position = UDim2.fromOffset(12, CONFIG.TOP_BAR_HEIGHT + 4),513 BackgroundTransparency = 1,514 ZIndex = 5,515 Parent = screenGui,516})517518local progressBarBg = createInstance("Frame", {519 Name = "ProgressBarBg",520 Size = UDim2.new(1, 0, 0, 12),521 Position = UDim2.fromOffset(0, 18),522 BackgroundColor3 = CONFIG.BG_LIGHT,523 BorderSizePixel = 0,524 ZIndex = 5,525 Parent = progressBarContainer,526})527createCorner(progressBarBg, 6)528529local progressBarFill = createInstance("Frame", {530 Name = "ProgressBarFill",531 Size = UDim2.fromScale(0, 1),532 BackgroundColor3 = CONFIG.REBIRTH_PURPLE,533 BorderSizePixel = 0,534 ZIndex = 6,535 Parent = progressBarBg,536})537createCorner(progressBarFill, 6)538createGradient(progressBarFill, CONFIG.REBIRTH_PURPLE, CONFIG.INFO, 0)539540local progressLabel = createInstance("TextLabel", {541 Name = "ProgressLabel",542 Size = UDim2.new(1, 0, 0, 16),543 Position = UDim2.fromOffset(0, 0),544 BackgroundTransparency = 1,545 Text = "Next Rebirth: 0%",546 TextColor3 = CONFIG.TEXT_GRAY,547 TextSize = 10,548 Font = Enum.Font.GothamBold,549 TextXAlignment = Enum.TextXAlignment.Left,550 ZIndex = 5,551 Parent = progressBarContainer,552})553554-- --------------------------------------------------------555-- NOTIFICATION CONTAINER556-- --------------------------------------------------------557local notificationContainer = createInstance("Frame", {558 Name = "NotificationContainer",559 Size = UDim2.new(1, 0, 0, 200),560 Position = UDim2.fromOffset(0, CONFIG.TOP_BAR_HEIGHT + 56),561 BackgroundTransparency = 1,562 ZIndex = 20,563 Parent = screenGui,564})565566local notificationLayout = createInstance("UIListLayout", {567 SortOrder = Enum.SortOrder.LayoutOrder,568 VerticalAlignment = Enum.VerticalAlignment.Top,569 HorizontalAlignment = Enum.HorizontalAlignment.Center,570 Padding = UDim.new(0, 6),571 Parent = notificationContainer,572})573574-- --------------------------------------------------------575-- MENU BUTTONS (Bottom Left)576-- --------------------------------------------------------577local menuButtons = createInstance("Frame", {578 Name = "MenuButtons",579 Size = UDim2.fromOffset(56, 230),580 Position = UDim2.fromOffset(8, 1),581 AnchorPoint = Vector2.new(0, 1),582 BackgroundTransparency = 1,583 ZIndex = 5,584 Parent = screenGui,585})586587local menuLayout = createInstance("UIListLayout", {588 SortOrder = Enum.SortOrder.LayoutOrder,589 VerticalAlignment = Enum.VerticalAlignment.Bottom,590 HorizontalAlignment = Enum.HorizontalAlignment.Center,591 Padding = UDim.new(0, 8),592 Parent = menuButtons,593})594595local menuButtonConfigs = {596 { name = "InventoryButton", icon = "INV", label = "Inv", color = CONFIG.TEXT_DARK },597 { name = "ShopButton", icon = "SHOP", label = "Shop", color = CONFIG.COIN_GOLD },598 { name = "PetsButton", icon = "PETS", label = "Pets", color = CONFIG.PET_BLUE },599 { name = "SettingsButton", icon = "SET", label = "Set", color = CONFIG.TEXT_GRAY },600}601602for i, cfg in ipairs(menuButtonConfigs) do603 local btn = createInstance("TextButton", {604 Name = cfg.name,605 Size = UDim2.fromOffset(CONFIG.MENU_BUTTON_SIZE, CONFIG.MENU_BUTTON_SIZE),606 BackgroundColor3 = CONFIG.BG_CARD,607 Text = cfg.icon,608 TextColor3 = cfg.color,609 TextSize = 10,610 Font = Enum.Font.GothamBlack,611 BorderSizePixel = 0,612 LayoutOrder = i,613 ZIndex = 6,614 Parent = menuButtons,615 })616 createCorner(btn, 14)617 createStroke(btn, CONFIG.SHADOW, 1)618619 -- Add icon circle background620 local iconBg = createInstance("Frame", {621 Name = "IconBg",622 Size = UDim2.fromOffset(30, 30),623 Position = UDim2.fromScale(0.5, 0.35),624 AnchorPoint = Vector2.new(0.5, 0.5),625 BackgroundColor3 = cfg.color,626 BackgroundTransparency = 0.85,627 BorderSizePixel = 0,628 ZIndex = 5,629 Parent = btn,630 })631 createCorner(iconBg, 15)632end633634-- ============================================================635-- UPDATE FUNCTIONS636-- ============================================================637638local function updateCurrency(amount)639 state.currency = amount640 state.currencyDisplay = formatNumber(amount)641642 -- Bounce animation643 currencyValue.Text = state.currencyDisplay644 local bounceUp = TweenService:Create(currencyValue, CONFIG.TWEEN_BOUNCE, {645 TextSize = 28,646 })647 local bounceDown = TweenService:Create(currencyValue, CONFIG.TWEEN_FAST, {648 TextSize = 24,649 })650 bounceUp:Play()651 bounceUp.Completed:Connect(function()652 bounceDown:Play()653 end)654655 -- Flash icon656 TweenService:Create(currencyIcon, CONFIG.TWEEN_FAST, {657 Size = UDim2.fromOffset(40, 40),658 Position = UDim2.fromOffset(10, 8),659 }):Play()660 task.delay(0.1, function()661 TweenService:Create(currencyIcon, CONFIG.TWEEN_FAST, {662 Size = UDim2.fromOffset(36, 36),663 Position = UDim2.fromOffset(12, 10),664 }):Play()665 end)666end667668local function updateClicks(amount)669 state.clicks = amount670 state.clicksDisplay = formatCommas(amount)671 clicksValue.Text = state.clicksDisplay672673 -- Pop animation674 local popUp = TweenService:Create(clicksValue, TweenInfo.new(0.1), { TextSize = 24 })675 local popDown = TweenService:Create(clicksValue, CONFIG.TWEEN_FAST, { TextSize = 20 })676 popUp:Play()677 popUp.Completed:Connect(function() popDown:Play() end)678end679680local function updateRebirths(amount)681 state.rebirths = amount682 rebirthValue.Text = tostring(amount)683684 -- Celebration animation685 TweenService:Create(rebirthBadge, CONFIG.TWEEN_BOUNCE, {686 BackgroundTransparency = 0.5,687 }):Play()688 task.delay(0.3, function()689 TweenService:Create(rebirthBadge, CONFIG.TWEEN_SLOW, {690 BackgroundTransparency = 0.9,691 }):Play()692 end)693end694695local function updatePets(equipped, capacity)696 state.pets = equipped697 state.petCapacity = capacity698 petsValue.Text = string.format("%d/%d", equipped, capacity)699700 -- Flash if near capacity701 local ratio = equipped / capacity702 if ratio >= 0.9 then703 TweenService:Create(petsValue, TweenInfo.new(0.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 3, true), {704 TextColor3 = CONFIG.DANGER,705 }):Play()706 else707 petsValue.TextColor3 = CONFIG.PET_BLUE708 end709end710711local function updateMultiplier(value)712 state.multiplier = value713 multiplierText.Text = string.format("%.1fx", value)714715 -- Scale animation716 local scaleUp = TweenService:Create(multiplierContainer, CONFIG.TWEEN_BOUNCE, {717 Size = UDim2.fromOffset(76, 54),718 })719 local scaleDown = TweenService:Create(multiplierContainer, CONFIG.TWEEN_FAST, {720 Size = UDim2.fromOffset(70, 50),721 })722 scaleUp:Play()723 scaleUp.Completed:Connect(function() scaleDown:Play() end)724end725726local function updateProgress(percent)727 state.progressPercent = percent728 progressLabel.Text = string.format("Next Rebirth: %d%%", math.floor(percent * 100))729 TweenService:Create(progressBarFill, CONFIG.TWEEN_NORMAL, {730 Size = UDim2.fromScale(percent, 1),731 }):Play()732end733734-- ============================================================735-- FLOATING TEXT SYSTEM736-- ============================================================737738local floatingTextId = 0739740local function spawnFloatingText(text, position, color)741 floatingTextId += 1742 local id = floatingTextId743744 local label = createInstance("TextLabel", {745 Name = "FloatingText_" .. id,746 Size = UDim2.fromOffset(120, 30),747 Position = UDim2.fromOffset(position.X - 60, position.Y - 15),748 BackgroundTransparency = 1,749 Text = text,750 TextColor3 = color or CONFIG.COIN_GOLD,751 TextSize = 20,752 Font = Enum.Font.GothamBlack,753 TextStrokeTransparency = 0.5,754 TextStrokeColor3 = Color3.new(0, 0, 0),755 ZIndex = 15,756 Parent = floatingTextContainer,757 })758759 -- Animate upward and fade760 local riseUp = TweenService:Create(label, TweenInfo.new(CONFIG.FLOAT_DURATION, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {761 Position = UDim2.fromOffset(position.X - 60, position.Y - 80),762 TextTransparency = 1,763 TextStrokeTransparency = 1,764 })765 riseUp:Play()766767 riseUp.Completed:Connect(function()768 if label and label.Parent then769 label:Destroy()770 end771 end)772773 -- Also spawn smaller "+1" clicks774 if text:find("+") then775 local miniLabel = createInstance("TextLabel", {776 Name = "MiniFloat_" .. id,777 Size = UDim2.fromOffset(60, 20),778 Position = UDim2.fromOffset(position.X + 20, position.Y),779 BackgroundTransparency = 1,780 Text = "+1",781 TextColor3 = CONFIG.TEXT_DARK,782 TextSize = 14,783 Font = Enum.Font.GothamBold,784 ZIndex = 15,785 Parent = floatingTextContainer,786 })787788 local miniRise = TweenService:Create(miniLabel, TweenInfo.new(0.8, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {789 Position = UDim2.fromOffset(position.X + 30 + math.random(-20, 20), position.Y - 60),790 TextTransparency = 1,791 })792 miniRise:Play()793 miniRise.Completed:Connect(function()794 if miniLabel and miniLabel.Parent then795 miniLabel:Destroy()796 end797 end)798 end799end800801-- ============================================================802-- NOTIFICATION SYSTEM803-- ============================================================804805local notificationId = 0806807local function showNotification(message, notifType)808 notificationId += 1809 local id = notificationId810811 local color = CONFIG.INFO812 if notifType == "success" then813 color = CONFIG.SUCCESS814 elseif notifType == "warning" then815 color = CONFIG.WARNING816 elseif notifType == "error" then817 color = CONFIG.DANGER818 elseif notifType == "rebirth" then819 color = CONFIG.REBIRTH_PURPLE820 end821822 local notif = createInstance("Frame", {823 Name = "Notification_" .. id,824 Size = UDim2.new(0, 280, 0, 44),825 BackgroundColor3 = CONFIG.BG_CARD,826 BackgroundTransparency = 0.05,827 BorderSizePixel = 0,828 LayoutOrder = -id,829 ZIndex = 20,830 Parent = notificationContainer,831 })832 createCorner(notif, 10)833 createStroke(notif, color, 2)834835 local icon = createInstance("Frame", {836 Name = "Icon",837 Size = UDim2.fromOffset(8, 8),838 Position = UDim2.fromOffset(12, 18),839 BackgroundColor3 = color,840 BorderSizePixel = 0,841 ZIndex = 21,842 Parent = notif,843 })844 createCorner(icon, 4)845846 local textLabel = createInstance("TextLabel", {847 Name = "Text",848 Size = UDim2.new(1, -36, 1, 0),849 Position = UDim2.fromOffset(28, 0),850 BackgroundTransparency = 1,851 Text = message,852 TextColor3 = CONFIG.TEXT_DARK,853 TextSize = 13,854 Font = Enum.Font.GothamBold,855 TextWrapped = true,856 TextXAlignment = Enum.TextXAlignment.Left,857 ZIndex = 21,858 Parent = notif,859 })860861 -- Entry animation862 notif.BackgroundTransparency = 1863 textLabel.TextTransparency = 1864 icon.BackgroundTransparency = 1865 TweenService:Create(notif, CONFIG.TWEEN_FAST, { BackgroundTransparency = 0.05 }):Play()866 TweenService:Create(textLabel, CONFIG.TWEEN_FAST, { TextTransparency = 0 }):Play()867 TweenService:Create(icon, CONFIG.TWEEN_FAST, { BackgroundTransparency = 0 }):Play()868869 -- Exit after duration870 task.delay(CONFIG.NOTIFICATION_DURATION, function()871 local exit = TweenService:Create(notif, CONFIG.TWEEN_NORMAL, {872 BackgroundTransparency = 1,873 Size = UDim2.new(0, 260, 0, 44),874 })875 local textExit = TweenService:Create(textLabel, CONFIG.TWEEN_NORMAL, { TextTransparency = 1 })876 local iconExit = TweenService:Create(icon, CONFIG.TWEEN_NORMAL, { BackgroundTransparency = 1 })877 exit:Play()878 textExit:Play()879 iconExit:Play()880 exit.Completed:Wait()881 if notif and notif.Parent then882 notif:Destroy()883 end884 end)885end886887-- ============================================================888-- CLICK BUTTON INTERACTION889-- ============================================================890891local function animateClickButton()892 -- Button press animation893 TweenService:Create(clickButton, CONFIG.TWEEN_FAST, {894 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE - 10, CONFIG.CLICK_BUTTON_SIZE - 10),895 }):Play()896 task.delay(0.1, function()897 TweenService:Create(clickButton, CONFIG.TWEEN_BOUNCE, {898 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE, CONFIG.CLICK_BUTTON_SIZE),899 }):Play()900 end)901902 -- Pulse ring animation903 clickPulse.Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE, CONFIG.CLICK_BUTTON_SIZE)904 clickPulse.BackgroundTransparency = 0.3905 TweenService:Create(clickPulse, TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {906 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE + 40, CONFIG.CLICK_BUTTON_SIZE + 40),907 Position = UDim2.new(0.5, -(CONFIG.CLICK_BUTTON_SIZE + 40) / 2, 0, -20),908 BackgroundTransparency = 1,909 }):Play()910end911912local function onClickButtonActivated()913 -- Send click to server914 clickEvent:FireServer()915916 -- Local visual feedback917 animateClickButton()918919 -- Spawn floating text at random position near button920 local offsetX = math.random(-40, 40)921 local offsetY = math.random(-30, 10)922 local screenPos = Vector2.new(923 clickButton.AbsolutePosition.X + clickButton.AbsoluteSize.X / 2 + offsetX,924 clickButton.AbsolutePosition.Y + clickY + offsetY925 )926927 local earned = math.floor(state.multiplier)928 spawnFloatingText("+" .. formatNumber(earned) .. " Coins", screenPos, CONFIG.COIN_GOLD)929end930931clickButton.Activated:Connect(onClickButtonActivated)932933-- Touch support for mobile934clickButton.TouchTap:Connect(function()935 onClickButtonActivated()936end)937938-- ============================================================939-- PULSE ANIMATION (Idle state)940-- ============================================================941942local pulseRunning = true943944local function runIdlePulse()945 while pulseRunning do946 local pulseGoal = TweenService:Create(clickPulse, TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {947 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE + 20, CONFIG.CLICK_BUTTON_SIZE + 20),948 Position = UDim2.new(0.5, -(CONFIG.CLICK_BUTTON_SIZE + 20) / 2, 0, -10),949 BackgroundTransparency = 0.6,950 })951 pulseGoal:Play()952 pulseGoal.Completed:Wait()953954 if not pulseRunning then break end955956 local pulseReturn = TweenService:Create(clickPulse, TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {957 Size = UDim2.fromOffset(CONFIG.CLICK_BUTTON_SIZE, CONFIG.CLICK_BUTTON_SIZE),958 Position = UDim2.new(0.5, -CONFIG.CLICK_BUTTON_SIZE / 2, 0, 0),959 BackgroundTransparency = 0.8,960 })961 pulseReturn:Play()962 pulseReturn.Completed:Wait()963 end964end965966task.spawn(runIdlePulse)967968-- ============================================================969-- REMOTE EVENT CONNECTIONS970-- ============================================================971972updateCurrencyEvent.OnClientEvent:Connect(function(amount)973 updateCurrency(amount)974end)975976updateClicksEvent.OnClientEvent:Connect(function(amount)977 updateClicks(amount)978end)979980updateRebirthsEvent.OnClientEvent:Connect(function(amount)981 updateRebirths(amount)982end)983984updatePetsEvent.OnClientEvent:Connect(function(equipped, capacity)985 updatePets(equipped, capacity)986end)987988updateMultiplierEvent.OnClientEvent:Connect(function(value)989 updateMultiplier(value)990end)991992showNotificationEvent.OnClientEvent:Connect(function(message, notifType)993 showNotification(message, notifType)994end)995996showFloatingTextEvent.OnClientEvent:Connect(function(text, position, color)997 spawnFloatingText(text, position, color)998end)9991000-- ============================================================1001-- KEYBOARD SHORTCUTS1002-- ============================================================10031004UserInputService.InputBegan:Connect(function(input, gameProcessed)1005 if gameProcessed then return end10061007 -- Spacebar also triggers click1008 if input.KeyCode == Enum.KeyCode.Space then1009 onClickButtonActivated()1010 end1011end)10121013-- ============================================================1014-- MENU BUTTON CONNECTIONS1015-- ============================================================10161017for _, cfg in ipairs(menuButtonConfigs) do1018 local btn = menuButtons:FindFirstChild(cfg.name)1019 if btn then1020 btn.Activated:Connect(function()1021 -- Button press feedback1022 TweenService:Create(btn, CONFIG.TWEEN_FAST, { Size = UDim2.fromOffset(46, 46) }):Play()1023 task.delay(0.1, function()1024 TweenService:Create(btn, CONFIG.TWEEN_BOUNCE, {1025 Size = UDim2.fromOffset(CONFIG.MENU_BUTTON_SIZE, CONFIG.MENU_BUTTON_SIZE),1026 }):Play()1027 end)10281029 -- Fire to server to open menu1030 openMenuEvent:FireServer(cfg.name)1031 showNotification("Opening " .. cfg.label .. "...", "info")1032 end)1033 end1034end10351036-- ============================================================1037-- INITIALIZATION1038-- ============================================================10391040print("[Simulator HUD] Initialized successfully")10411042-- Intro animation1043task.spawn(function()1044 local elements = { topBar, clickButtonContainer, statsContainer, multiplierContainer, menuButtons }1045 for _, element in ipairs(elements) do1046 element.BackgroundTransparency = 11047 end10481049 -- Slide in animations1050 TweenService:Create(topBar, CONFIG.TWEEN_SLOW, { BackgroundTransparency = 0.1 }):Play()1051 task.wait(0.1)10521053 TweenService:Create(clickButtonContainer, CONFIG.TWEEN_BOUNCE, {1054 Position = UDim2.new(0.5, 0, 1, -180),1055 }):Play()1056 task.wait(0.1)10571058 TweenService:Create(statsContainer, CONFIG.TWEEN_SLOW, { BackgroundTransparency = 1 }):Play()1059 TweenService:Create(multiplierContainer, CONFIG.TWEEN_SLOW, { BackgroundTransparency = 0.9 }):Play()1060 TweenService:Create(menuButtons, CONFIG.TWEEN_SLOW, { BackgroundTransparency = 1 }):Play()10611062 task.wait(0.5)1063 showNotification("Welcome! Tap the button to start earning!", "success")1064end)10651066-- Demo: Simulate incoming data1067task.delay(2, function()1068 updateCurrency(1500)1069 updateClicks(42)1070 updateRebirths(1)1071 updatePets(5, 100)1072 updateMultiplier(2.5)1073 updateProgress(0.35)1074end)
