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

My dialog shop isn't working when I have 90k coins, nothing is dispensed into the output. why?

Asked by 5 years ago

Ok, it appears my dialog shop isn't working.

I used commands to give my self 90k Coins in my game and well, while testing the purchase, it didn't work. Why?

local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
    -- Check the player has a stats object
    local stats = player:FindFirstChild('leaderstats')
    if not stats then return end


    local Coins = stats:FindFirstChild('Coins')
    if not Coins then return end

    if choice == dialog.DialogChoice['SCAR-H RDS'] then
        if Coins.Value >= 200 then
            game.ReplicatedStorage['SCAR-H RDS']:Clone().Parent = player.Backpack
            game.ReplicatedStorage['SCAR-H RDS']:Clone().Parent = player.StarterGear
            Coins.Value = Coins.Value - 200
        end 
    elseif choice == dialog.DialogChoice['Minigun'] then
        if Coins.Value >= 1000 then
            game.ReplicatedStorage.Minigun:Clone().Parent = player.StarterGear
            game.ReplicatedStorage.Minigun:Clone().Parent = player.Backpack
            Coins.Value = Coins.Value - 1000
        end
     elseif choice == dialog.DialogChoice['SPMP-57'] then
        if Coins.Value >= 100 then
            game.ReplicatedStorage['SPMP-57']:Clone().Parent = player.Backpack
            game.ReplicatedStorage['SPMP-57']:Clone().Parent = player.StarterGear
            Coins.Value = Coins.Value - 100
        end
      elseif choice == dialog.DialogChoice['PMA-MORS-9'] then
        if Coins.Value >= 750 then
            game.ReplicatedStorage['PMA-MORS-9']:Clone().Parent = player.StarterGear
            game.ReplicatedStorage['PMA-MORS-9']:Clone().Parent = player.Backpack
            Coins.Value = Coins.Value - 750
        end
       elseif choice == dialog.DialogChoice['FN Minimi[S]'] then
         if Coins.Value >= 500 then
             game.ReplicatedStorage['FN Minimi[S]']:Clone().Parent = player.StarterGear
             game.ReplicatedStorage['FN Minimi[S]']:Clone().Parent = player.Backpack
             Coins.Value = Coins.Value - 500
         end
        elseif choice ==dialog.DialogChoice['Arisaka(AntiMatter Rounds)'] then
          if Coins.Value >= 800 then
              game.ReplicatedStorage['Arisaka(AntiMatter Rounds)']:Clone().Parent = player.StarterGear
              game.ReplicatedStorage['Arisaka(AntiMatter Rounds)']:Clone().Parent = player.StarterGear
        end
    end
end


Nothing related to this is in the output

Answer this question