Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this only work in studio?

Im trying to make it so when a gui is clicked, the cam locks, the char anchors, and a gui appears. the camera only locks and thats it. it works fone in test solo though but not online

	local currentcam = workspace.CurrentCamera
local customizing = false
local char = game.Players.LocalPlayer.Character

script.Parent.MouseButton1Click:connect(function()
	if customizing == false then
		customizing = true
		currentcam.CameraType = "Scriptable"
		currentcam.CoordinateFrame = char.HumanoidRootPart.CFrame * CFrame.Angles(0, 3.1, 0) * CFrame.new(3, 2, 10)
		char.Torso.Anchored = true
		script.Parent.Parent.background.Visible = true
	elseif customizing == true then
		script.Parent.Parent.background.Visible = false
		customizing = false
		currentcam.CameraType = "Custom"
		char.Torso.Anchored = false
	end
end)

EDIT: It seems to stop after i turn it to scriptable camera, so what did i do wrong when setting the frame?

2 comments

0

Is the script a LocalScript?

0

yes

1 answer

✓ Accepted answer

Did you get any errors? If yes, you should provide them. If you don't know how to check errors in Play mode, press F9 while playing to bring up the developer console.

3 comments

0

uhg im sorry i would have saw the error sooner if i could have gotten to the dev console ingame. roblox makes us press f9 now

0

(when i press f9 it makes the volume go down)

0

So, can you get the console up? If yes, did you see the error? Do you still need help?

This discussion is preserved as it was. New answers, comments, and votes are closed.