Does loadstring() take Lua (5.1) or Luau as input?

All I need to know is in the title, does the loadstring take Lua 5.1 code as input or does it take Luau code as input?

I just want to make sure which language does loadstring use as input to avoid errors,I haven’t been able to test this out because I really can’t tell since I do know that Roblox does not allow most methods and variables within the OS and other classes but I don’t know if the code needs to be Lua 5.1 because it and Luau have some big differences (Ex…: Variable type declarations like local myVar:number = 1).

The compiled code generated by loadstring is to be executed in the client, I have no concerns about security issues since I’m not stupid enough do directly have a remote event compile code in the server and running it at the same time.
I just need an answer saying either Lua 5.1 or Luau, no need to overcomplicate ;- )

It runs Luau.

Which “loadstring” are you talking about? The one which can be enabled from ServerScriptService only runs on server.
If you are talking about the loadstring module, it runs Lua 5.1. The one on server runs Luau.

It runs Luau AFAIK, I have used it before.

You know, you could just try it and see: loadstring("print(_VERSION)")()

2 Likes

Damn, I forgot _VERSION even existed…
Thanks for all of the replies

1 Like

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