Basically my issue is I have a tower defense game, I have made a shop that works fine, but it sends folders to your backpack. I made a separate game (part of the same universe) that detects if any folders are in your backpack, which then lets you unlock and place the towers. Problem is, I don't know how to make the folder you receive from the shop in the lobby also be in your inventory for when you go to the match/round game.
The shop is a banner that has 1/4 chance to choose between 4 towers. The script can be seen below.
local price = 75
local db = true
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player.leaderstats.Points.Value >= price then
player.leaderstats.Points.Value = player.leaderstats.Points.Value - price
db = false
script.Parent.BrickColor = BrickColor.new("Bright red")
local generate = math.random(1,4)
if generate == 1 then
game.Lighting.Units["Shinra"]:clone().Parent = player.Backpack
elseif generate == 2 then
game.Lighting.Units["Edward Elric"]:clone().Parent = player.Backpack
elseif generate == 3 then
game.Lighting.Units["Levi"]:clone().Parent = player.Backpack
elseif generate == 4 then
game.Lighting.Units["Joker"]:clone().Parent = player.Backpack
end
end
wait(2)
script.Parent.BrickColor = BrickColor.new("Bright green")
db = true
end)
Basically, how would I save the folders you get from the banner to the Round/Match game's Backpack. And in general how would I save the folders you get from the banner for the next time you play?
