Code:
play.MouseButton1Click:Connect(function()
local twee = TS:Create(introframe, ti, {Position = opentarget})
local twee1 = TS:Create(storeframe, ti, {Position = closetarget})
local twee2 = TS:Create(teamframe, ti, {Position = closetarget})
local twee3 = TS:Create(infoframe, ti, {Position = closetarget})
twee:Play()
twee1:Play()
twee2:Play()
twee3:Play()
end)
info.MouseButton1Click:Connect(function()
local twee = TS:Create(introframe, ti, {Position = closetarget})
local twee1 = TS:Create(storeframe, ti, {Position = closetarget})
local twee2 = TS:Create(teamframe, ti, {Position = closetarget})
local twee3 = TS:Create(infoframe, ti, {Position = opentarget})
twee:Play()
twee1:Play()
twee2:Play()
twee3:Play()
end)
team.MouseButton1Click:Connect(function()
local twee = TS:Create(introframe, ti, {Position = closetarget})
local twee1 = TS:Create(storeframe, ti, {Position = closetarget})
local twee2 = TS:Create(teamframe, ti, {Position = opentarget})
local twee3 = TS:Create(infoframe, ti, {Position = closetarget})
twee:Play()
twee1:Play()
twee2:Play()
twee3:Play()
end)
store.MouseButton1Click:Connect(function()
local twee = TS:Create(introframe, ti, {Position = closetarget})
local twee1 = TS:Create(storeframe, ti, {Position = opentarget})
local twee2 = TS:Create(teamframe, ti, {Position = closetarget})
local twee3 = TS:Create(infoframe, ti, {Position = closetarget})
twee:Play()
twee1:Play()
twee2:Play()
twee3:Play()
end)
- What do you want to achieve?
In the first section; play.MouseButton1Click:Connect(function()
you see that I made the tween for the introframe
so that when play
is clicked, it will open the introframe
, which is a UI. And other 3 UIs will close if they are open. Now, I did the same for the other 3 buttons, if one UI is open, then all the other UIs will close, if they are open.
Now, is there a way so that the other UIs close if one UI is open, and I don’t have to make seperate tweens, so the work gets done with less code?
- What is the issue?
I am having issues in creating a table, which consists of tweens. I have no idea on how to create a table consisting of tweens, and then running the tween.
- What solutions have you tried so far?
I’ve looked on Youtube, and Google, but couldn’t find any correct answers.