Sending Data From One Frame to Another

Hello, y’all so I am having trouble trying to figure out how to do this, and I bet it is probably the easiest thing to do. But anyways, I am making a private server system, and I have a frame that consist of the server name and player count, and the server name is a TextButton, and I have a second frame that consist of more info like the server name, profile image, could y’all point me in the right direction on how to get the data I have inside of that frame to transfer to the Server Info Frame? If y’all could point me to the roblox documentation for this, that would be very helpful! Thanks in advance!

Here is a visualization:

1 Like

You can use BindableEvents. they allow you to transfer data between different parts of your game.

There are a ton of ways to do this. If you want to be simple then here are a few ways.

If one script is controlling all of the menu elements, simply fetch the server name from the button and put it in the second frame.
If multiple scripts are controlling the menu elements (I don’t know why). You can use BindableEvents or RemoteEvents based on the script type you’re using to do the same thing.

You can have both logic combined in a single script. This is handy if the logic is simple. Long scripts are bad…

Alternatively have the ‘ServerName’ and ‘PlayerCount’ be attributes that one localscripts sets. Then the ‘Play’ localscript can read the attributes and send them to the server.

This last method is probably overkill in this case, I would go with a single script.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.