I have no experience in the world of scripting, and I need some code figured out.
Usually I would search it up and watch some tutorials, but I can’t find the answer.
I need this UI:
To disappear when one of the buttons are clicked, and then this UI will appear permanently appear:
1 Like
You have to just make the gui disappear when one of the buttons is clicked, simple script.
1 Like
local frame = --the frame that contains those buttons
local pc = --pc button
local mob = --mobile button
pc.MouseButton1Click:Connect(function()
frame.Visible = false
end)
mob.MouseButton1Click:Connect(function()
frame.Visible = false
end)
1 Like
It’s a bit sloppy but still works.
1 Like
Oh yeah also replace those comments with what it goes to.
What about making the other GUI visible? Thanks anyway.
Oh, sorry I forgot about that. Let me write the script for that too.
1 Like
local frame = --the frame that contains those buttons
local main = --the frame that you want to show after the user chooses
local pc = --pc button
local mob = --mobile button
pc.MouseButton1Click:Connect(function()
frame.Visible = false
wait(0.1)
main.Visible = true
end)
mob.MouseButton1Click:Connect(function()
frame.Visible = false
wait(0.1)
main.Visible = true
end)
1 Like
I’ll try it soon, thanks for the help once again!
One last question, does the script go in LocalScriptService?
1 Like
Oh it doesnt, it goes into a localscript thats in the screenrgui where you have those frames.
So the LocalScript is in the ScreenGui.
Noted!
My bad, I meant to say screengui not startergui
1 Like
(this is the description of a localscript in studio)
"A script that runs on clients, NOT servers. Localscripts can only run when parented under one of the following:
- A player’s Backpack.
- A player’s Character model.
- A player’s PlayerGui
- A player’s PlayerScripts.
- The ReplicatedFirst service."
@GLITCHED_P0TAT0 I’m gonna work on a script that works better since this is really sloppy
local choosegui = --the screengui that contains the options
--make sure that both the pc and mobile screenguis are not enabled
--also make sure that all the ui elements that are for pc users are in the pc screengui and that all the mobile ui elements are in the mobile screengui
local pcgui = --the screengui you want to use for the pc users
local mobgui = --the screengui you want to use for the mobile users
local pc = --pc button
local mob = --mobile button
pc.MouseButton1Click:Connect(function()
choosegui.Enabled = false
wait(0.1)
pcgui.Enabled = true
end)
mob.MouseButton1Click:Connect(function()
choosegui.Enabled = false
wait(0.1)
mobgui.Enabled = true
end)
1 Like
So there are 3 StarterGuis in the ScreenGui?
1 for the ChooseGui, 1 for the PCGui, and 1 for the MobileGui.
You put the localscript in the choosegui.
Disable the mobilegui and the pcgui and keep the choosegui enabled.
1 Like
As in, click the mobgui and pcgui with Properties enabled, and uncheck the box labelled enabled?
Because that is how I see it, but it might be wrong.
1 Like
Yes you are right, that is how you disable them.
Would it be “PickModeGui” or “eee”?
Sorry about the weird names.
1 Like
It would be PickModeGui for you
I recommend putting those screenguis in one main screengui so there arent any problems.