Extracting User Input Data to Use Elsewhere

Hello all!

I am looking to use an external script to house variable data and options related to a traffic system, all connected via RemoteFunction(GetTrafficVariables):
overview

So, I’m happy now, but I want to go further by using GetTrafficVariables to fill in some information for the Controller. The information is:

ModesOfOperation = { "PreTimed", "Actuated" }
TypeOfOperation = { ["PreTimed"] = "Isolated", "Coordinated", 
					["Actuated"] = "Semi-Actuated", "Fully-Actuated", "Coordinated" }

The blanks that the Controller needs filled are:

script.GetTrafficVariables.OnInvoke = function(ModesOfOperation, TypeOfOperation)
ModeOfOperation = ""
TypeOfOperation = ""
end

This is where user input will occur. The user will select from an interface the Mode and Type based on their needs – behind the scenes, the Controller will get their selected options (which are the indexes and values within the TypeOfOperation & ModeOfOperation tables). I need it only to retrieve one of each (i.e. ModeOfOperation = "Actuated" TypeOfOperation = "Semi-Actuated") ← This example is the intended fruits of my labor. All indexes and values I plan to have defined as I get to each one and research its function.

Here is the source I am drawing from, use it to wrap your heads around what is going on here (if needed).

Thanks in advance!

So what’s your actual question? You didn’t actually ask anything, you just gave us a bunch of statements. From what I can deduce, your question is: How do I make a GUI popup when this BindableFunction is called, then return the options the player selected?

1 Like

My bad,

Put that way, yes, I am looking to have a drop down menu for these options.
I am trying to approach this one at a time, Am I on the right track? Do I need a return function instead? I just have a feeling that I am not doing something right.

All examples I have looked into use print, but I don’t want it printed.

So far I think you are fine. Note that in your current setup you aren’t using a RemoteFunction, you’re actually using a BindableFunction (there’s a difference).

Here’s the general flow of what you want to do:

  • Server calls the GetTrafficVariables functions
  • Send request to player using a RemoteEvent or RemoteFunction
  • Player receives request and opens a GUI
  • Player selects options within the GUI then submits it
  • Player sends request to server (or returns in the RemoteFunction) with the submitted options
  • Server interprets the request, validates it, then returns the options

The client-side code could all be within a ScreenGui or something.

Thanks, I must have overlooked my grammar.