Hi, I’m making a game where everyone can execute any script that they want, but, if you’re trying to execute smth, it’s executing the script in “”, so loadstring can’t even do anything with that.
ServerScriptService (Script):
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("ExecuteRemote")
Remote.OnServerEvent:Connect(function(Player, ScriptToExecute)
if not Player then return end
if not ScriptToExecute then return end
if Player and ScriptToExecute then
loadstring(ScriptToExecute)
end
end)
local Button = script.Parent
function onClick()
game.ReplicatedStorage.ExecuteRemote:FireServer(tostring(script.Parent.Parent.ScriptBox.Text))
end
Button.MouseButton1Click:Connect(onClick)
When I’m clicking on the button, it’s automatically executing my script that I put in the text box in the “”, so it’s not doing anything. Help!
I am fairly sure you would have to acquire the string value the person sent in the message and compile that into luau or something.
Not sure if this is possible, but you could do this sort of thing by setting up commands with logic statements that allow you to program in another way. I think?
Overall sounds really cool though, and I hope you figure it out!
Note: This game might have problems with people spamming the server or banning/kicking players.
I’m making this topic just because I don’t know how to make a script that will fire a remote event without any quotation marks, so I don’t even know about luau and etc.