game.Workspace.DummyCaptain.ClickDetector.MouseClick:Connect(function()
script.Parent.Parent.Parent.StarterGui.ShopClick.Frame.Visible = true
end)
its a gui right? we dont need a clickdetector on it because we dont need one frames already have their own events and if the script was a normal script then change it to a local script and write this
game.Workspace.DummyCaptain.MouseClick:Connect(function() script.Parent.Parent.StarterGui.ShopClick.Frame.Visible = not script.Parent.Parent.StarterGui.ShopClick.Frame.Visible end)
game.Workspace.DummyCaptain.ClickDetector.MouseClick:Connect(function() script.Parent.Parent.Parent.StarterGui.ShopClick.Frame.Visible = false end)