i have been working on a game and want to make a shop ui that will open when you press a button i have done this before but for some reason its not working
local frame = script.Parent.Parent.shopframe
local button = script.Parent
button.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
end)
Is it a regular script? It should be a local script.
Also:
1: Add ScreenUI to StarterUI - 2: Add frame, 3: add text button, add localscript and write the following
local frame = script.Parent.Parent.FrameNameHere
local buttonui = script.Parent
buttonui.MouseButton1Click:Connect(function() print("button clicked.")
script.Parent.Parent.Frame.Visible = true print("Frame is now visible.")
local player = game.players.localplayer
local frame = game.ShopGui.Frame
script.parent.mousebutton1click:Connect(function()
player.playergui.frame.Visible = true