so here is the script:
01 | local button = script.Parent.Button |
02 |
03 | function steppedOn(part) |
04 |
05 | local character = part.Parent |
06 | local player = game.Players:GetPlayerFromCharacter(character) |
07 | if player and player = = script.Parent.Parent.Parent:FindFirstChild( 'Owner' ).Value then |
08 | local moneyAmount = player:FindFirstChild( 'leaderstats' ):FindFirstChild( 'Cash' ) |
09 |
10 | if moneyAmount.Value > = script.Parent.Cost.Value then |
11 |
12 | moneyAmount.Value = moneyAmount.Value - script.Parent.Cost.Value |
13 |
14 | for i, child in ipairs (script.Parent.Target.Value:GetChildren()) do |
15 |
Maybe try changing the value's name inside of the button.