Can I please have some help with this script?
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.ScreenGui.Visible = false end) wait(0) game.StarterGui.ScreenGui.Frame.Visible = true
It is meant to say that if I click a TextButton another GUI will appear.
First of all your code is repetitive and is a bad practice.
Add the local script in the frame. Make sure the frame is not visible in the first place.
Then write this
script.Parent.MouseButton1Click:Connect(function() script.Parent.Visible = true wait(3) script.Parent.Visible = false
This should do it:
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.ScreenGui.Visible = false game.StarterGui.ScreenGui.Frame.Visible = true end)
But if that does not work, try adding wait
:
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.ScreenGui.Visible = false wait(0) game.StarterGui.ScreenGui.Frame.Visible = true end)
If none of these above work, try using the other answers or contact Roblox.
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.ScreenGui.Visible = false game.StarterGui.ScreenGui.Frame.Visible = true end)
Try this
Here, check if it works now.
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.ScreenGui.Visible = false game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = true end)
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ScreenGui").ScreenGui.Visible = false game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ScreenGui").Frame.Visible = true end)