Client String Execution

Hello,
I’m trying to allow players to execute scripts from a local script on my game.
(Not for malicious purposes, I’m trying to make a challenge to expose game weaknesses.)
loadstring doesn’t work from the client, is there anything else I can do?

I honestly don’t think this is either allowed or possible. I could be wrong though.

You can try and refer to this: How to execute a loadstring() command
And to run the loadstring you can send it over to the server with remove events / functions and continue from that.

I think what he’s trying to simulate is an exploiters PoV, AKA not able to access the server. As for how to go about this, I’d personally try to find another method, this sounds like an A/B problem. What specifically are you trying to achieve?

2 Likes

You can achieve client-side script execution by using a custom loadstring module. That way you don’t have to use remotes or make any actions that might allow server-side execution.

local Players = game:GetService("Players")

local Player = Players.LocalPlayer 

local loadstring = require(script:WaitForChild("Loadstring"))

Player.Chatted:Connect(function(message)
	loadstring(message)()
end) 

placing this script in a LocalScript will allow users to run client-side code through the built-in chat.

3 Likes

There’s not much you can do other than write a custom Luau compiler/interpreter in Luau.