I have been testing with a shop and successfully created a normal one, in a non-FE place. However, I tried making the shop in Filtering Enabled, and I got as far as the close button before I got stuck. The closing script works fine in play solo, but not in a local server or in an actual game.
This is how I made it,
game > StarterGui > Shop(ScreenGUI) > Frame1(Frame) > Close(TextButton) > LocalScript
The LocalScript's Code
function onClicked() script.Parent.Parent.Parent:Destroy() end script.Parent.MouseButton1Click:connect(onClicked)
I researched a bit about Filtering Enabled and Remote Events/Functions, yet I still was very confused and making messy scripts so I just went with this simple script.
Also if you want to for any reason, you can see the shop here.
You need to get into the player's PlayerGui instead of getting into it raw.
Also use WaitForChild()
and GetService()
to stop those evil infinite yields
Local script:
local Storage=game:GetService('ReplicatedStorage') local players = game:GetService('Players') local player = players.LocalPlayer local gui = player:WaitForChild('PlayerGui') local Shop = gui:WaitForChild('ScreenGui') local Frame = Shop:WaitForChild('Frame') function onClick() if Frame.Visible==true then Shop.OpenShop.Text = "Open Shop" Frame.Visible=false else Shop.OpenShop.Text = "Close Shop" Frame.Visible=true end end script.Parent.MouseButton1Click:Connect(onClick)
Please comment if this script doesn't work. i will try my best to solve the script ;)