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:
script.Parent.OpenStoreButton.MouseButton1Click:Connect(function()
script.Parent.Visible = false
LocationOfYourEvent:FireServer(game.Players.LocalPlayer.PlayerGui.NameOfGui)
end)
and...
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.
script.Parent.OpenShopButton.MouseButton1Click:Connect(function()
script.Parent.Parent.ShopGui.Visible = true
end)
There you go, simplified even more and nothing much to do.
If you have any questions or issues, please contact me. ;)
5 comments
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.
so change a gui of mutiple players?
Nonono, how to conserve space by not making multiple remote events for each GUI.
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.
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..