I have a GUI that is supposed to load scripts from Pastebin in onClick. It doesn't seem to be doing its job. I did further research and learned that you can't run HTTPService with a LocalScript. I was wondering how I might be able to make it so when you click a button on a GUI it will run the HTTPService, loading in a script from Pastebin.
PS: This is not for any malicious content. I'm working on an admin and think this will help lag problems.
You can only send HTTP requests on the server which means you'll have to use remotes to be able to communicate to the server.
Example:
Client:
button.MouseButton1Click:Connect(function() local data = RemoteFunction:InvokeServer() -- now that you have the data you want from the httprequest made on the server you can do whatever you want with it here end)
Server:
RemoteFunction.OnServerInvoke = function() local response = game:GetService( HttpService"):GetAsync("http://example.org/json-table", true) local data = game:GetService("HttpService"):JSONDecode(data) return data end)