Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this only work in studio?

Asked by 8 years ago

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?

0
Is the script a LocalScript? TheDeadlyPanther 2460 — 8y
0
yes bubbaman73 143 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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.

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 bubbaman73 143 — 8y
0
(when i press f9 it makes the volume go down) bubbaman73 143 — 8y
0
So, can you get the console up? If yes, did you see the error? Do you still need help? LetThereBeCode 360 — 8y
Ad

Answer this question