Help making a “:stage” command

So I am trying to make a :stage command but this script isn’t working.

local Camera
local CameraPart = game.Workspace.Stage.CameraPart

game.PlayersPlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)

end)

   player.Chatted:Connect(function(Message)
          if Message = “:stage” then
                 Camera.CameraType = Enum.CameraType.Scriptable
                  Camera.CameraSubject = CameraPart
            end
    end)

end)

So I need help fixing it.

What is the error that pops up?

And also, if this is a typo, make it:

local Camera = game.Workspace.CurrentCamera

There is no error. That showed in the Output.

Is this done on a localscript or server?

Yea it’s a typo. I meant to put that.

It is a server script in server script service.

Technically, you could set the CFrame of the camera instead of CameraSubject. Try:

Camera.CFrame = CameraPart.CFrame

Remember to make the part face forwards because the camera always places itself forwards.

You will have to fire a remote event to the client to change the camera as the server cannot change the perspective of a player.

1 Like

So like this?:


game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        Player.Chatted:Connect(function(Message)
            if Message == ":stage" then
                
                game:GetService("ReplicatedStorage").Chatted:FireClient()
                
            end
        end)
    end)
end)

Yes but ensure you are passing the player through the remote:

game:GetService("ReplicatedStorage").Chatted:FireClient(Player)

Alright, it works! Thanks! (This is for the thirty letters.)

1 Like