Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I change the amount so that all the players money is transferred?

Asked by 9 years ago

How do I change the amount so that all the players money is transferred? Right now it is set to 100$.

01---------
02amt= 100
03---------
04 
05script.Parent.DialogChoiceSelected:connect(function(player, choice)
06    if (choice == script.Parent.Choice1) then
07        if (player ~= nil) then
08            local stats = player:findFirstChild("leaderstats")
09            local otherStats = player:findFirstChild("Stats2")
10            if (stats ~= nil and otherStats ~= nil) then
11                local playerStored = otherStats:findFirstChild("Stored")
12                if stats:findFirstChild("Money").Value >= amt then
13                    otherStats:findFirstChild("Stored").Value = otherStats:findFirstChild("Stored").Value + amt
14                    stats:findFirstChild("Money").Value = stats:findFirstChild("Money").Value - amt
15                end
View all 33 lines...
0
You've done what you're question is asking... TheDeadlyPanther 2460 — 9y
0
No, but all the money the player has. Like if I had 97 dollars, how could I make the script take all 97, without needing 100 hurricanedog 0 — 9y
0
Change amt to the player's stored value. When the player clicks on the dialog, the script will do: amt = stats:FindFirstChild("Stored").Value TheDeadlyPanther 2460 — 9y

Answer this question