StreamingEnabled messes with my Localscript that handles multiple buttons in different places

I have this LocalScript that automates and creates mouseclick event to every specific Screengui with buttons.

It errors because of different location of basepart that is not rendered to the clients side.

How do I fix this error?

1 Like

I don’t know how streaming enabled interferes with screen gui, but just disable streaming enabled if you don’t require it

You can create the relevant/necessary BaseParts on the client. If I remember correctly, BaseParts created on the client (Instance.new(), Instance:Clone()) are not affected by StreamingEnabled. You could store the BaseParts you need in ReplicatedStorage and clone them from there into the workspace via a LocalScript.

I put all the instances that I need loaded at all times in a model with the behavior set to persistent which seems to work.

1 Like

Note: If you are using multiple of the same model, and do not want to have separate copies for each model due to their needed position in workspace, you could have a reference part in place of where you want your copies to be positioned, then through a RemoteEvent pass the CFrame/Position to the client so you know where to position your copies when cloning from ReplicatedStorage.

Ah right, if this fits your needs then it should be fine. Forgot about that lol

I used CollectionService for LocalScript so that I could efficiently modify every GuiButtons inside a surface GUI. but other buttons don’t work because they’re outside the rendering of the client.

I don’t want to disable StreamingEnabled because it prevents my game from lagging.