Hello.
I am trying to script something in the local script where, if a survivor dies from the killer, the survivors camera subject immeadiately towards the killers humanoid.
I’ve tried looking on the forums and trying to fix it myself, but there is no output and I couldn’t find any solution.
Here is my code.
local player = game:GetService("Players").LocalPlayer
local replicatedStorage = game:GetService("ReplicatedStorage")
local roundend = replicatedStorage:WaitForChild("RoundEnd", 10)
if not roundend then return end
local camera = workspace.CurrentCamera
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid", 10)
if not humanoid then
return
end
humanoid.Died:Connect(function()
local Entity = workspace.EntityFolder:WaitForChild("Entity")
if Entity then
camera.CameraType = Enum.CameraType.Follow
camera.CameraSubject = Entity
else
end
end)
end
roundend.OnClientEvent:Connect(function()
camera.CameraType = Enum.CameraType.Custom
end)
Any help is appreciated. Thank you.