this script is inside a character model's humanoid and it detects if the humanoid finds a creator whenever the humanoids health goes to 0.
In line 7, it prints nil instead of printing playerName even though I can clearly see my name inside the Player service
script.Parent.Changed:Connect(function()
--script.Parent is humanoid
if script.Parent.Health == 0 then
if script.Parent:FindFirstChild("creator") then
local creator = script.Parent.creator
local playerName = creator.Value
print(game.Players:FindFirstChild(playerName))
end
end
end)

3 comments
Quick question, what is "creator"? Is it like a value or what?
Are you wanting it to print your name only?
creator is a stringvalue all swords/weapons use to detect who killed you using the creator's value be the player's name. I want it to print out a certain player's name in the "Players" service using playerName, which is the creator's value; which is my name