What is the problem with this script?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
For some reason, all of the players money is stats2 are not being transfered.... this is what I have tried:
01 | local stats = player:findFirstChild( "leaderstats" ) |
03 | amt = stats:FindFirstChild( "Stored" ).Value |
06 | script.Parent.DialogChoiceSelected:connect( function (player, choice) |
07 | if (choice = = script.Parent.Choice 5 ) then |
08 | if (player ~ = nil ) then |
09 | local stats = player:findFirstChild( "leaderstats" ) |
10 | local otherStats = player:findFirstChild( "Stats2" ) |
11 | if (stats ~ = nil and otherStats ~ = nil ) then |
12 | local playerStored = otherStats:findFirstChild( "Stored" ) |
13 | if stats:findFirstChild( "Money" ).Value > = amt then |
14 | otherStats:findFirstChild( "Stored" ).Value = otherStats:findFirstChild( "Stored" ).Value + amt |
15 | stats:findFirstChild( "Money" ).Value = stats:findFirstChild( "Money" ).Value - amt |
21 | if (choice = = script.Parent.Choice 6 ) then |
22 | if (player ~ = nil ) then |
23 | local stats = player:findFirstChild( "leaderstats" ) |
24 | local otherStats = player:findFirstChild( "Stats2" ) |
25 | if (stats ~ = nil and otherStats ~ = nil ) then |
26 | local playerStored = otherStats:findFirstChild( "Stored" ) |
27 | if otherStats:findFirstChild( "Stored" ).Value > = amt then |
28 | stats:findFirstChild( "Money" ).Value = stats:findFirstChild( "Money" ).Value + amt |
29 | otherStats:findFirstChild( "Stored" ).Value = otherStats:findFirstChild( "Stored" ).Value - amt |