New to FE scripting, remotefunction I made not working?
Asked by
7 years ago Edited 7 years ago
1 | hs = game:GetService( "HttpService" ) |
2 | function script.Parent.RemoteFunction.OnServerInvoke(player, url) |
3 | local response = hs:GetAsync(url) |
So, I'm working on a discord message interface surfacegui that will display Discord messages on a SurfaceGui inside of ROBLOX, using a Node.js backend to fetch messages, channels. and more for a Discord bot that will be put in a guild. I can't seem to get my remotefunction for HTTP requests to work, yet when I try using getasync normally from a script, rendering and everything works, and I can print normally. With the remotefunction, I'm pretty sure it returns something empty, as I cannot index anything.
Response should be instant. Any help?
Firing it with
1 | request = game.ReplicatedStorage.RemoteFunction |
3 | messageresult = hs:JSONDecode(messageresult) |
This works perfectly fine in a script, normally using GetAsync.