I recieved help, to make the amount equal to what the player has, but for some reason, the word stats is underlined blue, and this pops up, "W002: Global 'stats' is deprecated". Could anyone help, I don't know what I should do. Thanks!
--------- amt=stats:FindFirstChild("Stored").Value --------- script.Parent.DialogChoiceSelected:connect(function(player, choice) if (choice == script.Parent.Choice1) then if (player ~= nil) then local stats = player:findFirstChild("leaderstats") local otherStats = player:findFirstChild("Stats2") if (stats ~= nil and otherStats ~= nil) then local playerStored = otherStats:findFirstChild("Stored") if stats:findFirstChild("Money").Value >= amt then otherStats:findFirstChild("Stored").Value = otherStats:findFirstChild("Stored").Value + amt stats:findFirstChild("Money").Value = stats:findFirstChild("Money").Value - amt end end end end if (choice == script.Parent.Choice2) then if (player ~= nil) then local stats = player:findFirstChild("leaderstats") local otherStats = player:findFirstChild("Stats2") if (stats ~= nil and otherStats ~= nil) then local playerStored = otherStats:findFirstChild("Stored") if otherStats:findFirstChild("Stored").Value >= amt then stats:findFirstChild("Money").Value = stats:findFirstChild("Money").Value + amt otherStats:findFirstChild("Stored").Value = otherStats:findFirstChild("Stored").Value - amt end end end end end)
You never defined stats
so Roblox thinks you're referring to this deprecated global that also happens to be called stats.