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 currency1.Value = currency1.Value + 10 --This is the reward after the player died. end end end) end) end)
COMMUNITY QUESTION
this is my script? for the kill for money help me pls @roblor12
1 answer
I'm out of my mind, what do you need here?
game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new("IntValue")
folder.Name = "leaderstats"
folder.Parent=player
local cur1 = Instance.new("IntValue")
cur1.Name = "Cash"
cur1.Parent=folder
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
cur1.Value = cur1.Value + 10
--This is the reward after the player died.
end
end
end)
end)
end)
3 comments
0
Leaderstats must be an 'IntValue' , Not Folder
0
iwhat i want is when player1 kills player2 player 1 will get money
0
Well @sarvida24, you might as well have a string value in every player character, or somewhere, to show who it is killed by; I mean, have a folder that is called "KilledBy", added a StringValue with the name of the player and the Value of the object who killed the player.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Put your script in a CodeBlock when asking a question, it makes it easier for us to answer your question and it looks more organized.
im new in here but how?
Edit your question, highlight the script, and then press the blue "Lua" button.
Please clean up the code so people can see it better, please