I am not 100% sure what you are need from this code as you have not explain what you are doing. Please check here for details of what is useful to include in a question.
The Camera is only relivant to the client and it is not shared with anyone else. Your error ServerScriptService.Camera:2: attempt to index local 'plr' (a nil value) is explaining that on line 2 of that script the variable named plr holds a nil value. This is because LocalPlayer only exists on the client. A LocalScript runs on the players device meaning that LocalPlayer will always be that player and can never logicly be any other.
You are asking the server to access LocalPlayer but a server manages all players so has no idea of what a local player is.
Back to the code....
When a player joins one of the servers tasks is to replicate the game world to the player. This is not done at the same time so your local script can run before the things needed are loaded. You can use WaitForChild to yeild (make the code pause at this function) while this child name not present. When this child name is added you can safely run the code you need.
Lastly search for the event that does the task you need. Never use loops when there are events available to you. CharacterAdded should be the event you use to change the camera upon player spawn.
Example:-
local plr = game:GetService("Players")
local cam = workspace.CurrentCamera
local model = workspace:WaitForChild("For thumbnail"):Wait("MainCam")
local function setupCamera()
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = model.CFrame
end
plr.CharacterAdded:Connect(setupCamera)
setupCamera()
Hope this helps
3 comments
hey, since the script is in SeverScriptService, It will be a normal script. you can't do game.Players.LocalPlayer in a normal script
what are you trying to do as well, just keep the camera like that, or do you have to press a button to make it go back to normal