Why am I getting this erro?

I recently learned how loadstring() works, and I tried using it with a function, But I got this error.

  00:44:25.866  loadstring() is not available  -  Server - Script:1
  00:44:25.866  Stack Begin  -  Studio
  00:44:25.866  Script 'ServerScriptService.Script', Line 1  -  Studio - Script:1
  00:44:25.867  Stack End  -  Studio
local p = loadstring("function p(value) print(value) end")

local value = p(1)

ServerScriptService (LoadStringEnabled) | Roblox Creator Documentation

Toggles whether or not the loadstring function can be used by server scripts. Defaults to false.

you can enable loadstring on serverscriptservice oops

what

1 Like

You need to enable “LoadStringEnabled” on ServerScriptService. But beware this can lead to hackers executing server sided code which is super bad.

1 Like

This is false, the loadstring is only for server scripts in this context. Exploiters can already use the client sided version at all times.

1 Like