Help me prepare something like a "switch" statement?
I suck at LUA, however I know enough to realize that there's no switch statement
In my game, I'm trying to create sort of like a "switch" statement, in which right before I delete a object from one side of my GUI, it gets transferred to another side. Think of it as like a card collection and you are switching cards in and out. I'm a fairly new scripter, bare with me ;)
Self explanatory enough, these series of codes automatically redirects cards into your trunk as you get them
01 | cards = player.Cards:GetChildren() |
03 | for i, v in pairs (cards) do |
04 | local cf = script.Parent.TrunkFrame:clone() |
06 | cf.Parent = script.Parent.Cards |
08 | cf.CardName.Text = v.Name |
09 | cf.Position = UDim 2. new( 3.80 , 0 ,count/ 5 , 0 ) |
This series of code makes it so that when I press the "Switch" button, the card would get deleted from the Trunk. Can someone help me with how I can manipulate this function to replicate the card on my Deck before deleting?
1 | cf.Switch.MouseButton 1 Down:connect( function () |
2 | pcall ( function () v:destroy() end ) |