So the script is supposed to show a GUI and place the camera focus on the killer of a player.
The script only shows the GUI, but doesn't change the camera focus.
The only thing output gave me was this: "Workspace.KillCam:1: attempt to index field 'Instance' (a nil value)"
Can someone please help me?
Here's the script:
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
wait()
Character.Humanoid.Died:connect(function()
local Tag = Character.Humanoid:FindFirstChild("creator")
if Tag ~= nil then
if Tag.Value ~= nil then
if Tag.Value.Parent ~= nil then
if Tag.Value.Character ~= nil then
local Gui = script.KillGui:Clone()
Gui.TopFrame.TextLabel.Text = "You were Killed by " .. string.upper(Tag.Value.Name)
Gui.Parent = Player.PlayerGui
game.Workspace.CurrentCamera.CameraSubject = game.Workspace[Tag.Value].Character.Humanoid
game.Workspace.CurrentCamera = Enum.CameraType.Track
end
end
end
end
end)
end)
end)
