Expression Evaluator can run generic Lua code

With certain properties types like Vector3, you can enter any text you want into the property field. Since the expressions are handled in Lua, it’s possible to execute generic Lua code using this, up to an extent.

As far as I can tell, this bug can’t really be exploited, since this only exists in the studio UI, and it only has as much power as the command line.

However if you input something that can be parsed by Lua, like BrickColor.new(), the value gets stuck there until you enter a valid expression or select a different object. So if you were to try and input an expression that can’t be parsed by Lua, it will revert the text back to BrickColor.new(), despite that text being invalid as it is.

I thought that reselecting the object would revert the text back to the actual value, not “BrickColor.new()”

It should?

WHAT I SET IT TO | WHAT IT DISPLAYS AFTERWARDS
----------------------------------------------
1, 2, 3          | 1, 2, 3
BrickColor.new() | BrickColor.new()
Color3.new()     | Color3.new()
[reselect obj]   | 1, 2, 3

([reselect obj] being unselecting and reselecting the object)

Seems like the actual value doesn’t change when the evaluation fails, it just doesn’t visually update.

This isn’t a bug, I think it’s perfectly fine.

You can actually do stuff like this:

x = 1 _G.Num = function() x =x + 1; return x; end

in the console, and then

92522a5985df7aafec6cc9499dd32e614cb74130.png

Which is cool.

5 Likes

I don’t see any bugs here. It is intentional that we are evaluating Lua code here. This allows you to write complex math equations in a familiar language.

This is intended behavior. Studio will show a red outline around the invalid value until you correct it. Undoing will cause the value to go back to the last valid value.

2 Likes

Alright fair enough.
I just thought it was weird that it can interact with Roblox variables that aren’t relevant to the mathematical components.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.