Long story short, I want to be able to paste the following LocalScript into as many Frames as I want and for the visibility state of the frames to save when a player leaves and joins. Currently, if a Frame changes visibility, it affects all of the other Frames with the LocalScript. Is there any way to fix this? I am going to provide the LocalScript and ServerScript below. Lmao for what it’s worth I will donate 1k robux to whoever can solve this issue I have been at it for a long time
Yes! However, I want to be able to use this script in several Frames though because not all of them are located under one Frame. The Frame that holds all of these Frames is located within a Frame that is located within a Frame and so on. I will provide the hierarchy.
To fix the issue where changing the visibility of one frame affects all other frames with the same LocalScript, you need to ensure that each frame is treated individually. Here’s how you can achieve this:
Unique Identifiers: Ensure each frame has a unique identifier (ID) so that their states are tracked separately.
Separate Attribute Tracking: Use attributes on the player to track visibility states for each frame independently.
Independent Visibility Updates: Ensure the visibility updates are handled based on each frame’s unique ID, both on the client and the server.
Steps to Implement:
Assign Unique IDs: Assign a unique ID to each frame upon creation if they don’t already have one.
Attribute-Based Visibility: Store the visibility state for each frame using player attributes that incorporate the frame’s unique ID.
Individual Attribute Listeners: Listen for changes to these attributes separately for each frame and update visibility accordingly.
Server Synchronization: When a frame’s visibility changes, communicate this specific change to the server along with the frame’s unique ID. The server should then broadcast this change to all clients, ensuring only the relevant frame’s visibility is updated.
By ensuring that each frame has a unique identifier and managing their visibility states separately, you can prevent changes to one frame from affecting others.
well when you hide a frame that has other frames inside of it, it automatically hides all the frames inside of it. so the only solution i can think of is to add stringvalues to each frame. when each frame’s visibility state changes, the stringvalue inside the frame changes to either “visible” or “invisible”. the script will then check which stringvalues are set to “visible” or “invisible” and set the stringvalue’s parent (the frame) to the correct visibility state.