So basically, I have been trying to make a block that gives you cash when you step on it, but it would print "Workspace.Money.Script:4: attempt to index nil with ‘leaderstats’ " Anyone know how to fix this?
Script:
local MoneyPart = game.Workspace.Money
MoneyPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 10
end
end)