So I made a main menu gui, with maps. The main menu is using camera manipulation. I made it that when you click on a map you want to go to out of the main menu, the camera manipulation is turned off (btw this is an obstacle course game), the problem is when you die instead of going to a checkpoint, the Camera manipulation turns back on again, and you lose all of your progress on the obstacle course. Any way to only turn on the cam manipulation when you finished completing the course?
local cam = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local char = plr.Character
script.Parent.MouseButton1Click:Connect(function()
print("Tp to neon revelation")
char.HumanoidRootPart.CFrame = workspace.NeonRevelationtp.CFrame
game.StarterPlayer.StarterCharacterScripts.camera.Disabled = true
cam.CameraType = "Custom"
end)
Oh, and here is the camera script.
wait()
print("cam has started running.")
local cam = workspace.CurrentCamera
local FocusPart = game.Workspace.MainMenuCam
repeat cam.CameraType = Enum.CameraType.Scriptable until cam.CameraType == Enum.CameraType.Scriptable
cam.CFrame = FocusPart.CFrame
you can just add a BoolValue to the character’s player, and use an if statement so that when you want to turn it on, run the camera manipulation script.
if player.RunCameraManipulation.Value == false then return end
--your camera script here
Also, how would I get player. since game.Players.PlayerAdded:Connect(function(player)
for some reason still doesn’t get it and under lines player in
player.RunCameramanipulationi = true/false
local player = game.Players.LocalPlayer
if player.RunCameraManipulation.Value == false then return end
wait()
print("cam has started running.")
local cam = workspace.CurrentCamera
local FocusPart = game.Workspace.MainMenuCam
repeat cam.CameraType = Enum.CameraType.Scriptable until cam.CameraType == Enum.CameraType.Scriptable
cam.CFrame = FocusPart.CFrame
It tells me in output that RunCameraManipulation isn’t a valid member of player.
Since I put this in my gui script, the player was = game.Players.LocalPlayer. Maybe that is making the script not work, but idk.
So, in the game there is an obstacle course, and I’m tring to make it that when you reach the end and touch a part it enables the cam and main menu. I set the boolvalue to true, and doesn’t work. Any help?
local Player = game.Players.LocalPlayer
local playergui = Player.PlayerGui
local MainMenu = playergui:WaitForChild("MainMenu")
local MainMenuTouch = script.Parent
MainMenuTouch.Touched:Connect(function()
MainMenu.Enabled = true
Player.RunCameraManipulation.Value = true
end)