can someone fix this script and make it so after I click the Play button, it disappears. I want the play button to disappear and the settings button to stay, if that makes sense.
local SettingsEnabled = true
local CreditsEnabled = false
local DayClockTime = 14
local NightClockTime = 18
------------------------------------ Settings
local Player = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")
local Char = Player.Character
local Camera = game.Workspace.CurrentCamera
local MenuCam = game.Workspace:WaitForChild("MenuCam")
local Process = false
local GameStarted = false
wait(game:IsLoaded())
MenuCam.Transparency = 1
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = MenuCam.CFrame
local BlurEffect = Instance.new("BlurEffect")
BlurEffect.Size = 0
BlurEffect.Parent = game.Lighting
local Black = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{ Transparency = 0 })
local UnBlack = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{ Transparency = 1 })
local Blur = tweenService:Create(BlurEffect, TweenInfo.new(2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{ Size = 20 })
local UnBlur = tweenService:Create(BlurEffect, TweenInfo.new(1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{ Size = 0 })
if not SettingsEnabled then
script.Parent.SettingsButton.Visible = false
end
if not CreditsEnabled then
script.Parent.CreditsButton.Visible = false
else
local textLabel = script.Parent:WaitForChild("CreditsFrame"):WaitForChild("Frame"):FindFirstChild("TextLabel")
if textLabel and textLabel.Text == "Scripter -" then
script.Parent.CreditsFrame.Frame.TextLabel.Text = "Scripter - " .. [Player.Name](https://Player.Name)
end
end
script.Parent:WaitForChild("GameMusic").Playing = true
local function toggleSettingsFrame()
if Process then return end
Process = true
local settingsFrame = script.Parent.SettingsFrame
local playButton = script.Parent.PlayButton
local settingsButton = script.Parent.SettingsButton
local creditsButton = script.Parent.CreditsButton
if settingsFrame.Position == [UDim2.new](https://UDim2.new)(0.5, 0, -0.4, 0) then
settingsFrame:TweenPosition([UDim2.new](https://UDim2.new)(0.5, 0, 0.5, 0), "Out", "Quad", 1)
playButton:TweenPosition([UDim2.new](https://UDim2.new)(-0.3, 0, 0.353, 0), "Out", "Quad", 0.5)
settingsButton:TweenPosition([UDim2.new](https://UDim2.new)(-0.3, 0, 0.508, 0), "Out", "Quad", 0.5)
creditsButton:TweenPosition([UDim2.new](https://UDim2.new)(-0.3, 0, 0.636, 0), "Out", "Quad", 0.5)
Blur:Play()
else
settingsFrame:TweenPosition([UDim2.new](https://UDim2.new)(0.5, 0, -0.4, 0), "Out", "Quad", 1)
playButton:TweenPosition([UDim2.new](https://UDim2.new)(0.005, 0, 0.353, 0), "Out", "Quad", 0.5)
settingsButton:TweenPosition([UDim2.new](https://UDim2.new)(0.005, 0, 0.508, 0), "Out", "Quad", 0.5)
creditsButton:TweenPosition([UDim2.new](https://UDim2.new)(0.005, 0, 0.636, 0), "Out", "Quad", 0.5)
UnBlur:Play()
end
wait(2)
Process = false
end
script.Parent.SettingsButton.MouseButton1Click:Connect(toggleSettingsFrame)
script.Parent.CreditsButton.MouseButton1Click:Connect(toggleSettingsFrame)
script.Parent.CreditsFrame.ExitButton.MouseButton1Click:Connect(toggleSettingsFrame)
script.Parent.SettingsFrame.ExitButton.MouseButton1Click:Connect(toggleSettingsFrame)
if script.Parent.SettingsFrame.Frame:FindFirstChild("Shadows") then
script.Parent.SettingsFrame.Frame.Shadows.MouseButton1Click:Connect(function()
local shadowsText = script.Parent.SettingsFrame.Frame.Shadows.Text
if shadowsText == "X" then
script.Parent.SettingsFrame.Frame.Shadows.Text = ""
game.Lighting.GlobalShadows = false
else
script.Parent.SettingsFrame.Frame.Shadows.Text = "X"
game.Lighting.GlobalShadows = true
end
end)
end
if script.Parent.SettingsFrame.Frame:FindFirstChild("Time") then
script.Parent.SettingsFrame.Frame.Time.MouseButton1Click:Connect(function()
local timeText = script.Parent.SettingsFrame.Frame.Time.Text
if timeText == "DAY" then
script.Parent.SettingsFrame.Frame.Time.Text = "NIGHT"
game.Lighting.ClockTime = NightClockTime
else
script.Parent.SettingsFrame.Frame.Time.Text = "DAY"
game.Lighting.ClockTime = DayClockTime
end
end)
end
if script.Parent.SettingsFrame.Frame:FindFirstChild("Music") then
script.Parent.SettingsFrame.Frame.Music.MouseButton1Click:Connect(function()
local musicText = script.Parent.SettingsFrame.Frame.Music.Text
if musicText == "X" then
script.Parent.SettingsFrame.Frame.Music.Text = ""
script.Parent.GameMusic.Playing = false
else
script.Parent.SettingsFrame.Frame.Music.Text = "X"
script.Parent.GameMusic.Playing = true
end
end)
end
script.Parent.PlayButton.MouseButton1Click:Connect(function()
if Process or GameStarted then return end
Process = true
Black:Play()
wait(3)
Camera.CameraType = Enum.CameraType.Custom
UnBlack:Play()
Process = false
startGame()
script.Parent.PlayButton:Destroy()
end)
-- Function to handle game start
local function startGame()
\-- Add your game start logic here
GameStarted = true
if SettingsEnabled then
script.Parent.SettingsButton.Visible = true
end
script.Parent.PlayButton.Visible = false
[script.Parent.PlayButton.Active](https://script.Parent.PlayButton.Active) = false
script.Parent.PlayButton.Selectable = false
end