How to enable loadstring() from client side

I want to use loadstring() in a local script but there’s an error that says loadstring() is not available. How do I enable it?

You can’t use loadstring on the client, but you can use modular like vLua 5.1 (improved VM) - Roblox.

StringLoader.rbxm (65.4 KB)
This module can do that, but not loadstring.

As szar20042 said, you simply can’t use it on the client - at least not directly.
Maybe the modules in the other replies are what you’re looking for, but if you only need some simple loadstring-functionality, you could just invoke a remote function on the client and let the server handle it and return the result.

Note: Do keep in mind that you’d most likely want to be very strict about what you let the client send over (you might need to filter/block some things). The code generated with loadstring will be ran on the server and could potentially let the player do almost anything.

Ok, what I wanted was the server sending loadString() to the client and the client run it, because only that specific client should see it (it’s for enabling a beam). I worked a way around this by instead of sending a function over, I just sent a table of objects and another table of properties and another table of values, so the client will take the property of the object, and set it to the value.

1 Like

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