I have a gui that you can input a string key that goes to a server script, which get the data (a string) then loadstring it and i need that it would return the function to the original local script and i have tried remote function and many more of them , also tried shared[...], _G, modules is it even possible?

key = Gui.Text field.Text ---> :FireServer(key) --->(to server) .OnserverEvent...(p, key) ---> data = datastore:GetData(key) ---> loadstring( data )() ---> ??return the function to the client?? ---> execute the code in client local script

data = "function() ... end"

4 comments

0

Maybe a module script? I don’t think functions can be passed through remotes.

0

tried them and it doesnt "see" it in serverscriptservice

0

You can only share functions through ModuleScripts in a place like ReplicatedStorage (since clients can't access ServerScriptService)

0

Thanks for the reply but then it cant access Datastore