I'm attempting to make a killcam script. How do I make it so that the player's camera follows the person who killed them when they die?
This is a really common script that you can find in free models. Just search for "killcam script" and you'll find several.
I'll walk you through the basics though:
Example:
player.Character.Humanoid.Died:connect(function() local killerTag = player.Character.Humanoid:findFirstChild("creator") if killerTag then local killerPlayer = killerTag.Value end end)
Just set your camera's CameraSubject property to the other player's character.
Example:
local camera = game.Workspace.CurrentCamera -- must call from a localscript camera.CameraSubject = killerPlayer.Character
local hum =game.Players.LocalPlayer.Character.Humanoid hum.Died:connect(function() if hum:findFirstChild"creator" then workspace.CurrentCamera.CameraSubject = hum.creator.Value.Character.Humanoid end end)