local PlayButton = -- Path to Button here
for _, v in pairs(game.Players.LocalPlayers.PlayerGui:GetChildren()) do
print(v.Name)
if v ~= PlayButton.Parent then -- Or the GUI the Play Button is located in
v.Enabled = false
end
PlayButton.MouseButton1Down:Connect(function()
print("Player Clicked!")
for _, v in pairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if v ~= PlayButton.Parent then
v.Enabled = true
else
v.Enabled = false
end)
Hold on, am testing in Studio.
local PlayButton = -- Path to Button here
for _, v in pairs(game.Players.LocalPlayers.PlayerGui:GetChildren()) do
print(v.Name)
if v ~= PlayButton.Parent then -- Or the GUI the Play Button is located in
v.Enabled = false
end
end
PlayButton.MouseButton1Down:Connect(function()
print("Player Clicked!")
for _, v in pairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if v ~= PlayButton.Parent then
v.Enabled = true
else
v.Enabled = false
end
end
end)
If this doesn’t work, you can always change the GUIs differently.
Okay, do this. Change all the GUIs except for the PlayButton’s GUI property of “Enabled” to false.
Now add this script under the PlayButton.
script.Parent.MouseButton1Down:Connect(function()
for _, v in pairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if v ~= script.Parent.Parent then
print(v.Name)
v.Enabled = true
else
print("PlayButton")
v.Enabled = false
end
end
end)
Screenguis or textbuttons disabled?
ScreenGui, it automatically disables all the children.
And I add that script under the playbuttons screengui or textbutton?
Add this script under the PlayButton (not the GUI, the text button.) Also make sure not to set the PlayButton GUI’s enabled property to false
Okay I disabled all the guis I dont want to be visible on the starting screen and put that script in a local script under the playbutton text button
Yep, try that. (text for filter)
when i click play the r to reset appears
script.Parent.MouseButton1Down:Connect(function()
local playergui = script.Parent.Parent.Parent
playergui["Donate 100 Robux"].Enabled = true
playergui["Donate 1000 Robux"].Enabled = true
playergui["robux 20"].Enabled = true
-- Add other GUIs here
script.Parent.Parent.Enabled = false
Okay, when I click the play button nothing happens and the other guis arent on the screen so we’re getting somewhere
Maybe replace PlayerGui with this:
local playergui = game.Players.LocalPlayer.PlayerGui
what do you mean replace playergui?