I am working in one Camera menu it works. But I want to make one one keybind for back to that menu (ResetOnSpawn is off) It works too but I cant change the camera again. And in Camera menu I destroy on line 24 (turn player camera to normal)
--CameraScript (Inside StarterGui)
local player = game.Players.LocalPlayer
local character = player.CharacterAdded
local Mouse = player:GetMouse()
local camera = game.Workspace.CurrentCamera
local defualtCframe = camera.CFrame
local view = 150
local blur = game.Lighting.Blur
blur.Size = 10
function updateCamera()
camera.CFrame = game.Workspace.SkyBox.MenuCamera.CFrame
end
game:GetService("RunService").RenderStepped:Connect(updateCamera)
script.Parent.MouseButton1Click:Connect(function()
wait(0.2)
blur.Size = 0
camera.CameraType = Enum.CameraType.Custom
script.Parent.Parent.Parent.Parent.MenuGui.Enabled = false
script.Parent.Parent.Parent.Parent.MenuGui.ResetOnSpawn = false
script.Parent:Destroy()
end)
--Back to menu script by one keybind (script inside StarterPlayersScripts)
function onKeyPress(actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
for _, Player in pairs(game.Players:GetPlayers()) do
Player.PlayerGui.BackToMenuGUI.TimeGui.TimerLabel.Cooldown.Value = 10
wait(0.8)
Player.PlayerGui.BackToMenuGUI.Enabled = true
wait(10)
Player.PlayerGui.BackToMenuGUI.Enabled = false
Player.PlayerGui.MenuGui.ResetOnSpawn = true
Player.Character.HumanoidRootPart.CFrame = CFrame.new(-5777.103, 1312.392, 372.755)
end
end
end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.F2)