RobloxLocked should put Instances in a read-only state for Scripts/LocalScripts, rather than blocking them entirely

One of the things that annoys me about RobloxLocked, is that we can’t even check if an object is RobloxLocked, without throwing it into a pcall.

I think at the very least, Scripts/LocalScripts should be allowed to read the RobloxLocked property itself, and perhaps even all properties of RobloxLocked instances. As long as they can’t be modified, I don’t think any harm could come of it.

6 Likes

I agree with being able to read RobloxLocked, but I think it’s intended that the other properties can’t be read when it’s true.

1 Like

Is there anything specifically bad that could be abused by LocalScripts just because they aren’t RobloxLocked?
I don’t know of anything.

I don’t know because I never really have to work around objects that are RobloxLocked. What kind of properties would you want to read off of these objects?

the Text property, for example; you can use this to detect the report message from the CoreGUI. Basically stuff which is meant to be ‘private’ between the user and ROBLOX.

I like the idea of being able to read RobloxLocked because it helps us prevent a bunch of issues like exploiters being exploiters and stuff.

Is that really an answer to “what properties would you like to read”, you shady person :cold_sweat:

Yeah, that’s a good point.
I think the Text property of a TextBox should definitely be an exception.

1 Like

I accidentally replied to the wrong person (I meant to reply to CloneTrooper’s post) but I was giving an example of what could go wrong if you could read any property of a RobloxLocked instance :stuck_out_tongue:

Perhaps returning the default value is a better idea, or a blank value.

There wouldn’t really be any point in being able to read them in the first place if they were just going to return defaults or undefined values; it’s better to do something like this:

if instance.RobloxLocked then
    warn('A RobloxLocked instance was passed - possibly an exploiter?')
else
    print(instance.Name, instance.Parent)
end

Making the RobloxLocked propery read-only for the default context might be best.
Making all properties read-only wouldn’t be possible because of privacy stuff.
(Only important example I can think of is whispers in the CoreGui)