Script
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local clickDetector = script.Parent.ClickDetector
local shopOpenRequest = Instance.new("RemoteFunction")
shopOpenRequest.Name = "ShopOpenRequest"
shopOpenRequest.Parent = ReplicatedStorage
local function clicked(player)
shopOpenRequest:InvokeClient(player)
end
clickDetector.MouseClick:Connect(clicked)
Local Script
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local shopOpenRequest = ReplicatedStorage:WaitForChild("ShopOpenRequest")
local shop = script.Parent.Parent
shop.Enabled = false
local function onShopOpenRequested()
shop.Enabled = true
end
shopOpenRequest.OnClientInvoke = onShopOpenRequested()
This script would run immediately after you join server and never work again. I need solution on how to make this script run only when the clickDetector is activated and run more than once.

1 comment
Thanks but It doesn't work