A way to load a string in roblox

  • I want to load a string in roblox server only, like:
value = 'print("hello")'
load(value)
output:
"hello"
  • I tried loadstring() but its dangerous

To load a server-only string in Roblox, you can use the client-server communication capabilities available on the platform. You can use remote functions to send a string from the client to the server. Here is an example of how to do this:

Create a Script on the Client:

Create a script on the client (for example, in LocalScript) to send the string to the server. You can do this using a remote function. Make sure to create a remote function in the client script that will be responsible for sending the string:

loadstring by itself is not dangerous. It’s only dangerous if you’re allowing the client to run code to the function from a RemoteEvent. But if you’re still paranoid, you can just use this: vLua: Loadstring reimplemented in Lua


@HP_D3V ChatGPT doesn’t answer their question


No

1 Like

then? what about the load function, you didn’t mention that

Is there another way, coz im not really into these