So, I was just trying to make a kill for money script for my game, I keep on encountering errors whenever I try using the code that I provided.
Here is the code I used
game.Players.PlayerAdded:connect(function(player) local folder = Instance.new("Folder",player) folder.Name = "leaderstats" local currency1 = Instance.new("IntValue",folder) currency1.name = "Cash" player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() local tag = character.Humanoid:FindFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local stats = tag.Value:WaitForChild("leaderstats") stats["Cash"].Value = stats["Cash"].Value + 10 end end end) end) end)
Whenever I try killing an NPC or person, it just doesn't work. Can someone please help me?
Locked by cabbler and minikitkat
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?