Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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)

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? aquathorn321 858 — 9y
0
try capitalizing "upper" in line 8 aquathorn321 858 — 9y
0
Why would you edit your post with the given comment solution? Now people have no clue what you still need fixing with. DigitalVeer 1473 — 9y

1 answer

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
9 years ago

It works fine for me

It must be a StringValue though

Ad

Answer this question