Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

problem with transfering functions from server to client?

Asked by 5 years ago

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"

0
Maybe a module script? I don’t think functions can be passed through remotes. ABK2017 406 — 5y
0
tried them and it doesnt "see" it in serverscriptservice karolis77 2 — 5y
0
You can only share functions through ModuleScripts in a place like ReplicatedStorage (since clients can't access ServerScriptService) chess123mate 5873 — 5y
0
Thanks for the reply but then it cant access Datastore karolis77 2 — 5y

Answer this question