i have a main menu with a camera that shows a group of people for with a GUI that says "play". but for some reason its works occasionally. and most of the time it camera is set to the player with the GUI still there making it useless. the GUI works perfectly. but with that error, it's useless
my script
local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.CAM2.CFrame
script.Parent.Enabled = true
script.Parent.Background1.Visible = true
script.Parent.Strike:Play()
script.Parent.Parent.HealthGui.Enabled = false
can someone tell me whats wrong?

3 comments
Haiiiii! On line four, you have an oopsie -.- See here for more information https://devforum.roblox.com/t/avoiding-wait-and-why/244015
Just to let you know, there's a simple fix. Replace line four with "Player.CharacterAdded:Wait()"
thank you