I'll help you create a polished shop GUI with animations using Lua for Roblox. This will include smooth tweens, nice color schemes, and a modern design.
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
-- Constants for colors and animation settings
local COLORS = {
Primary = Color3.fromRGB(45, 156, 255), -- Bright blue
Secondary = Color3.fromRGB(255, 126, 242), -- Pink
Background = Color3.fromRGB(32, 33, 36), -- Dark gray
Text = Color3.fromRGB(255, 255, 255), -- White
Highlight = Color3.fromRGB(255, 217, 102) -- Gold
}
local TWEEN_INFO = {
Short = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
Medium = TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
Bounce = TweenInfo.new(0.6, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
}
-- Create the main GUI
local function createShopGUI()
local shopGui = Instance.new("ScreenGui")
shopGui.Name = "ShopGUI"
-- Main frame
local mainFrame = Instance.new("Frame")
mainFrame.Name = "MainFrame"
mainFrame.Size = UDim2.new(0, 600, 0, 400)
mainFrame.Position = UDim2.new(0.5, -300, 0.5, -200)
mainFrame.BackgroundColor3 = COLORS.Background
mainFrame.BorderSizePixel = 0
mainFrame.Parent = shopGui
-- Apply corner radius
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 12)
corner.Parent = mainFrame
-- Title
local title = Instance.new("TextLabel")
title.Name = "Title"
title.Size = UDim2.new(1, 0, 0, 50)
title.Position = UDim2.new(0, 0, 0, 0)
title.BackgroundTransparency = 1
title.Text = "✨ Magical Shop ✨"
title.TextColor3 = COLORS.Text
title.TextSize = 32
title.Font = Enum.Font.GothamBold
title.Parent = mainFrame
-- Items container
local itemsContainer = Instance.new("ScrollingFrame")
itemsContainer.Name = "ItemsContainer"
itemsContainer.Size = UDim2.new(1, -40, 1, -70)
itemsContainer.Position = UDim2.new(0, 20, 0, 60)
itemsContainer.BackgroundTransparency = 1
itemsContainer.ScrollBarThickness = 6
itemsContainer.Parent = mainFrame
-- Grid layout for items
local gridLayout = Instance.new("UIGridLayout")
gridLayout.CellSize = UDim2.new(0, 120, 0, 150)
gridLayout.CellPadding = UDim2.new(0, 10, 0, 10)
gridLayout.Parent = itemsContainer
return shopGui, itemsContainer
end
-- Create an item card with hover effects
local function createItemCard(name, price, imageId)
local card = Instance.new("Frame")
card.BackgroundColor3 = COLORS.Primary
card.BorderSizePixel = 0
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 8)
corner.Parent = card
-- Item image
local image = Instance.new("ImageLabel")
image.Size = UDim2.new(1, -20, 0, 80)
image.Position = UDim2.new(0, 10, 0, 10)
image.BackgroundTransparency = 1
image.Image = imageId
image.Parent = card
-- Item name
local nameLabel = Instance.new("TextLabel")
nameLabel.Size = UDim2.new(1, 0, 0, 20)
nameLabel.Position = UDim2.new(0, 0, 0.7, 0)
nameLabel.BackgroundTransparency = 1
nameLabel.Text = name
nameLabel.TextColor3 = COLORS.Text
nameLabel.TextSize = 16
nameLabel.Font = Enum.Font.GothamSemibold
nameLabel.Parent = card
-- Price button
local priceButton = Instance.new("TextButton")
priceButton.Size = UDim2.new(0.8, 0, 0, 25)
priceButton.Position = UDim2.new(0.1, 0, 0.85, 0)
priceButton.BackgroundColor3 = COLORS.Secondary
priceButton.Text = price.." 💎"
priceButton.TextColor3 = COLORS.Text
priceButton.TextSize = 14
priceButton.Font = Enum.Font.GothamBold
priceButton.Parent = card
local buttonCorner = Instance.new("UICorner")
buttonCorner.CornerRadius = UDim.new(0, 6)
buttonCorner.Parent = priceButton
-- Hover animations
card.MouseEnter:Connect(function()
local scaleTween = TweenService:Create(card, TWEEN_INFO.Short, {
Size = UDim2.new(1.05, 0, 1.05, 0)
})
local colorTween = TweenService:Create(card, TWEEN_INFO.Short, {
BackgroundColor3 = COLORS.Highlight
})
scaleTween:Play()
colorTween:Play()
end)
card.MouseLeave:Connect(function()
local scaleTween = TweenService:Create(card, TWEEN_INFO.Short, {
Size = UDim2.new(1, 0, 1, 0)
})
local colorTween = TweenService:Create(card, TWEEN_INFO.Short, {
BackgroundColor3 = COLORS.Primary
})
scaleTween:Play()
colorTween:Play()
end)
return card
end
-- Initialize the shop
local function initializeShop()
local shopGui, itemsContainer = createShopGUI()
-- Sample items (replace imageIds with actual asset IDs)
local items = {
{name = "Magic Sword", price = "1000", imageId = "rbxassetid://123456"},
{name = "Crystal Staff", price = "2000", imageId = "rbxassetid://123457"},
{name = "Dragon Wings", price = "3000", imageId = "rbxassetid://123458"},
-- Add more items as needed
}
-- Create item cards with staggered animation
for i, item in ipairs(items) do
local card = createItemCard(item.name, item.price, item.imageId)
card.Parent = itemsContainer
-- Staggered appearance animation
card.Position = UDim2.new(0, 0, 0, -50)
card.BackgroundTransparency = 1
delay(i * 0.1, function()
local appearTween = TweenService:Create(card, TWEEN_INFO.Bounce, {
Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 0
})
appearTween:Play()
end)
end
shopGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
end
-- Call this function to show the shop
initializeShop()
This code creates a modern shop GUI with the following features:
- Smooth animations and transitions
- Hover effects on items
- Staggered appearance animation for items
- Modern color scheme with gradients
- Responsive grid layout
- Bouncy animations
- Clean, modern design with rounded corners
- Scroll functionality for many items
To use this GUI:
- Replace the imageId values with actual Roblox asset IDs
- Add more items to the items table
- Customize colors in the COLORS table
- Adjust sizes and positions as needed
The GUI includes:
- Smooth hover animations when moving over items
- Scale and color transitions
- Staggered appearance animations when the shop opens
- Responsive grid layout that adjusts to the container size
- Modern styling with rounded corners and gradients
- Clear price buttons with hover effects
You can customize the appearance by modifying the COLORS table at the top of the script, and adjust animation timing by modifying the TWEEN_INFO table.
Would you like me to explain any specific part in more detail or help you customize it further?