How to make a Kill to earn money system?

not normal script server script?

1 Like

like the one called “Script” is a server script

1 Like

i added a creator_tag which is a child of humanoid

1 Like

um, did u add the script i sent

1 Like

yes error string expected , got nil

1 Like

on what line does that error come

1 Like

the 6th line ---------------------

1 Like

I changed line 2 of the code you gave and now its giving the name of who killed it !!!

1 Like

now i only need the script that gives the player cash

where is the cash value located

inside player in a list called data

can u join the game and show screenshot

screenshot of what? the output?

where its located when u join the game

right beside where you spawn in the game

i mean like in the explorer show a screenshot of where it is inside the player

ok so ill tell u what i want to see, press play go in explorer go in players, open ur dropdown then open the data list

ah i see the problem try this:

local Players = game:GetService("Players");

script.Parent.Humanoid.Died:Connect(function()
	local playerWhoKilled = NPC:GetAttribute("LastHitBy");
	print(playerWhoKilled)
	Players[playerWhoKilled].data.Cash.Value += math.random(70,120)
end)

the issue was that before u told u did Data.Cash but the screenshot shows data.Cash ( capital issue )