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
cards = player.Cards:GetChildren() for i, v in pairs(cards) do local cf = script.Parent.TrunkFrame:clone() cf.Visible = true cf.Parent = script.Parent.Cards cf.Image = v.Texture cf.CardName.Text = v.Name cf.Position = UDim2.new(3.80,0,count/5,0) local c = cf local gr = v
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?
cf.Switch.MouseButton1Down:connect(function() pcall(function() v:destroy() end) ClearCardList() LoadCardList() end)
What about using "if" and "elseif" ?
Like this?
if Good then GoToHeaven() -- Not a really good example but try setting it to false again or something like that. elseif Bad then GoToHell() -- Not a really good example but try setting it to true again or something like that. end -- Don't mind the example pls
Use conditional statement "if"
Something = true if Something == true then -- script Something == false elseif Something == false then --script end