I got help from a user earlier today with this script. Thanks to that user, the script is much neater, but I am still encountering the same issue: The GUI part works, but the script still won't change the camera focus of the killed to the PoV of the killer.
Can someone please help me?
Here's the script:
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
Character.Humanoid.Died:connect(function() --Wait is unnecessary
local Tag = Character.Humanoid:FindFirstChild("creator")
if Tag ~= nil then
local Gui = script.KillGui:Clone()
Gui.Parent = Player.PlayerGui --Put this first
Gui.TopFrame.TextLabel.Text = "You were Killed by " .. string.upper(Tag.Value)
game.Workspace.CurrentCamera.CameraSubject = game.Workspace[Tag.Value].Humanoid
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Track
end
end)
end)
end)
Here's the only output I received: ServerScriptService.KillCam:8: bad argument #1 to 'upper' (string expected, got Object)

3 comments
looks to me like string.upper(Tag.Value) in line 8 is an object value, not a string value. Maybe you mean to take the name of the value?
try capitalizing "upper" in line 8
Why would you edit your post with the given comment solution? Now people have no clue what you still need fixing with.