Well, the title i could say explained everything, here's the code.
function workended(part)
local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then
parent.Humanoid.Health = 0
local player = game.Players:FindFirstChild(parent)
if player then
player.leaderstats.Money.Value = player.leaderstats.Money.Value + script.Parent.Parent.Value
end
end
end
script.Parent.Touched:connect(workended)
And when i step on it i get killed and dont get money. And yes, i checked the value and the value was actually 10 (it was meant to be also) Here's a screenshoot to prove that everything with the leaderstats is fine. http://prntscr.com/ceuw0u

1 comment
Oh, haha! My terrible mistake. And there was np error at all, The console only just said some yellow text (it displays when you die)