Basically when I click a button on a GUI it opens up another screengui. I'm using remotefunctions to enable the GUI but it isn't working.

Here is the code in my button:

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.OpenShop:FireServer()
end)

Here is my code in the other GUI (the one I want to be enabled):

game.ReplicatedStorage.OpenShop.OnServerEvent:Connect(function()
	
	script.Parent.Enabled = true
end)

They're both in local scripts.

Here's the code I had before:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.ShopGUI.Enabled = true
end)

6 comments

0

oh my poor child.

0

There's no need to use a remoteevent, as they are both on the same client

0

If I don't, it says it's not a valid member of playergui.

0

Edit this with the code you had before and we can help you from there.

0

Nevermind. I forgot to add another .Parent.

0

Why are you using a RemoteEvent to open a shop exactly????