Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to not create excessive Remote Events?

Asked by
Pojoto 329 Moderation Voter
6 years ago

So when working with GUI's I find myself starting to create multiple Remote Events for separate GUI's. What are some ways to conserve space and use fewer RemoteEvents?

Is the only solution with parameters, because if it is I guess I'll have to use them. Also if you could provide examples of changing multiple GUI's with one remote event that'd be helpful! "D

0
I'm not too sure about examples and such but I'd just suggest using parameters such as sending "messages" and doing something for each certain message/parameter. MythicalShade 420 — 6y
0
so change a gui of mutiple players? User#23365 30 — 6y
0
Nonono, how to conserve space by not making multiple remote events for each GUI. Pojoto 329 — 6y
0
Add parameters, that way you don't make many remotes. If it's client-server, make sure not to send anything that can be maliciously manipulated by a client. If it's server-client, send whatever you want. User#19524 175 — 6y
0
one remote event change the other client to recieve arguments it can interpret as a button such as button codes button1 code:1 button two code:2 etc remote events also automatically can tell what player the server event came from.. 129Steve129 7 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

My best guess on this issue is having one of the parameters being which GUI it is trying to call. Since I don't know 100% exactly what you want but can get pretty close to it, I guess this might probably be a great fix.

Try something like this:

--LocalScript

script.Parent.OpenStoreButton.MouseButton1Click:Connect(function()
    script.Parent.Visible = false --Assuming your script is in the GUI
    LocationOfYourEvent:FireServer(game.Players.LocalPlayer.PlayerGui.NameOfGui)
end) --When the "OpenStore" button is clicked it creates a function

and...

--Script

LocationOfYourEvent.WhateverEventYourUsing:Connect(function(Plr, GuiToOpen)
    GuiToOpen.Visible = true
end)

Although this is what you wanted, the simpler fix is that you don't need to call a script to do the work. Since it's only visible to the player you should just use a local script to change the visibility of those GUIs.

--LocalScript

script.Parent.OpenShopButton.MouseButton1Click:Connect(function()
    script.Parent.Parent.ShopGui.Visible = true --Assuming you put your GUIs together
end)

There you go, simplified even more and nothing much to do.

If you have any questions or issues, please contact me. ;)

Ad

Answer this question