So, what I am doing is running a code from an input, it is not working, also doesn’t give me errors. I have the server script.
game.ReplicatedStorage.Code.OnServerEvent:Connect(function(player, code)
print(loadstring(code)) -- The code is just print("Hello"), but it just prints function: 0x25e043b4d07fb9f8
end)
Try doing just the loadstring(code) part instead of print, I believe its because you’re trying to print a function, which basically returns its memory index.
loadstring() returns a function, so you would have to do loadstring(code)(). Be sure to sandbox the loaded code(or just don’t use loadstring) or people can break your game really badly.
Replace your print line with loadstring(code)() if you wanna run it. For sandboxing you can overwrite globals such as getfenv, game etc with nil values (blacklist) or use setfenv (whitelist) to restrict which functions can be used.