You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to have a nice main menu effect, where after you click the play button, a frame covers the screen, and fades out, leaving the player in the game. Also, there is a camera part that is facing towards the city. The main menu screen is partly transparent so you can see the city which is blurred. It was working before, but after I added the scripts for gamepasses, it stopped working and I cannot figure out why.
- What is the issue? Include screenshots / videos if possible!
First off, the camera doesn’t work. Once you enter the game, you are already inside the city. Secondly, when you click the play button, the fade effect is not popping up. Lastly, the play button doesn’t work and nothing happens even though the fade effect should pop up and all other gui in the main menu group disappears.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried simple debugging, but I’m no Lua coder. I specialize in graphics. Most of the script is based off of tutorials and modifying them.
Here is my code:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local blur = game.Lighting.Blur
local PlayButton = script.Parent.Buttons.PlayButton
local MenuBackround = script.Parent.MenuBackground
local gui = script.Parent
local otherGui = script.Parent.Parent.admin.TextButton
blur.Size = 10
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame
PlayButton.MouseEnter:Connect(function()
PlayButton:TweenSize(UDim2.new(0.156, 0, 0.12, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
end)
PlayButton.MouseLeave:Connect(function()
PlayButton:TweenSize(UDim2.new(0.156, 0, 0.104, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
end)
PlayButton.MouseButton1Click:Connect(function()
gui.MenuBackground.Visible = false
gui.Buttons.PlayButton.Visible = false
gui.Desc.Visible = false
otherGui.Visible = true
local t = game.TweenService:Create(gui.Fade, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {["BackgroundTransparency"] = 0})
t:Play()
t.Completed:wait()
-- then continue.
wait(3)
blur.Size = 0
Camera.CameraType = Enum.CameraType.Custom
t = game.TweenService:Create(gui.Fade, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {["BackgroundTransparency"] = 1})
t:Play()
t.Completed:wait()
--game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
gui:Destroy()
--otherGui.visible = true
end)
--Credits.MouseButton1Click:Connect(function()
-- gui.Credits.Visible = true
-- gui.Credits.BackButton.MouseButton1Click:Connect(function()
-- gui.Credits.Visible = false
-- end)
--end)
---Updates.MouseButton1Click:Connect(function()
-- gui.Updates.Visible = true
-- gui.Updates.BackButton.MouseButton1Click:Connect(function()
-- gui.Updates.Visible = false
--- end)
--end)
Sorry if it is messy! Thank you!!