local function TriggerRecieved() print("We got your request. Processing now.") end RequestData.OnServerInvoke = TriggerRecieved end)
So this is the only section that matters. I have what i call a slingshot event. One server script fires the local script, and the local script fires #2 script for information from within that script.
How can i use Remote functions to send variables back to the client sided script if possible ?
Keep in mind that Remote FUNCTIONS are used to relay data from server to client and vice versa. This means that info will be passed somewhat like this: ServerInputToClient > ClientRecievesInput > ClientInputToServer > ServerRecievesClientInput.
If you are only trying to do something like ServerImputToClient > ClientRecievesInput then you want to be using Remote EVENTS. I only tell you this because sometimes people will use remote functions when they really only need to use a remote event.
Here's an example of how to set up a remote function in which the client would request something from the server and return it to the client:
-- In your Local Script local repStorage= game:GetService("ReplicatedStorage") local requestData = repStorage:WaitForChild("DataRequest") local request = requestDatat:InvokeServer() --This means that request will be whatever your Server Script returns --In your Server Script local repStorage= game:GetService("ReplicatedStorage") local dataRequest = Instance.new("RemoteFunction",repStorage) dataRequest.Name = "DataRequest" local function DataRequested(player) local request = DEFINEREQUESTHERE return request --this sends the variable "request" to your local script end dataRequest.OnServerInvoke = DataRequested --This means that whenever the server is invoked the DataRequested function will trigger.