Hey, I am currently working on a game that requires me to parent localscripts to their playergui to avoid certain users from having a specific localscript, but if I clone a localscript in serverstorage and parent it to playergui does it utilize server memory, if so are there any better alternatives?
Instead of duplicating local scripts, you could fire a function to run as a parameter in a remote event and run it from there. If you want to use it several times, you can always save it to a table.
3 Likes
So just do like
addScriptEvent.OnClientEvent:connect(function(scrpt)
scrpt:Clone().parent =
end)
?
something like this
local storage = {} -- stores the function for later use
run_func.OnClientEvent:Connect(function(func_to_run)
-- make sure the key is something that NO OTHER PLAYER WILL KNOW
storage["key"] = func_to_run -- saves the function in a table to be used
storage["key"]() -- runs the function
end)
What would that function be though? Would it be the function to clone the localscript?
the function would be the thing you would want to run in the local script.
Ah i see, so just store it in like a module or something it’ll act like a bootstrapper than pass it to the client and fire it
yeah, so you don’t have to keep cloning local scripts.
Smart man interesting take didnt think about doing this
2 Likes