01 | function Money() |
02 | player = game.Players.LocalPlayer |
03 | money = player.leadstats.Money |
04 | bank = player.leaderstats.BankedMoney |
05 | withdraw = script.Parent.Parent.MoneyValue |
06 | money.Value = withdraw.Value+money.Value |
07 | bank.Value = withdraw.Value-bank.Value |
08 | end |
09 |
10 |
11 | script.Parent.MouseButton 1 Down:connect(Money) |
It says that line 3 is a (Nil value)
which it's not...
Not really enough information to solve this entirely, but with what you have given I may see one mistake.
01 | function Money() |
02 | player = game.Players.LocalPlayer |
03 |
04 | money = player.leadstats.Money --Here you have "leadstats" |
05 | bank = player.leaderstats.BankedMoney -- Here you have "leaderstats" |
06 |
07 | withdraw = script.Parent.Parent.MoneyValue |
08 | money.Value = withdraw.Value+money.Value |
09 | bank.Value = withdraw.Value-bank.Value |
10 | end |
11 |
12 |
13 | script.Parent.MouseButton 1 Down:connect(Money) |
As I stated before, I do not think you provided enough info for use to help you effectively. Although, this is a basic observation I made looking at your script.
If this is incorrect, then I wish you luck later.
EDIT: I didn't read the earlier answers properly, my bad. Necrowave got it.
I think it's because you misspelled "leaderstats":
money = player.leadstats.Money
So, replace with:
1 | money = player.leaderstats.Money |
The "BankedMoney" IntValue clearly doesn't exist. The question is why hasn't it been created yet? Which part of your script is responsible for creating the IntValues?