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

How to fix this? It wont change cameraSubject

Asked by 4 years ago
local Camera = game.Workspace.CurrentCamera

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(msg)
        if string.sub(msg,1,10) == Prefix.."spectate " then
            Camera.CameraSubject = game.Players:FindFirstChild(string.sub(msg,11)).Character.Humanoid
        end
    end)
end)

2 answers

Log in to vote
0
Answered by 4 years ago

try

Camera.CameraSubject = Enum.CameraSubject. --type what you want the camera subject to be after the . 
0
if this does not work then on line 1 put local Camera = workspace.CurrentCamera MarcTheRubixQb 153 — 4y
0
might be same thing but worth a try roblox studio is like the buggiest thing in the world MarcTheRubixQb 153 — 4y
0
When i try to put enum.camerasubject it doesnt appear Philipceo90 18 — 4y
0
what doesn't appear? Please be more specific MarcTheRubixQb 153 — 4y
View all comments (3 more)
0
CameraSubject Is not a enum Philipceo90 18 — 4y
0
dam your right... But i just tried out your script and it says in the output "index nil with Character" MarcTheRubixQb 153 — 4y
0
never mind i fixed that sorry i dont know MarcTheRubixQb 153 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Cameras can be changed by a local script, NOT a server script. So, if you want to change the CameraSubject, you have to do it in a local script.

Also, you can change the CameraSubject to a player's character model instead of a player's humanoid. Like this:

local cam = workspace.CurrentCamera
cam.CameraSubject = game.Players.LocalPlayer.Character

Answer this question