I’m trying to make this loop but can’t figure it out for the life of me.
This is my script:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Team2Frame.Visible = true
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Team3Frame.Visible = true
wait(.1)
script.Parent.Parent.Team2Frame.Visible = false
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Team4Frame.Visible = true
wait(.1)
script.Parent.Parent.Team3Frame.Visible = false
wait(.1)
script.Parent.Parent.Team2Frame.Visible = false
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Team1Frame.Visible = true
wait(.1)
script.Parent.Parent.Team4Frame.Visible = false
wait(.1)
script.Parent.Parent.Team3Frame.Visible = false
wait(.1)
script.Parent.Parent.Team2Frame.Visible = false
end)
end)
end)
end)
pretty much what it does is switches frames every time you click a button. Is it possible to make it so once it gets to the last frame and you click the button again, it starts back at the 1st frame?