Can you help me fix this script?

WAIT! THAT SCRIPT WON’T WORK. Try this updated one.


script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Next.Visible == false then
		script.Parent.Next.Visible = true
	else
		if script.Parent.Next.Visible == true then
			workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable 
			workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character
			script.Parent.Next.Visible = false
		end
	end
end)

Ill double check now, but im positive there isn’t.

Thanks ill try this one, and ill let you know if it works.

Sadly, this script didn’t work either.

What happen? Did the camera move? Did it error?

I got the output error again “ActivateCameraController did not select a module”.

“ActivateCameraController did not select a module” - Help and Feedback / Scripting Support - DevForum | Roblox

1 Like

Try this:


script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Next.Visible == false then
		script.Parent.Next.Visible = true
	else
		if script.Parent.Next.Visible == true then
			workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable 
			workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			script.Parent.Next.Visible = false
		end
	end
end)

Thanks ill try this one, and ill let you know if it works.

Instead of using an else and then later using an if, I would use an elseif. Other than that the code looks decent to me, but I am tired and probably just haven’t been able to notice the mistakes yet.

I think this will work, if it does then mark this as a solution.

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Next.Visible == false then
		script.Parent.Next.Visible = true
	elseif script.Parent.Next.Visible == true then
		wait()
		game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
		script.Parent.Next.Visible = false
	end
end)
2 Likes

Yes, this works thanks for that!

1 Like