Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get rid of my menu GUI frame when the player clicks the play button?

So, I made a menu for my game when a player loads in they'll click the Play button to return their camera to their character, but the GUI won't go away. I have the scripts

Start GUI CameraGui Frame Camera PlayBtn Script.

The Camera Script is

local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Camera = workspace.CurrentCamera

local PlayButton = script.Parent.PlayBtn

repeat wait() Camera.CameraType = Enum.CameraType.Scriptable until Camera.CameraType == Enum.CameraType.Scriptable Camera.CFrame = workspace.CameraFocus.CFrame

PlayButton.MouseButton1Click:Connect(function() Camera.CameraType = Enum.CameraType.Custom PlayButton:Destroy() end)

The PlayBtn Script is

local player = game:GetService("Players") local frame = game.StarterGui.CameraGui.Frame local PlayBTN = script.Parent

script.Parent.MouseButton1Click:Connect(function() frame.Visible = false end)

I've watched many tutorials on this, but the Gui is still there and won't go away. I've tried mulitple things and they don't seem to work. No clue what I'm doing wrong, I'm very new scripting and could use some help with this!

1 answer

✓ Accepted answer

Instead of going from the Player Gui you can go directly from the Starter Gui and destroying isn't the best for GUIs because if it was ran on a SS script it would function when ANY player pressed the button

This discussion is preserved as it was. New answers, comments, and votes are closed.