Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

this is my script? for the kill for money help me pls @roblor12

Asked by 6 years ago

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)

0
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. iSvenDerp 233 — 6y
0
im new in here but how? sarvida24 -5 — 6y
0
Edit your question, highlight the script, and then press the blue "Lua" button. XAXA 1569 — 6y
0
Please clean up the code so people can see it better, please Aquaventurer 26 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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)

0
Leaderstats must be an 'IntValue' , Not Folder User#17685 0 — 6y
0
iwhat i want is when player1 kills player2 player 1 will get money sarvida24 -5 — 6y
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. thesit123 509 — 6y
Ad

Answer this question