Help with Camera Man. after Respawn?
Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
Why doesn't this work after a player respawns? The LocalScript is located inside the PlayerGui.
01 | repeat wait() until game:GetService( "Players" ).LocalPlayer |
03 | local Player = game:GetService( "Players" ).LocalPlayer |
04 | local Playing = Player:WaitForChild( "Playing" ) |
05 | local Character = Player.Character |
06 | local Humanoid = Character:FindFirstChild( "Humanoid" ) |
07 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
08 | local Timer = ReplicatedStorage:WaitForChild( "Timer" ) |
09 | local MapHolder = workspace:WaitForChild( "MapHolder" ) |
10 | local SelectedMap = ReplicatedStorage:WaitForChild( "SelectedMap" ) |
11 | local Database = script.Parent:WaitForChild( "Database" ) |
13 | local CurrentCamera = workspace.CurrentCamera |
17 | if Timer.Value > 0 and Playing.Value = = false and Humanoid and Humanoid.Health > 0 and Database.Visible = = false then |
18 | CurrentCamera.CameraType = "Scriptable" |
19 | CurrentCamera.CameraSubject = MapHolder:FindFirstChild(SelectedMap.Value):FindFirstChild( "PartCAM" ) |
20 | CurrentCamera.CoordinateFrame = CFrame.new(MapHolder:FindFirstChild(SelectedMap.Value):FindFirstChild( "PartCAM" ).Position) * CFrame.Angles( 0 , Angle, 0 ) * CFrame.new( 0 , 0 , 25 ) |
21 | elseif Timer.Value < 0 or Database.Visible = = true and Playing.Value = = false and Humanoid and Humanoid.Health > 0 then |
22 | CurrentCamera.CameraType = "Scriptable" |
23 | CurrentCamera.CoordinateFrame = CFrame.new(workspace.Scene:FindFirstChild( "PartCAM" ).Position) * CFrame.Angles( 0 , Angle, 0 ) * CFrame.new( 0 , 0 , 10 ) |
24 | CurrentCamera.CameraSubject = workspace.Scene:FindFirstChild( "PartCAM" ) |
25 | elseif Timer.Value > 0 and Playing.Value = = true and Humanoid and Humanoid.Health > 0 then |
26 | CurrentCamera.CameraType = "Custom" |
27 | CurrentCamera.CameraSubject = Humanoid |
29 | Angle = Angle + math.rad( 0.5 ) |