I am making a script and I need the players name who killed it player.name dosen't work I think
moneyamount = 1
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.Cash.Value =Leaderstats.Cash.Value + 2 * game.Players.-- I need the players name here --.Dinosaur2.value
game.Players-- I need the players name here as well--..Dinosaur2 = game.players--Name again-- .Dinosaur 2.Value
wait(0.1)
local original = script
local copy = original:Clone()
copy.Parent = original.Parent
end
end
end
end
Humanoid.Died:connect(PwntX_X)
Some of them are not Capital letters when they are supposed to be. Please answer please!! please dont copy the script!

6 comments
Instance:findFirstChild and RBXScriptSignal:connect are deprecated, use ServiceProvider:GetService to get all services except Workspace.
you can use square brackets with a string inside them to see if something is a child of something else
like : if workspace["y"] then
I would also like to point out that you can use the collection service for tags instead of creating object values
thankyou but can you answer the question
every player has the dinosaur 2 value