How do I get the gui to disappear?

Hi Developers!
I am VERY new to scripting and today I made a Play screen and whenever I click on one button the others dont disappear. What do I do?

Can we see the code that you are using please

That is on each of the buttons

Oh, so are you meant to click on each to make them go away individually, or do you click on one and all others go away?

If so, then would you please send an image of the hierarchy

All of the buttons go away

would this work?

local player = game:GetService('Players').LocalPlayer
local character = player.Character
local gui = script.Parent.Parent

button.MouseButton1Click:Connect(function()
character:WaitForChild('Humanoid').Walkspeed = 16
buttoon.Visible = false
blur.Size = 30
wait(.3)
blur.Size = 27
wait(.3)
blur.Size = 24
wait(.3)
blur.Size = 18
wait(.3)
blur.Size = 15
wait(.3)
blur.Size = 12
wait(.3)
blur.Size = 9
wait(.3)
blur.Size = 6
wait(.3)
blur.Size = 3
wait(.3)
blur.Enabled = false
wait(.3)
gui.Enabled = false
end)

image
The open thing is for something else

Ooo thanks let me try this


Also I would reccomend tweening blur,

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(blur, tweenInfo, 0)
tween:Play()

oops wrong video


try this

local button = script.Parent
local blur = game.Lighting.Blue
game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 0
blur.Enabled = true
button.Visible = true

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)

button.MouseButton1Click:Connect(function()
	game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 16
	button.Visible = false
	button.Parent["Train Driver"].Visible = false
	button.Parent["Civilian"].Visible = false
	local tween = TweenService:Create(blur, tweenInfo, 0)
	tween:Play()
end)

If there are any error messages please tell me as I wrote this in dev forum :sweat_smile:

I just tested that It didnt work, I made one just like his and used that and it didnt work

rename that to Blur he made a spelling mistake // this should fix that

local button = script.Parent
local blur = game.Lighting.Blur
game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 0
blur.Enabled = true
button.Visible = true

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)

button.MouseButton1Click:Connect(function()
	game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 16
	button.Visible = false
	button.Parent["Train Driver"].Visible = false
	button.Parent["Civilian"].Visible = false
	local tween = TweenService:Create(blur, tweenInfo, 0)
	tween:Play()
end)

Now it has just gone back to how it was

Alright I fixed my typo and improved your code a little:

local button = script.Parent
local blur = game:GetService("Lighting").Blur
game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 0
blur.Enabled = true
button.Visible = true

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)

button.MouseButton1Click:Connect(function()
	game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 16
	button.Visible = false
	button.Parent["Train Driver"].Visible = false
	button.Parent["Civilian"].Visible = false
	local tween = TweenService:Create(blur, tweenInfo, {Size = 0})
	tween:Play()
end)

Make sure to always use :GetService() and :WaitForChild() as you had issues of things not loading in