Heyo! So i'm making a script that when u click on "Play" u teleport and the menu disappears, now i got the teleport part working.. But the menu wont go away when u click on it. I have tried to figure it out last night and tried every possible situation i knew..
Here is the script please change it so it works, or any tips and improvements would be helpful. Thank you for reading, good luck.
local text = script.Parent.TextButton local size = 50 local blur = game.Lighting.Blur local credits = script.Parent.credits local birthday = script.Parent.birthday local CutBlur = game.Lighting.CutBlur wait(38) text.Visible = true credits.Visible = true birthday.Visible = true blur.Enabled = true wait(.1) blur.Size = 1 wait(.1) blur.Size = 2 wait(.1) blur.Size = 3 wait(.1) blur.Size = 4 wait(.1) blur.Size = 5 wait(.1) blur.Size = 6 wait(.1) blur.Size = 7 wait(.1) blur.Size = 8 wait(.1) blur.Size = 9 wait(.1) blur.Size = 10 text.MouseButtonClick:connect(function() CutBlur.Enabled = false game.StarterGui.TPGUI.Enabled = false blur.Size = 10 wait(.1) blur.Size = 9 wait(.1) blur.Size = 8 wait(.1) blur.Size = 7 wait(.1) blur.Size = 6 wait(.1) blur.Size = 5 wait(.1) blur.Size = 4 wait(.1) blur.Size = 3 wait(.1) blur.Size = 2 wait(.1) blur.Size = 1 wait(.1) blur.Enabled = false print("Menu succefull") end)
Hello, your script is not working because of THIS:
This is what you have to have:
text.MouseButton1Click:Connect(function()
This is what you had:
text.mousebuttonclick:connect(function()
Hope it helps! Just woke up, so sorry if does not work.
From what I can see, the waits you have seem to be yielding the script. So if I were you I'd close them in a function;
local text = script.Parent.TextButton local size = 50 local blur = game.Lighting.Blur local credits = script.Parent.credits local birthday = script.Parent.birthday local CutBlur = game.Lighting.CutBlur local wrap = coroutine.wrap(function() wait(38) text.Visible = true credits.Visible = true birthday.Visible = true blur.Enabled = true wait(.1) blur.Size = 1 wait(.1) blur.Size = 2 wait(.1) blur.Size = 3 wait(.1) blur.Size = 4 wait(.1) blur.Size = 5 wait(.1) blur.Size = 6 wait(.1) blur.Size = 7 wait(.1) blur.Size = 8 wait(.1) blur.Size = 9 wait(.1) blur.Size = 10 end)() text.MouseButtonClick:connect(function() CutBlur.Enabled = false game.StarterGui.TPGUI.Enabled = false blur.Size = 10 wait(.1) blur.Size = 9 wait(.1) blur.Size = 8 wait(.1) blur.Size = 7 wait(.1) blur.Size = 6 wait(.1) blur.Size = 5 wait(.1) blur.Size = 4 wait(.1) blur.Size = 3 wait(.1) blur.Size = 2 wait(.1) blur.Size = 1 wait(.1) blur.Enabled = false print("Menu succefull") end) wrap()
I have just woken up so I apologize if that didn't work!
The reason this code is not working is because on line 37 you are disabling the gui in the StarterGui. Every time your character loads in, everything in the starterGui is replicated to the player Gui. So in order to fix this, line 37 would look like this:
game.Players.LocalPlayer:WaitForChild("PlayerGui").TPGUI.Enabled = false
So this code would get the local player in which the script in is and go to THEIR playerGui and disable it.
Whenever you are dealing with guis, never to into starterGui
I hope this helps!
(P.S. when you are blurring the gui, instead of making long lines of code just use a for loop):
--Blur is going up for i = 1, 10 do blur.Size = i wait(.1) end --For going down for i = 1, 10, -1 do blur.Size = i wait(.1) end