Hello, I was coding my menu following a tutorial and so far everything was working fine, but at the time of the test, I noticed that you cannot exit the menu, when you press "play" , the music stops well but the menu and the blur do not disappear... Thanks in advance ! ps: if someone could also tell me how to put another gui after the menu is gone? that would be nice :)

Script :

local player = game.Players.LocalPlayer
local character = player.CharacterAdded
local Mouse = player:GetMouse()
local camera = game.Workspace.CurrentCamera

local defaultCframe = camera.CFrame
local view = 150
local blur = game.Lighting.Blur

blur.Size = 20

print "Start menu ok"

function updateCamera()
	camera.CFrame = game.Workspace.MenuCamera.CFrame
end
print "Update camera ok"

game:GetService("RunService").RenderStepped:Connect(updateCamera)

print "GetService ok"

script.Parent.Frame.Play.MouseButton1Click:Connect(function()
	wait(0.2)
	game.Workspace.MenuMusic:Stop()
	camera.CameraType = Enum.CameraType.Custom
	script:Destroy()
	script.Parent.Frame:Destroy()
	script:Destroy()
	
end)

3 comments

0

Can't read this, put it into a code block.

0

I edited the script into code block :)

0

I think its because you destroyed the script before destroying the frame. When the script it destroyed, the rest of the code might not run.