On My UI I Want It Where You can click on this button and open another ui and close the other one
the first one is Gui2 And i want it to open a frame called UI

On My UI I Want It Where You can click on this button and open another ui and close the other one
the first one is Gui2 And i want it to open a frame called UI

script.Parent.MouseButton1Click:Connect(function()
script.Parent.Visible = false
(your shop).Visible = true
end)
This in a local script inside gui or ?
is it a server side or a client side you are doing it for?
Yes. Itβs a local script inside the button that you want to click.
It made the button disapear and the ui stayed. ![]()
Nvm my bad. script.Parent.Parent.MouseButton1Click*
If that doesnt work, try script.Parent.Parent.Parent
script.Parent.Parent.MouseButton1Click:Connect(function()
script.Parent.Visible = false
(your shop).Visible = true -- !Change this to your shop gui!
end)
Hi, an easier way to call a function is using the βRemoteEventsβ I leave you the link for more information, for example if you want the user to get another GUI screen you must call it through clients in RemoteEvents, if you do it by server, the whole server will look at the gui.
Example:
local rs = game:GetService("ReplicatedStorage")
local RemoteEvent = rs:FindFirstChild("RemoteEvent")
script.Parent.MouseButton1Click:Connect(function()
RemoteEvent:FireClient()
end)
3.You will go to the other GUI you want to display and also call the remote event option.
4. You create a LocalScript and enter the following
local rs = game:GetService("ReplicatedStorage")
local RemoteEvent = rs:FindFirstChild("RemoteEvent")
RemoteEvent.OnClientEvent:Connect(function()
script.parent.visible = true
--Here you can create an open and close system, but that is up to you.*
end)
It is the most convenient way to avoid future bugs or corruptions in the server that can slow it down.
You should leave Gui handling to the client only (through the use of local scripts).