**What is the issue? keep in mind im fairly new to coding.
i have been working at this for a while now, and i cant seem to find a fix
when i press the ui button the shop ui is not visible, heres an example of the code below
MouseButton1Click has to be connected to something! What I mean by that is instead of just saying MouseButton1Click:Connect(Appear), you’d have to do WhateverTheButtonNameIs.MouseButton1Click:Connect(Appear)
This isn’t so much of an issue but it might be helpful knowledge to you and save some headaches in the future! If you’re looking for shorter variables, you should reference the previous variable. For example in your code I see
local localPlayer = game.Players.LocalPlayer
local ExitButton = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton
-- Could be:
local localPlayer = game.Players.LocalPlayer
local ExitButton = localPlayer.PlayerGui.ScreenGui.TextButton
It looks like your appear function won’t actually do anything until the ExitButton is clicked looking at your script!
If you’re looking for just a simple visible / not-visible whenever a button is clicked, try this!
local Player = game.Players.LocalPlayer
local OpenButton = script.Parent
local CloseButton = script.Parent.Parent.ShopFrame.Exit
local ShopFrame = script.Parent.Parent.ShopFrame
OpenButton.MouseButton1Click:Connect(function()
ShopFrame.Visible = true
end)
CloseButton.MouseButton1Click:Connect(function()
ShopFrame.Visible = false
end)