Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GUI not showing when clicked?

Asked by 8 years ago

I'm trying to get a shop GUI to create a frame in the center of the screen when the button is clicked. I've put the Frame inside the button, and isolated it by putting it in ScreenGui.

local ShopButton = game.StarterGui.Shop.ShopButton
ShopButton.MouseButton1Down:connect(function()
local ShopFrame = Instance.new("Frame")
ShopFrame.Parent = game.StarterGui.Shop.ShopButton
ShopFrame.Position = UDim2.new(.5, -50, .5, -50)
ShopFrame.Size = UDim2.new(0, 100, 0, 100)
ShopFrame.BackgroundColor = BrickColor.new(234, 234, 234)
ShopFrame.BorderColor = BrickColor.new(181, 181, 181)
ShopFrame.BorderSizePixel = 4
end)

Answer this question