I see no errors in the output, idk why its not working since it worked the last time I made it. Script:
game.Players.PlayerAdded:connect(function(plr) local c = Instance.new("Part") c.Anchored = true c.Name = plr.Name.."'s Camera part" while not plr.Character do wait() end plr.Character:WaitForChild("Head") while true do wait() c.CFrame = plr.Character.Head.CFrame * CFrame.new(0,-5,0) end local target = c local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 camera.CoordinateFrame = CFrame.new(target.Position) end)
(Script's in ServerScriptService)
This is a normal script
When I test it, it doesn't even create a part..
Your first error here is to forgot to set the parent of your variable named as "c" and your second error is your script is a sever script but for got the camera you need to be in a local script because the camera of the player is local and your third is not really an error but you can't run a code after you do "while true do" your line 11 will never run so for fix that you'll need to use coroutine if you want to more know about coroutine go here. now your code suppose to look like that:
local plr = game.Players.LocalPlayer local camera = workspace.CurrentCamera local c = Instance.new("Part") local target = c c.Anchored = true c.Name = plr.Name.."'s Camera part" while not plr.Character do wait() end plr.Character:WaitForChild("Head") local angle = 0 c.Parent = camera camera.CameraType = Enum.CameraType.Custom camera.CameraSubject = target camera.CoordinateFrame = target.CFrame coroutine.resume(coroutine.create(function() while true do wait() camera.CameraSubject = target c.CFrame = plr.Character.Head.CFrame * CFrame.new(0,-5,0) end end))
Don't forgot to put it in a LocalScript in the backpack !