I've got SurfaceGUI on part and inside that part there are textbuttons, i can't think of script that will solve this problem. there are 3 main buttons (Semi Final 1, Semi Final 2 and Grand Final). i want to make something like this: when i press Semi Final 1 textbuttons will appear (not all, ones i want), when i press Semi Final 2 - other textbuttons will appear etc.
#how to make that when i press textButton other textButtons will appear?
1 messages · Page 1 of 1 (latest)
would smth like this work (customiseable)
local surfaceGui = script.Parent
-- References to main buttons
local semiFinal1Button = surfaceGui.MainButtons.SemiFinal1Button
local semiFinal2Button = surfaceGui.MainButtons.SemiFinal2Button
local grandFinalButton = surfaceGui.MainButtons.GrandFinalButton
-- References to frames with respective buttons
local semiFinal1Frame = surfaceGui.SemiFinal1Frame
local semiFinal2Frame = surfaceGui.SemiFinal2Frame
local grandFinalFrame = surfaceGui.GrandFinalFrame
-- Helper function to hide all frames
local function hideAllFrames()
semiFinal1Frame.Visible = false
semiFinal2Frame.Visible = false
grandFinalFrame.Visible = false
end
-- Button connections
semiFinal1Button.MouseButton1Click:Connect(function()
hideAllFrames()
semiFinal1Frame.Visible = true
end)
semiFinal2Button.MouseButton1Click:Connect(function()
hideAllFrames()
semiFinal2Frame.Visible = true
end)
grandFinalButton.MouseButton1Click:Connect(function()
hideAllFrames()
grandFinalFrame.Visible = true
end)
-- Optionally hide all frames on start
hideAllFrames()
srry im not that good at scripting also new
there might b like specific names to change bc idk if i got the names right
but do you know how to change color when mouse is at the text button in ScrollingGUI
you mean like hovering over it?
script has to be where?
yh
lol sry
** You are now Level 1! **
local surfaceGui = script.Parent in the surface gui
change the names in the scipt? ie. grandFinalFrame like u might not have something called that>
What does main button mean here?
Nvm
@jovial pier what is frame here?
SemiFinal1Frame
wdym
I mean I don’t have anything like SemiFinal1Frame or semifinal2frame, but it doesn’t red it, so what is that for?
local semiFinal1Frame = surfaceGui.SemiFinal1Frame local semiFinal2Frame = surfaceGui.SemiFinal2Frame local grandFinalFrame = surfaceGui.GrandFinalFrame this part
those are the variables for the frames. Idk why it doesnt error for those but if you change the last bit after the surface GUi. to the name of ur actual buttons that are inside the surfacegui
and then under each press make the ones you want visible, visible semiFinal1Button.MouseButton1Click:Connect(function()
hideAllFrames()
semiFinal1Frame.Visible = true
end)
change semiFinal1Frame.Visible = true
`local surfaceGui = script.Parent
-- References to main buttons
local semiFinal1Button = surfaceGui.SemiFinal1Button
local semiFinal2Button = surfaceGui.SemiFinal2Button
local grandFinalButton = surfaceGui.GrandFinalButton
-- References to frames with respective buttons
local semiFinal1Frame = surfaceGui.SemiFinal1Frame
local semiFinal2Frame = surfaceGui.SemiFinal2Frame
local grandFinalFrame = surfaceGui.GrandFinalFrame
-- Helper function to hide all frames
local function hideAllFrames()
semiFinal1Frame.Visible = false
semiFinal2Frame.Visible = false
grandFinalFrame.Visible = false
end
-- Button connections
semiFinal1Button.MouseButton1Click:Connect(function()
hideAllFrames()
semiFinal1Frame.Visible = true
end)
semiFinal2Button.MouseButton1Click:Connect(function()
hideAllFrames()
semiFinal2Frame.Visible = true
end)
grandFinalButton.MouseButton1Click:Connect(function()
hideAllFrames()
grandFinalFrame.Visible = true
end)
-- Optionally hide all frames on start
hideAllFrames()` its like this rn. all i changed was button names in script it was main button.SemiFinal1 Button and i deleted MainButtons
ok
send me a pic of the layout of ur surface gui
like whats inside of it
in the exploreer
When i press semi final 1 i want visible to be: Albania, Azerbaijan, Belgium, Croatia, Cyprus, Estonia, Iceland, Italy, Netherlands.
Semi Final 2 (semi final 1 buttons will disappear) - Norway, Poland, Portugal, San Marino, Slovenia, Spain, Sweden, Switzerland, Ukraine
Grand final - “Coming Soon…”
under semiFinal1Button.MouseButton1Click:Connect(function() write surfaceGui.Albania.Visible = true surfaceGui.Belgium.Visible = true etc and write the others in semi final2 and grand final to false e.g. surfaceGui.Norway.Visible = false inside of semiFinal1Button.MouseButton1Click:Connect(function() but under semiFinal2Button.MouseButton1Click:Connect(function() do the opposite w grand final also not visible. and grand final turn everything to visible false apart from coming soon
** You are now Level 2! **
let me tryy
im a fast writer
but thats the way id do it lol
hi
hi
let me try to help
tyy
yeah im kinda new to developing ur prolly better xd
tyy
its like my dream to make Eurovision game lol where ppl can perform
also events
@jovial pier surfaceGui.Albania.Visible = true DO I have to write it under hideAllFrames()?
textbuttons:Albania, Azerbaijan, Belgium, Croatia, Cyprus, Estonia, Iceland, Italy, Netherlands
this is their names
i dont think it matters
do u need board photo too, for better understanding?
ok wait
i dont think the frames are needed tbf
well i literally suck at scripting 😭
and then just turn invisible on or off
yeah thats what i thought
so u dont have to get EVERY text button
I haven't looked into loops like this b4
yes, children are textButtons
so u mean like split into 3 folders find children that are textbuttons and make them visible/non-visible?
thats actually smart 😭
so what u do is for ,_ textbuttons in pairs(scrollingframe:GetChildren()) do
if textbuttons:IsA("TextButton") then
textbuttons.Visible = false
end
this will
make every textbutton inside scrolling frame invisible
and
if u want as example australia to be visible
yeah so if u split it into 3 folders one for each then you need each to have a loop to make all children visible/non-visible on press
u do under the textbutton.Visible = false
if textbuttons.Name == "Australia"
then textbuttons.Visible = true
end
wait let me do
makes sense
not lying its literally first thing i understood in lua (not mentioning basic ones, like if, print..)
This is like watching 2 babies talking to each other.
who bc theres 3 of us
Minus the guy who knows what he's doing.
so yggdrasil
@manic condor he knows scripting too
im the only one here who has no idea
who went?
He used ai.
Yggdrasil said 'let me do it' so hes making it
tyy
yggdrasil is smarter than us fair
i did say use ai bc we didnt have anyone smarter than us until yggdrasil came
never did but okay
anyway
this is how it should look like
for example
i think he was talking about me
bc i said js ask ai as a last resort bc we didnt know what to do
well idk
I missunderstand then
if yes sorry
missunderstood?
idk
Im not english
Not you.
lol
ok ima send
this is just an example of what I mean
and also, u need a UiLayout inside ur scrollingFrame
I think you already do
the "Button" is ur semi1final
or idk semi2
uilistlayout yes?
thats exactly what i needed
the Button is "Semi1final"
thank you so much
and when u press it
i just have to change names and things for semi final 2 and grand final?
everything dissapears except australia
yes
u just have to add
and make 2 other functions
THANK U SO SO MUCH
since this function is for smi1final only
js send me ur screengui smh
so I can make it for u quick
aww really?
the rest u can make urself cuz then it will be just copy and paste and just rewrite names
ye
its easy lol
thats what i did
its doing for me
ok
it worke
let me do now
ok what ui's u want to be visible for semi1
and for semi2
and grand
When i press semi final 1 i want visible to be: Albania, Azerbaijan, Belgium, Croatia, Cyprus, Estonia, Iceland, Italy, Netherlands.
Semi Final 2 (semi final 1 buttons will disappear) - Norway, Poland, Portugal, San Marino, Slovenia, Spain, Sweden, Switzerland, Ukraine
Grand final - “Coming Soon…” (coming soon bc i will add countries when there would be qualifying countries)
tyy
bruh
no
wait
local Gui = workspace:WaitForChild("EurovisionBoard").EurovisionGUI
local ScrollingFrame = Gui.ScrollingFrame
local ComingSoon = Gui["Coming Soon"]
--Buttons
local SemiFinal1Button = Gui.SemiFinal1Button
local SemiFinal2Button = Gui.SemiFinal2Button
local GrandFinalButton = Gui.GrandFinalButton
-- Functions
-- here you put the functions for each main button like Semi1 etc.. if u want to add any new main button put it in buttons and then do another function with the name of the button like im doing it here
local function SemiFinal1Pressed()
ComingSoon.Visible = false
for _, TextButtons in pairs(ScrollingFrame:GetChildren()) do
local VisibleCountries = TextButtons.Name == "Albania" or TextButtons.Name == "Azerbaijan" or TextButtons.Name == "Belgium" or TextButtons.Name == "Croatia" or TextButtons.Name == "Cyprus" or TextButtons.Name == "Estonia" or TextButtons.Name == "Iceland" or TextButtons.Name == "Italy" or TextButtons.Name == "Netherlands"
if TextButtons:IsA("TextButton") then
TextButtons.Visible = false
if VisibleCountries then
TextButtons.Visible = true
end
end
end
end
local function SemiFinal2Pressed()
ComingSoon.Visible = false
for _, TextButtons in pairs(ScrollingFrame:GetChildren()) do
local VisibleCountries = TextButtons.Name == "Norway" or TextButtons.Name == "Poland" or TextButtons.Name == "Portugal" or TextButtons.Name == "San Marino" or TextButtons.Name == "Slovenia" or TextButtons.Name == "Spain" or TextButtons.Name == "Sweden" or TextButtons.Name == "Switzerland" or TextButtons.Name == "Ukraine"
if TextButtons:IsA("TextButton") then
TextButtons.Visible = false
if VisibleCountries then
TextButtons.Visible = true
end
end
end
end
local function GrandFinalPressed()
for _, TextButtons in pairs(ScrollingFrame:GetChildren()) do
if TextButtons:IsA("TextButton") then
TextButtons.Visible = false
end
end
ComingSoon.Visible = true
end
-- Use the function when button is pressed
SemiFinal1Button.MouseButton1Click:Connect(SemiFinal1Pressed)
SemiFinal2Button.MouseButton1Click:Connect(SemiFinal2Pressed)
GrandFinalButton.MouseButton1Click:Connect(GrandFinalPressed)```
and here is the new one
wait
put the script inside startergui
tysm
does it work?
Checking
and put in script the euro thing parent
Oh what?
It works is it still necessary?
@feral mantle sorry for bothering but i have 1 more questions, i mean how do i add more countries when there's no space left?
** You are now Level 10! **
im happy you got it working !
** You are now Level 3! **
sorry I was gone
well thats not a problem
u always have space
np
i mean i cant scroll it
and make them visible in the script
and thats it
yes
u have to add the countries
the scrolling frame has infinite space
its js bc of the uilistlayout
it shows only the uis that are visible
and makes a perfect fit
let me how
i want to do in semi final 2, and in semi final 1, there is already semi final 1 songs
i did it without scale
i just duplicated 1 textbutton changed names and just added it on Semi Final 2
@feral mantle i have uploaded audio's how to make that when i press that country name in Semi Final 1 song will start playing?
why this doesnt work?
SORRY I KNOW IM MESSAGING TOO MUCH
it doesnt work bc uh
the script is inside workspace
right
and its a local script
thats wjy
why
it just doesnt
so u gotta do it in the main script
the main script is the script I just did for you
I mean you can make a sound handler with module script
Script is inside surface gui or scrolling gui i don’t remember
startergui
Flame this guy for being a spoonfeeder
uhm