Currently, I am trying to send a table of Instances with Textboxes to the client once loaded in, so that they can connect FocusLost events. The problem is, although the table of instances is originally correct in the script, once sent through the remote event it seems completely different? (however consistent)
RemoteEvents/Functions do not support having non-string indices in tables, so if you try to pass something that isn’t a string, Roblox will implicitly coerce it into a string.
i tried to produce a workaround for this, but this seems to produce its own problem? for some reason, the “UIObjects” inside the tables are wiped once sent now.
im not sure what this means/how this applies to my problem…? the SurfaceGui instances are on clientside, as they can be found in the explorer tab in playtesting on client side, if this is what you mean. how would i refer to these SurfaceGui’s so that i can directly connect a FocusLost event to a TextBox inside of it?
nevermind sorry, apparently the TextBox isnt being replicated to the client??? when simply being sent through the remote event as a seperate variable, the client registers it as nil.
this is the models ancestry from the client view, which made me believe that the TextBox and SurfaceGui was being replicated to the client, however apparently they arent?
i CAN confirm, this is the issue! StreamingEnabled is enabled, but i think this is more likely because of the fact the client is still loading in when CharacterAdded fires and so the TextBox hasnt yet been replicated to the client when the event is fired. i can prove this because when i add a task wait in the character added event before firing to the client, once the character has loaded in, the client now can see the TextBox variable! do you know a way i can yield this function so that it only fires to the client once all of workspace has fully been replicated? (obviously a task.wait is a pretty clumsy solution to finalize on haha)
ignore the sheeple i just needed a string i could recognise so that i could tell when the task.wait had finished yielding lol
(ClientSideGUIToReplicate and ClientSideGUIReplication are very close names but they arent the same variable)
Because StreamingEnabled is enabled, you can’t guarantee the whole workspace would be loaded, since it’ll only load the stuff in a specific radius.
The best solution here would probably to use CollectionService and then instead of firing a remote, you can just add a tag to the model, and then you can detect whenever the model is streamed in or streamed out on the client, and then just find the gui objects on the client.
You should also change the ModelStreaningMode of the modal to Atomic which makes it so either the whole model is streamed in or none of it, so you don’t have half the model streamed in.
thank you for this solution and reccomendations! i wanted to learn/find a good scenario to use CollectionService for the first time and i seemingly stumbled upon it lol, it works perfectly here!