is it possible to set a specific scale in midi piano roll?

Does cubase have a function whereby in the midi piano roll, you can specify a scale so that only those notes get played?

No.
You can use a chord track and limit the input to chord or scale.

Thanks for the reply - is the ‘limit the input to chord or scale’ function found in the inspector of the chord track?

You can also set the Note’s Color to be based on the Chord Track instead of the default Velocity.