Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this script that performs in the event of a player's death not working right?

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

0

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?

0

try capitalizing "upper" in line 8

0

Why would you edit your post with the given comment solution? Now people have no clue what you still need fixing with.

1 answer

It works fine for me

It must be a StringValue though

This discussion is preserved as it was. New answers, comments, and votes are closed.