This is what I did.
local player = script.Parent.Parent repeat wait() until Workspace.CurrentCamera repeat wait() until player.Character local C = Workspace.CurrentCamera player.Character.Humanoid.Died:connect(function() local killer = player.Character.Humanoid:findFirstChild("creator") if killer then for _,v in pairs(script.Parent:children()) do if v.Name ~= "KillCam" then v:remove() end end local G = Instance.new("ScreenGui",player.PlayerGui) local F1 = Instance.new("Frame",G) local F2 = Instance.new("Frame",G) F1.BackgroundColor3 = Color3.new(0/255,0/255,0/255) F2.BackgroundColor3 = Color3.new(0/255,0/255,0/255) F1.Size = UDim2.new(1,0,0,0) F2.Size = UDim2.new(1,0,0,0) F2.Position = UDim2.new(0,0,.85,0) Spawn(function() for i=1, 15 do wait() F1.Size = F1.Size + UDim2.new(0,0,.01,0) F2.Size = F2.Size + UDim2.new(0,0,.01,0) F2.Position = UDim2.new(0,0,1-(i*.01),0) end end) C.CameraSubject = killer.Value.Character C.CameraType = "Attach"
end end)
Assuming that this code gets loaded every time the player spawns the simplest way to do this would be to just add a bit a code to reset the camera.
local player = script.Parent.Parent repeat wait() until Workspace.CurrentCamera repeat wait() until player.Character local C = Workspace.CurrentCamera C.CameraSubject = player.Character.Humanoid -- Reset the CameraSubject to the humanoid C.CameraType = "Custom" -- Reset the CameraType to Custom player.Character.Humanoid.Died:connect(function() local killer = player.Character.Humanoid:findFirstChild("creator") if killer then for _,v in pairs(script.Parent:children()) do if v.Name ~= "KillCam" then v:remove() end end local G = Instance.new("ScreenGui",player.PlayerGui) local F1 = Instance.new("Frame",G) local F2 = Instance.new("Frame",G) F1.BackgroundColor3 = Color3.new(0/255,0/255,0/255) F2.BackgroundColor3 = Color3.new(0/255,0/255,0/255) F1.Size = UDim2.new(1,0,0,0) F2.Size = UDim2.new(1,0,0,0) F2.Position = UDim2.new(0,0,.85,0) Spawn(function() for i=1, 15 do wait() F1.Size = F1.Size + UDim2.new(0,0,.01,0) F2.Size = F2.Size + UDim2.new(0,0,.01,0) F2.Position = UDim2.new(0,0,1-(i*.01),0) end end) C.CameraSubject = killer.Value.Character C.CameraType = "Attach" end end)
If you have any questions, concerns or just need some help with this PM me on ROBLOX!
Closed as Not Constructive by evaera
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?