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)
I'm assuming you want to change the creator value to the player's name? In that case change line 6 to
creator.Value = playerName